cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r240124 - /cocoon/trunk/src/test/org/apache/cocoon/core/container/RoleManagerTestCase.java
Date Thu, 25 Aug 2005 19:40:47 GMT
Author: cziegeler
Date: Thu Aug 25 12:40:28 2005
New Revision: 240124

URL: http://svn.apache.org/viewcvs?rev=240124&view=rev
Log:
Fix test case

Modified:
    cocoon/trunk/src/test/org/apache/cocoon/core/container/RoleManagerTestCase.java

Modified: cocoon/trunk/src/test/org/apache/cocoon/core/container/RoleManagerTestCase.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/core/container/RoleManagerTestCase.java?rev=240124&r1=240123&r2=240124&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/core/container/RoleManagerTestCase.java (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/core/container/RoleManagerTestCase.java Thu Aug
25 12:40:28 2005
@@ -18,6 +18,7 @@
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.logger.Logger;
+import org.apache.cocoon.components.ComponentInfo;
 import org.apache.cocoon.core.container.RoleManager;
 import org.jmock.Mock;
 import org.jmock.MockObjectTestCase;
@@ -44,14 +45,25 @@
         Configuration roles[] = new Configuration[1];
         roles[0] = (Configuration) child0.proxy();
         Configuration hints[] = new Configuration[0];
-        conf.expects(once()).method("getChildren").with(eq("role"))
-                .will(returnValue(roles));
+        conf.expects(once()).method("getName").will(returnValue("roles-list"));
+        conf.expects(once()).method("getChildren").will(returnValue(roles));
+        child0.expects(once()).method("getName").will(returnValue("role"));
         child0.expects(once()).method("getAttribute").with(eq("name"))
                 .will(returnValue("testName"));
-        child0.expects(once()).method("getAttribute").with(eq("shorthand"))
+        child0.expects(once()).method("getAttribute").with(eq("shorthand"), eq(null))
                 .will(returnValue("testShorthand"));
         child0.expects(once()).method("getAttribute").with(eq("default-class"), eq(null))
                 .will(returnValue("testClass"));
+        child0.expects(once()).method("getAttribute").with(eq("model"), eq(null))
+                .will(returnValue(ComponentInfo.TYPE_SINGLETON));
+        child0.expects(once()).method("getAttribute").with(eq("init"), eq(null))
+                .will(returnValue(null));
+        child0.expects(once()).method("getAttribute").with(eq("destroy"), eq(null))
+        .will(returnValue(null));
+        child0.expects(once()).method("getAttribute").with(eq("logger"), eq(null))
+                .will(returnValue(null));
+        child0.expects(once()).method("getAttribute").with(eq("logging"), eq(ComponentInfo.LOGGING_LOGKIT))
+                .will(returnValue(ComponentInfo.LOGGING_LOGKIT));
         child0.expects(once()).method("getChildren").with(eq("hint"))
                 .will(returnValue(hints));
         Mock logger = new Mock(Logger.class);
@@ -62,7 +74,7 @@
         conf.verify();
         child0.verify();
         assertEquals("Role name for shorthand incorrect", "testName", rm.getRoleForName("testShorthand"));
-        assertEquals("Default service info for role incorrect", "testClass", rm.getDefaultServiceInfoForRole("testName"));
+        assertEquals("Default service info for role incorrect", "testClass", rm.getDefaultServiceInfoForRole("testName").getServiceClassName());
         assertNull("Default service info for key must be null", rm.getDefaultServiceInfoForKey("testName",
"testShorthand"));
     }
 



Mime
View raw message