[jboss-cvs] jboss-seam/src/main/org/jboss/seam/mock ...
Gavin King
gavin.king at jboss.com
Fri Jun 15 01:16:29 EDT 2007
User: gavin
Date: 07/06/15 01:16:29
Modified: src/main/org/jboss/seam/mock BaseSeamTest.java
Log:
migrate to jboss embedded
Revision Changes Path
1.11 +24 -0 jboss-seam/src/main/org/jboss/seam/mock/BaseSeamTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BaseSeamTest.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mock/BaseSeamTest.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- BaseSeamTest.java 12 Jun 2007 18:46:43 -0000 1.10
+++ BaseSeamTest.java 15 Jun 2007 05:16:29 -0000 1.11
@@ -1,5 +1,6 @@
package org.jboss.seam.mock;
+import java.io.IOException;
import java.lang.reflect.Field;
import java.util.AbstractSet;
import java.util.Collections;
@@ -24,6 +25,8 @@
import org.hibernate.validator.ClassValidator;
import org.hibernate.validator.InvalidValue;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.embedded.Bootstrap;
import org.jboss.seam.Component;
import org.jboss.seam.Model;
import org.jboss.seam.contexts.Contexts;
@@ -834,6 +837,8 @@
public void init() throws Exception
{
+ startJbossEmbeddedIfNecessary();
+
application = new SeamApplication( new MockApplication() );
phases = createPhaseListener();
@@ -888,4 +893,23 @@
Reflections.setAndWrap(field, object, value);
}
+ private static boolean started;
+
+ protected void startJbossEmbeddedIfNecessary() throws DeploymentException, IOException
+ {
+ if ( !started )
+ {
+ Bootstrap bootstrap = Bootstrap.getInstance();
+ bootstrap.bootstrap();
+ started = true;
+
+ /*deployer.deployResourceBase("seam.properties");
+ deployer.deployResourceBase("META-INF/seam.properties");
+ deployer.deployResourceBase("META-INF/components.xml");*/
+
+ bootstrap.deployResourceBase("seam.properties");
+ }
+ }
+
+
}
More information about the jboss-cvs-commits
mailing list