diff options
author | cdumoulin | 2011-02-09 12:17:26 +0000 |
---|---|---|
committer | cdumoulin | 2011-02-09 12:17:26 +0000 |
commit | 98b9d25db6b1894a03e5b0a4bf452a794bcaa8c4 (patch) | |
tree | c83f79818db23ca894577b892156413052743b17 | |
parent | 0b9030713e963d95aeb514d3c8deb5f5587cf48b (diff) | |
download | org.eclipse.papyrus-98b9d25db6b1894a03e5b0a4bf452a794bcaa8c4.tar.gz org.eclipse.papyrus-98b9d25db6b1894a03e5b0a4bf452a794bcaa8c4.tar.xz org.eclipse.papyrus-98b9d25db6b1894a03e5b0a4bf452a794bcaa8c4.zip |
NEW - bug 336701: [Core] ISashWindowsContainer should be registered as service
https://bugs.eclipse.org/bugs/show_bug.cgi?id=336701
The ISashWindowsContainer is now registered as a service and should be available.
-rw-r--r-- | tests/junit/plugins/core/org.eclipse.papyrus.core.tests/test/org/eclipse/papyrus/core/services/ServicesRegistryTest.java | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.core.tests/test/org/eclipse/papyrus/core/services/ServicesRegistryTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.core.tests/test/org/eclipse/papyrus/core/services/ServicesRegistryTest.java index f57f57d7afd..64c42d347c4 100644 --- a/tests/junit/plugins/core/org.eclipse.papyrus.core.tests/test/org/eclipse/papyrus/core/services/ServicesRegistryTest.java +++ b/tests/junit/plugins/core/org.eclipse.papyrus.core.tests/test/org/eclipse/papyrus/core/services/ServicesRegistryTest.java @@ -312,7 +312,7 @@ public class ServicesRegistryTest extends TestCase { }
/**
- * Test the start order for services of type Start et Service
+ * Test the start order for services of type Start and Service
* @throws ServiceException
*/
public void testStartDependantOrder() throws ServiceException {
@@ -379,6 +379,43 @@ public class ServicesRegistryTest extends TestCase { }
/**
+ * Start regular services, then add a new service and try to start it.
+ * This should work.
+ * @throws ServiceException
+ */
+ public void testStartRegistryAndThenAddNewServiceAndStartIt() throws ServiceException {
+
+ // Register some services
+ String A = "A";
+ String B = "B";
+ String C = "C";
+ servicesRegistry.add( new ServiceFactoryDesc( C, ServiceStartKind.STARTUP ));
+ servicesRegistry.add( new ServiceFactoryDesc( B, ServiceStartKind.STARTUP, Arrays.asList(C) ));
+ servicesRegistry.add( new ServiceFactoryDesc( A, ServiceStartKind.STARTUP, Arrays.asList(B) ));
+
+ // Start them
+ servicesRegistry.startRegistry();
+
+ // Register another services as pojo
+ IService instanciatedService = new ServiceA();
+ String key = instanciatedService.getClass().getName();
+ servicesRegistry.add(key, 1, instanciatedService);
+
+ // Try to start it
+ servicesRegistry.startServices(key);
+
+ // check services
+ assertTrue("service started", servicesRegistry.isStarted(A));
+ assertTrue("service started", servicesRegistry.isStarted(B));
+ assertTrue("service started", servicesRegistry.isStarted(C));
+
+ assertTrue("service started", servicesRegistry.isStarted(key));
+
+ assertEquals("get registered service", instanciatedService, servicesRegistry.getService(key));
+
+ }
+
+ /**
* Test Service Factory creation
* @throws ServiceException
*/
|