[jboss-svn-commits] JBL Code SVN: r37743 - in labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests: src/test/java/com/arjuna/qa/junit and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Nov 29 07:11:22 EST 2011
Author: zhfeng
Date: 2011-11-29 07:11:22 -0500 (Tue, 29 Nov 2011)
New Revision: 37743
Modified:
labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/pom.xml
labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/src/test/java/com/arjuna/qa/junit/BaseCrashTest.java
labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/src/test/java/com/arjuna/qa/junit/TestATCrashDuringOnePhaseCommit.java
Log:
JBTM-817 update to fix arquillian jboss container version to 7.1.0.CR1-SNAPSHOT
Modified: labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/pom.xml
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/pom.xml 2011-11-28 13:36:59 UTC (rev 37742)
+++ labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/pom.xml 2011-11-29 12:11:22 UTC (rev 37743)
@@ -57,7 +57,7 @@
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.0.0.Final-SNAPSHOT</version>
- <scope>test</scope>
+ <scope>compile</scope>
</dependency>
</dependencies>
<profiles>
@@ -85,9 +85,15 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
- <version>7.0.2.Final</version>
+ <version>7.1.0.CR1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-controller-client</artifactId>
+ <version>7.1.0.CR1-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</profile>
</profiles>
Modified: labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/src/test/java/com/arjuna/qa/junit/BaseCrashTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/src/test/java/com/arjuna/qa/junit/BaseCrashTest.java 2011-11-28 13:36:59 UTC (rev 37742)
+++ labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/src/test/java/com/arjuna/qa/junit/BaseCrashTest.java 2011-11-29 12:11:22 UTC (rev 37743)
@@ -7,16 +7,14 @@
import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.TargetsContainer;
-import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.After;
import org.junit.Before;
-import org.junit.runner.RunWith;
- at RunWith(Arquillian.class)
public class BaseCrashTest {
protected String XTSServiceTest = " -Dorg.jboss.jbossts.xts.servicetests.XTSServiceTestName=@TestName@";
protected String BytemanArgs = "-Djboss.modules.system.pkgs=org.jboss.byteman -Dorg.jboss.byteman.transform.all -javaagent:target/test-classes/lib/byteman.jar=script:target/test-classes/scripts/@BMScript at .txt,boot:target/test-classes/lib/byteman.jar,listener:true";
@@ -36,6 +34,10 @@
public static Archive<?> createTestArchive() {
WebArchive archive = ShrinkWrap.
createFromZipFile(WebArchive.class, new File(xtstestWar));
+ final String ManifestMF = "Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.modules,deployment.arquillian-service,org.jboss.msc,org.jboss.jts,org.jboss.xts\n";
+ archive.setManifest(new StringAsset(ManifestMF));
+
return archive;
}
@Before
@@ -66,8 +68,8 @@
}
}
}
-
- protected void runTest(String testClass) throws Exception {
+
+ protected void runTest(String testClass, long waitForCrash, long waitForRecovery) throws Exception {
Config config = new Config();
config.add("javaVmArguments", javaVmArguments + XTSServiceTest.replace("@TestName@", testClass));
@@ -75,14 +77,18 @@
deployer.deploy("xtstest");
//Waiting for crashing
- Thread.sleep(2 * 60 * 1000);
+ Thread.sleep(waitForCrash * 60 * 1000);
//Boot jboss as after crashing
config.add("javaVmArguments", javaVmArguments);
controller.start("jboss-as", config.map());
+
+ //redeploy xtstest
+ deployer.undeploy("xtstest");
+ deployer.deploy("xtstest");
//Waiting for recovery
- Thread.sleep(5 * 60 * 1000);
+ Thread.sleep(waitForRecovery * 60 * 1000);
deployer.undeploy("xtstest");
controller.stop("jboss-as");
Modified: labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/src/test/java/com/arjuna/qa/junit/TestATCrashDuringOnePhaseCommit.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/src/test/java/com/arjuna/qa/junit/TestATCrashDuringOnePhaseCommit.java 2011-11-28 13:36:59 UTC (rev 37742)
+++ labs/jbosstm/trunk/XTS/localjunit/crash-recovery-tests/src/test/java/com/arjuna/qa/junit/TestATCrashDuringOnePhaseCommit.java 2011-11-29 12:11:22 UTC (rev 37743)
@@ -14,6 +14,6 @@
public void SingleParticipantPrepareAndCommit() throws Exception {
testName = "SingleParticipantPrepareAndCommit";
String testClass = "org.jboss.jbossts.xts.servicetests.test.at.SingleParticipantPrepareAndCommitTest";
- runTest(testClass);
+ runTest(testClass, 3, 5);
}
}
More information about the jboss-svn-commits
mailing list