[jboss-cvs] system2/src/tests/org/jboss/test/server/profileservice ...
Scott Stark
scott.stark at jboss.com
Wed Jul 12 05:10:36 EDT 2006
User: starksm
Date: 06/07/12 05:10:36
Modified: src/tests/org/jboss/test/server/profileservice
MainTestCase.java
Log:
Add a testCreateDefaultProfile
Revision Changes Path
1.2 +43 -4 system2/src/tests/org/jboss/test/server/profileservice/MainTestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MainTestCase.java
===================================================================
RCS file: /cvsroot/jboss/system2/src/tests/org/jboss/test/server/profileservice/MainTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- MainTestCase.java 6 Jul 2006 03:30:58 -0000 1.1
+++ MainTestCase.java 12 Jul 2006 09:10:36 -0000 1.2
@@ -21,16 +21,21 @@
*/
package org.jboss.test.server.profileservice;
-import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
+import org.jboss.deployers.spi.Deployment;
+import org.jboss.deployers.spi.MainDeployer;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.system.server.profileservice.ProfileServiceBootstrap;
import org.jboss.test.BaseTestCase;
import org.jboss.Main;
/**
+ * Test of the jboss main loading a configuration via the ProfileService.
*
- * Test
* @author Scott.Stark at jboss.org
* @version $Revision$
*/
@@ -43,7 +48,41 @@
// Public --------------------------------------------------------
- public void testDefault() throws Exception
+ /**
+ * Test creation of a default profile
+ * @throws Exception
+ */
+ public void testCreateDefaultProfile() throws Throwable
+ {
+ ProfileServiceBootstrap psb = new ProfileServiceBootstrap();
+ psb.bootstrap();
+ ProfileService ps = psb.getProfileService();
+ ProfileKey defaultKey = new ProfileKey("default");
+ Profile profile = ps.getProfile(defaultKey);
+ Deployment testBeans = profile.getDeployment("test-beans.xml");
+ if( testBeans == null )
+ {
+ if( profile == null )
+ profile = ps.newProfile(defaultKey);
+ MainDeployer deployer = psb.getMainDeployer();
+ URL testBeansURL = getResource("test-beans.xml");
+ testBeans = deployer.parse(testBeansURL);
+ profile.addDeployment(testBeans);
+ }
+ // Validate the deployment
+ testBeans = profile.getDeployment("test-beans.xml");
+ assertNotNull(testBeans);
+ String type = testBeans.getType();
+ assertEquals("Deployment type is beans", "beans", type);
+
+ }
+
+ /**
+ * Test the startup of the org.jboss.Main entry point using the "default"
+ * profile.
+ * @throws Exception
+ */
+ public void testDefaultStartup() throws Exception
{
ArrayList<String> args = new ArrayList<String>();
String[] tmp = {};
More information about the jboss-cvs-commits
mailing list