You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2006/03/17 19:03:12 UTC
svn commit: r386678 - in /geronimo/branches/1.1/modules:
directory/project.xml
directory/src/test/org/apache/geronimo/directory/RunningTest.java
web-builder/src/test-resources/plans/tomcat-post.xml
Author: djencks
Date: Fri Mar 17 10:03:11 2006
New Revision: 386678
URL: http://svn.apache.org/viewcvs?rev=386678&view=rev
Log:
fix directory and generic web-builder modules
Modified:
geronimo/branches/1.1/modules/directory/project.xml
geronimo/branches/1.1/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java
geronimo/branches/1.1/modules/web-builder/src/test-resources/plans/tomcat-post.xml
Modified: geronimo/branches/1.1/modules/directory/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/directory/project.xml?rev=386678&r1=386677&r2=386678&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/directory/project.xml (original)
+++ geronimo/branches/1.1/modules/directory/project.xml Fri Mar 17 10:03:11 2006
@@ -314,4 +314,22 @@
</dependency>
</dependencies>
+ <build>
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Abstract*.java</exclude>
+ </excludes>
+ <resources>
+ <resource>
+ <directory>${basedir}/target/var</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ </resources>
+ </unitTest>
+ </build>
</project>
Modified: geronimo/branches/1.1/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java?rev=386678&r1=386677&r2=386678&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java (original)
+++ geronimo/branches/1.1/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java Fri Mar 17 10:03:11 2006
@@ -17,22 +17,18 @@
package org.apache.geronimo.directory;
-import java.util.HashSet;
-import java.util.Hashtable;
+import junit.framework.TestCase;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
-import javax.management.ObjectName;
import javax.naming.Context;
import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.KernelFactory;
-import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Hashtable;
public class RunningTest extends TestCase {
@@ -40,15 +36,7 @@
private static final String CREDENTIALS = "secret";
private ClassLoader cl = this.getClass().getClassLoader();
- private Kernel kernel;
-
- private ObjectName serverInfoName;
-
- private GBeanData serverInfoGBean;
-
- private ObjectName directoryName;
-
- private GBeanData directoryGBean;
+ private DirectoryGBean directory;
public void testRunning() throws Exception {
@@ -81,53 +69,29 @@
}
- private void start(GBeanData instance) throws Exception {
- kernel.loadGBean(instance, cl);
- kernel.startGBean(instance.getName());
- }
-
- private void stop(ObjectName name) throws Exception {
- kernel.stopGBean(name);
- kernel.unloadGBean(name);
- }
-
protected void setUp() throws Exception {
- super.setUp();
-
- kernel = KernelFactory.newInstance().createKernel("test.kernel");
- kernel.boot();
- // ServerInfo
- serverInfoName = new ObjectName("geronimo.system:role=ServerInfo");
- serverInfoGBean = new GBeanData(serverInfoName,
- BasicServerInfo.GBEAN_INFO);
- serverInfoGBean.setAttribute("baseDirectory", "./target");
- start(serverInfoGBean);
-
- // DirectoryGBean
- directoryName = new ObjectName("geronimo.system:type=Directory");
- directoryGBean = new GBeanData(directoryName, DirectoryGBean.GBEAN_INFO);
- directoryGBean.setReferencePattern("ServerInfo", serverInfoName);
- directoryGBean.setAttribute("classLoader", cl);
- directoryGBean.setAttribute("providerURL", "ou=system");
- directoryGBean.setAttribute("securityAuthentication", "simple");
- directoryGBean.setAttribute("securityPrincipal", PRINCIPAL);
- directoryGBean.setAttribute("securityCredentials", CREDENTIALS);
- directoryGBean.setAttribute("anonymousAccess", new Boolean(true));
- directoryGBean.setAttribute("enableNetworking", new Boolean(true));
- directoryGBean.setAttribute("port", new Integer(9389));
- directoryGBean.setAttribute("configFile", "var/directory.xml");
+ URL configURL = cl.getResource("directory.xml");
+ if (configURL == null) {
+ throw new Exception("Can't find config file on classpath");
+ }
+ String path = configURL.getPath();
+ path = path.substring(0, path.lastIndexOf("/"));
+ ServerInfo serverInfo = new BasicServerInfo(path);
+ directory = new DirectoryGBean(cl, null, true, "directory.xml", serverInfo);
+ directory.setEnableNetworking(true);
+ directory.setPort(9389);
+ directory.setProviderURL("ou=system");
+ directory.setSecurityAuthentication("simple");
+ directory.setSecurityCredentials(CREDENTIALS);
+ directory.setSecurityPrincipal(PRINCIPAL);
+ directory.doStart();
- start(directoryGBean);
}
protected void tearDown() throws Exception {
- super.tearDown();
-
- stop(directoryName);
- stop(serverInfoName);
- kernel.shutdown();
+ directory.doStop();
}
}
Modified: geronimo/branches/1.1/modules/web-builder/src/test-resources/plans/tomcat-post.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/web-builder/src/test-resources/plans/tomcat-post.xml?rev=386678&r1=386677&r2=386678&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/web-builder/src/test-resources/plans/tomcat-post.xml (original)
+++ geronimo/branches/1.1/modules/web-builder/src/test-resources/plans/tomcat-post.xml Fri Mar 17 10:03:11 2006
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<xml-fragment xmlns:tom="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+<xml-fragment xmlns:tom="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
<dep:environment>
<dep:configId>
<dep:groupId>test</dep:groupId>