[Jboss-cvs] JBossAS SVN: r56991 - branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 20 00:22:20 EDT 2006
Author: scott.stark at jboss.org
Date: 2006-09-20 00:22:18 -0400 (Wed, 20 Sep 2006)
New Revision: 56991
Modified:
branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
Log:
Get the tests running with the current deployer changes
Modified: branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
===================================================================
--- branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java 2006-09-20 04:21:19 UTC (rev 56990)
+++ branches/MC_VDF_WORK/system/src/tests/org/jboss/test/server/profileservice/MainTestCase.java 2006-09-20 04:22:18 UTC (rev 56991)
@@ -24,6 +24,7 @@
import java.net.URL;
import java.util.ArrayList;
+import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
import org.jboss.deployers.spi.deployment.MainDeployer;
import org.jboss.deployers.spi.structure.DeploymentContext;
import org.jboss.profileservice.spi.Profile;
@@ -31,6 +32,8 @@
import org.jboss.profileservice.spi.ProfileService;
import org.jboss.system.server.profileservice.ProfileServiceBootstrap;
import org.jboss.test.BaseTestCase;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
import org.jboss.Main;
/**
@@ -74,8 +77,10 @@
if( profile == null )
profile = ps.newProfile(defaultKey);
MainDeployer deployer = psb.getMainDeployer();
- URL testBeansURL = getResource("test-beans.xml");
- // TODO testBeans = deployer.parse(testBeansURL);
+ VFS vfs = VFS.getVFS(resourcesDir);
+ VirtualFile file = vfs.findChildFromRoot("deploy/beans/test-beans.xml");
+ testBeans = new AbstractDeploymentContext(file);
+ deployer.addDeploymentContext(testBeans);
profile.addDeployment(testBeans);
}
// Validate the deployment
@@ -83,7 +88,6 @@
assertNotNull(testBeans);
// TODO String type = testBeans.getType();
// assertEquals("Deployment type is beans", "beans", type);
-
}
/**
@@ -93,20 +97,19 @@
*/
public void testDefaultStartup() throws Exception
{
- // If jbosstest.deploy.dir is not defined fail
- String deployDirEnv = System.getenv("jbosstest.deploy.dir");
- String deployDirProp = System.getProperty("jbosstest.deploy.dir");
- if( deployDirProp == null && deployDirEnv != null )
- {
- System.setProperty("jbosstest.deploy.dir", deployDirEnv);
- deployDirProp = deployDirEnv;
- }
- assertNotNull("jbosstest.deploy.dir != null", deployDirProp);
+ // Set the jboss.server.home.url property to the system/src/resources dir
+ URL bootstrapDir = super.getResource("/bootstrap");
+ log.info("bootstrapDir: "+bootstrapDir);
+ URL resourcesDir = new URL(bootstrapDir, "..");
+ log.info("resourcesDir: "+resourcesDir);
+ System.setProperty("jboss.server.home.url", resourcesDir.toString());
+ //
+ System.setProperty("jboss.server.deployerBeansPrefix", "bootstrap/default/");
+
ArrayList<String> args = new ArrayList<String>();
String[] tmp = {};
Main main = new Main();
main.boot(args.toArray(tmp));
}
-
-}
\ No newline at end of file
+}
More information about the jboss-cvs-commits
mailing list