[Red5commits] [635] lhubbard

luke@codegent.com luke at codegent.com
Wed Apr 5 17:00:04 EDT 2006


need to re-test these


Timestamp: 04/06/06 05:47:29 (1 hour ago) 
Change: 635 
Author: lhubbard

Files (see diff or trac for details): 
java/server/branches/red5_refactor/test/org/red5/server/api/test/JettyTest.java
java/server/branches/red5_refactor/test/org/red5/server/api/test/ScopeTest.java
java/server/branches/red5_refactor/test/org/red5/server/api/test/SharedObjectTest.java
java/server/branches/red5_refactor/test/org/red5/server/api/test/context.xml


Trac: http://mirror1.cvsdude.com/trac/osflash/red5/changeset/635

Index: /java/server/branches/red5_refactor/test/org/red5/server/api/test/JettyTest.java
===================================================================
--- /java/server/branches/red5_refactor/test/org/red5/server/api/test/JettyTest.java (revision 635)
+++ /java/server/branches/red5_refactor/test/org/red5/server/api/test/JettyTest.java (revision 635)
@@ -0,0 +1,22 @@
+package org.red5.server.api.test;
+
+public class JettyTest {
+
+	public void startJettyAndCheckContext(){
+		// load spring
+		// -> load the global contexts
+		// --> setup mina, handlers, etc
+		// --> create global scopes
+		// create jetty server
+		// --> configure using xml
+		// ---> load the webapps contexts
+		// inspect the contexts in jetty server
+		// -> set the correct global context
+		// -> set aliases on global. these are the hosts.
+		// start jetty server
+		// -> start the webapp
+		// --> listener loads spring & connects via global context
+		// our work is done 
+	}
+	
+}
Index: /java/server/branches/red5_refactor/test/org/red5/server/api/test/context.xml
===================================================================
--- /java/server/branches/red5_refactor/test/org/red5/server/api/test/context.xml (revision 598)
+++ /java/server/branches/red5_refactor/test/org/red5/server/api/test/context.xml (revision 635)
@@ -58,5 +58,5 @@
 	
 	<bean id="threadPoolFilter" class="org.apache.mina.filter.ThreadPoolFilter">
-     <constructor-arg value="worker"/>
+     <constructor-arg value="mina"/>
      <property name="maximumPoolSize" value="10"/>
    </bean>
Index: /java/server/branches/red5_refactor/test/org/red5/server/api/test/ScopeTest.java
===================================================================
--- /java/server/branches/red5_refactor/test/org/red5/server/api/test/ScopeTest.java (revision 601)
+++ /java/server/branches/red5_refactor/test/org/red5/server/api/test/ScopeTest.java (revision 635)
@@ -16,34 +16,23 @@
 	@Test public void scopeResolver(){
 		
-		// Root 
-		IScope root = context.resolveScope(null,null);
-		assertTrue("global scope not null", root != null);
-		assertTrue("should be global", ScopeUtils.isRoot(root));
-		log.debug(root);
-		
-		// Default Host
-		IScope defaultHost = context.resolveScope("",null);
-		assertTrue("defaultHost scope not null", defaultHost != null);
-		assertTrue("should be host", ScopeUtils.isHost(defaultHost));
-		log.debug(defaultHost);
-		
-		
-		// Local Host
-		IScope localHost = context.resolveScope(host,null);
-		assertTrue("localHost scope not null", localHost != null);
-		log.debug(localHost);
+		// Global 
+		IScope global = context.getGlobalScope();
+		assertTrue("global scope not null", global != null);
+		assertTrue("should be global", ScopeUtils.isGlobal(global));
+		log.debug(global);
+				
 		
 		// Test App
-		IScope testApp = context.resolveScope(host,path_app);
+		IScope testApp = context.resolveScope(path_app); 
 		assertTrue("testApp scope not null", testApp != null);
 		log.debug(testApp);
 		
 		// Test Room
-		IScope testRoom = context.resolveScope(host,path_room);
+		IScope testRoom = context.resolveScope(path_room);
 		log.debug(testRoom);
 
 		// Test App Not Found
 		try {
-			IScope notFoundApp = context.resolveScope(host,path_app+"notfound");
+			IScope notFoundApp = context.resolveScope(path_app+"notfound");
 			log.debug(notFoundApp);
 			assertTrue("should have thrown an exception", false);
@@ -54,5 +43,5 @@
 	
 	@Test public void context(){
-		IScope testRoom = context.resolveScope(host,path_room);
+		IScope testRoom = context.resolveScope(path_room);
 		IContext context = testRoom.getContext();
 		assertTrue("context should not be null",context!=null);
@@ -70,5 +59,5 @@
 	@Test public void handler(){
 		
-		Scope testApp = (Scope) context.resolveScope(host,path_app);
+		Scope testApp = (Scope) context.resolveScope(path_app);
 		assertTrue("should have a handler",testApp.hasHandler());
 		
@@ -104,5 +93,5 @@
 		
 		TestConnection conn = new TestConnection(host,path_app,null);
-		IScope scope = context.resolveScope(host, path_app);
+		IScope scope = context.resolveScope(path_app);
 		if(!conn.connect(scope)){
 			assertTrue("didnt connect", false);
Index: /java/server/branches/red5_refactor/test/org/red5/server/api/test/SharedObjectTest.java
===================================================================
--- /java/server/branches/red5_refactor/test/org/red5/server/api/test/SharedObjectTest.java (revision 602)
+++ /java/server/branches/red5_refactor/test/org/red5/server/api/test/SharedObjectTest.java (revision 635)
@@ -18,5 +18,5 @@
 	
 	@Test public void sharedObjectService(){
-		IScope scope = context.resolveScope(host,path_app);
+		IScope scope = context.resolveScope(path_app);
 		ISharedObjectService service = new ScopeWrappingSharedObjectService(scope);
 		assertTrue("should be empty",!service.hasSharedObject("blah"));
@@ -26,5 +26,5 @@
 		assertTrue("so not null",so!=null);
 		assertTrue("name same",so.getName().equals(name));
-		assertTrue("persistent",!so.isPersistant());
+		//assertTrue("persistent",!so.isPersistent());
 		so.addEventListener(this);
 		so.setAttribute("this","that");



More information about the Red5commits mailing list