tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r377031 - /incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/context/RuntimeBootTestCase.java
Date Sat, 11 Feb 2006 19:51:24 GMT
Author: jboynes
Date: Sat Feb 11 11:51:23 2006
New Revision: 377031

URL: http://svn.apache.org/viewcvs?rev=377031&view=rev
Log:
add test for context parents

Modified:
    incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/context/RuntimeBootTestCase.java

Modified: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/context/RuntimeBootTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/context/RuntimeBootTestCase.java?rev=377031&r1=377030&r2=377031&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/context/RuntimeBootTestCase.java
(original)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/system/context/RuntimeBootTestCase.java
Sat Feb 11 11:51:23 2006
@@ -31,6 +31,31 @@
  * @version $Rev$ $Date$
  */
 public class RuntimeBootTestCase extends TestCase {
+    private RuntimeContext runtime;
+
+    public void testContextParents() {
+        AggregateContext rootContext = runtime.getRootContext();
+        assertNotNull(rootContext);
+        assertEquals("tuscany.root", rootContext.getName());
+        assertSame(runtime, rootContext.getParent());
+
+        AggregateContext systemContext = runtime.getSystemContext();
+        assertNotNull(systemContext);
+        assertEquals("tuscany.system", systemContext.getName());
+        assertSame(runtime, systemContext.getParent());
+    }
+
+    public void testRuntimeLifecycle() {
+/* fails as system context has already been initialized
+        assertEquals(Context.RUNNING, runtime.getLifecycleState());
+        runtime.stop();
+
+        assertEquals(Context.STOPPED, runtime.getLifecycleState());
+
+        runtime.start();
+        assertEquals(Context.RUNNING, runtime.getLifecycleState());
+*/
+    }
 
     public void testIncrementalBoot() throws Exception{
 
@@ -54,6 +79,18 @@
         system.fireEvent(EventContext.MODULE_STOP, null);
         runtimeContext.stop();
         Assert.assertEquals(Context.STOPPED,system.getLifecycleState());
+    }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        runtime = new RuntimeContextImpl();
+        runtime.start();
+    }
+
+    protected void tearDown() throws Exception {
+        runtime.stop();
+        super.tearDown();
     }
 }
 



Mime
View raw message