Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bundles/org.eclipse.ecf.tests.sharedobject')
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/.classpath7
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/.cvsignore1
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/.project28
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/META-INF/MANIFEST.MF12
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/build.properties4
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/Activator.java50
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/SharedObjectAddAbortExceptionTest.java45
7 files changed, 147 insertions, 0 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/.classpath b/tests/bundles/org.eclipse.ecf.tests.sharedobject/.classpath
new file mode 100755
index 000000000..751c8f2e5
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/.cvsignore b/tests/bundles/org.eclipse.ecf.tests.sharedobject/.cvsignore
new file mode 100755
index 000000000..ba077a403
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/.project b/tests/bundles/org.eclipse.ecf.tests.sharedobject/.project
new file mode 100755
index 000000000..1e618a167
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ecf.tests.sharedobject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/META-INF/MANIFEST.MF b/tests/bundles/org.eclipse.ecf.tests.sharedobject/META-INF/MANIFEST.MF
new file mode 100755
index 000000000..d4b49f717
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Sharedobject Tests Plug-in
+Bundle-SymbolicName: org.eclipse.ecf.tests.sharedobject
+Bundle-Version: 1.0.0.20070212
+Bundle-Activator: org.eclipse.ecf.tests.sharedobject.Activator
+Bundle-Vendor: eclipse.org
+Require-Bundle: org.eclipse.core.runtime,
+ org.junit,
+ org.eclipse.ecf,
+ org.eclipse.ecf.sharedobject
+Eclipse-LazyStart: true
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/build.properties b/tests/bundles/org.eclipse.ecf.tests.sharedobject/build.properties
new file mode 100755
index 000000000..34d2e4d2d
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/Activator.java b/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/Activator.java
new file mode 100755
index 000000000..9e65da1ab
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.ecf.tests.sharedobject;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.ecf.tests.sharedobject";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/SharedObjectAddAbortExceptionTest.java b/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/SharedObjectAddAbortExceptionTest.java
new file mode 100755
index 000000000..ffa3e6857
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse/ecf/tests/sharedobject/SharedObjectAddAbortExceptionTest.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Remy Suen, Composent Inc., and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remy Suen - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ecf.tests.sharedobject;
+
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ecf.core.sharedobject.SharedObjectAddAbortException;
+
+public class SharedObjectAddAbortExceptionTest extends TestCase {
+
+ public void testGetTimeout() {
+ try {
+ throw new SharedObjectAddAbortException(null, (Throwable) null, 10);
+ } catch (SharedObjectAddAbortException e) {
+ assertEquals(10, e.getTimeout());
+ }
+
+ try {
+ // Regression test for bug #167019
+ throw new SharedObjectAddAbortException(null, (Map) null, 10);
+ } catch (SharedObjectAddAbortException e) {
+ assertEquals(10, e.getTimeout());
+ }
+
+ try {
+ // Regression test for bug #167019
+ throw new SharedObjectAddAbortException(null, (List) null,
+ (Map) null, 10);
+ } catch (SharedObjectAddAbortException e) {
+ assertEquals(10, e.getTimeout());
+ }
+ }
+
+}

Back to the top