diff options
author | slewis | 2007-02-14 00:51:57 +0000 |
---|---|---|
committer | slewis | 2007-02-14 00:51:57 +0000 |
commit | 07cdd30e6c1b163e57f6f3ec27edd8c7e27ed612 (patch) | |
tree | 022c155bc4b7c10bc87ae1ca7733f232e0cf940a /tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse | |
parent | 6fed2d4a38780302bf7326abef7165abeab04bf2 (diff) | |
download | org.eclipse.ecf-07cdd30e6c1b163e57f6f3ec27edd8c7e27ed612.tar.gz org.eclipse.ecf-07cdd30e6c1b163e57f6f3ec27edd8c7e27ed612.tar.xz org.eclipse.ecf-07cdd30e6c1b163e57f6f3ec27edd8c7e27ed612.zip |
Initial checkin of new project
Diffstat (limited to 'tests/bundles/org.eclipse.ecf.tests.sharedobject/src/org/eclipse')
2 files changed, 95 insertions, 0 deletions
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()); + } + } + +} |