Skip to content

Commit

Permalink
Expected deployment exceptions
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1511 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Feb 13, 2009
1 parent 1ef39b0 commit 7ee29eb
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 3 deletions.
49 changes: 49 additions & 0 deletions jboss-tck-runner/pom.xml
Expand Up @@ -55,6 +55,10 @@

</dependencies>

<properties>
<restartJBoss>false</restartJBoss>
</properties>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -143,6 +147,49 @@
<name>jboss-as.dir</name>
<value>../jboss-as</value>
</property>
<property>
<name>jboss.force.restart</name>
<value>false</value>
</property>
<property>
<name>org.jboss.jsr299.tck.libraryDirectory</name>
<value>${project.build.directory}/dependency/lib</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>incontainer-restart</id>
<activation>
<property>
<name>incontainer-restart</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${project.build.directory}/dependency/jsr299-tck-impl-suite.xml</suiteXmlFile>
</suiteXmlFiles>
<systemProperties>
<property>
<name>org.jboss.jsr299.tck.standalone</name>
<value>false</value>
</property>
<property>
<name>jboss-as.dir</name>
<value>../jboss-as</value>
</property>
<property>
<name>jboss.force.restart</name>
<value>true</value>
</property>
<property>
<name>org.jboss.jsr299.tck.libraryDirectory</name>
<value>${project.build.directory}/dependency/lib</value>
Expand All @@ -154,5 +201,7 @@
</build>
</profile>
</profiles>



</project>
Expand Up @@ -30,6 +30,7 @@ public abstract class AbstractContainersImpl implements Configurable, Containers
public static final String JBOSS_HOME_PROPERTY_NAME = "jboss.home";
public static final String JBOSS_AS_DIR_PROPERTY_NAME = "jboss-as.dir";
public static final String JBOSS_BOOT_TIMEOUT_PROPERTY_NAME = "jboss.boot.timeout";
public static final String FORCE_RESTART_PROPERTY_NAME = "jboss.force.restart";

private static Logger log = Logger.getLogger(AbstractContainersImpl.class);

Expand Down Expand Up @@ -63,7 +64,7 @@ public void setConfiguration(Configuration configuration)
this.jbossHttpUrl = "http://" + configuration.getHost() + "/";
}

protected boolean checkJBossUp()
protected boolean isJBossUp()
{
// Check that JBoss is up!
try
Expand Down Expand Up @@ -117,7 +118,22 @@ public void setup() throws IOException
log.info("JBoss Home set to " + jbossHome);
}
this.bootTimeout = Long.getLong(JBOSS_BOOT_TIMEOUT_PROPERTY_NAME, 120000);
if (!checkJBossUp())
if (Boolean.getBoolean(FORCE_RESTART_PROPERTY_NAME))
{
if (isJBossUp())
{
shutDownJBoss();
try
{
Thread.sleep(10000);
}
catch (InterruptedException e)
{
Thread.currentThread().interrupt();
}
}
}
if (!isJBossUp())
{
jbossWasStarted = true;
launch(jbossHome, "run", "");
Expand All @@ -127,7 +143,7 @@ public void setup() throws IOException
boolean interrupted = false;
while (timeoutTime > System.currentTimeMillis())
{
if (checkJBossUp())
if (isJBossUp())
{
log.info("Started JBoss AS");
return;
Expand Down Expand Up @@ -166,6 +182,13 @@ public void cleanup() throws IOException
}
}

private void shutDownJBoss() throws IOException
{
log.info("Shutting down JBoss AS");
launch(jbossHome, "shutdown", "-S");
log.info("Shut down JBoss AS");
}

private static void launch(String jbossHome, String scriptFileName, String params) throws IOException
{
String osName = System.getProperty("os.name");
Expand Down

0 comments on commit 7ee29eb

Please sign in to comment.