Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1501 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
7 changed files
with
177 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...er/src/main/java/org/jboss/webbeans/tck/integration/jbossas/FileSystemContainersImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package org.jboss.webbeans.tck.integration.jbossas; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import org.apache.log4j.Logger; | ||
import org.jboss.jsr299.tck.api.Configurable; | ||
import org.jboss.jsr299.tck.spi.Containers; | ||
|
||
|
||
public class FileSystemContainersImpl extends AbstractContainersImpl | ||
{ | ||
|
||
private static Logger log = Logger.getLogger(FileSystemContainersImpl.class); | ||
|
||
public static final String JBOSS_HOME_PROPERTY_NAME = "jbossHome"; | ||
|
||
private File deployDir; | ||
|
||
public FileSystemContainersImpl() throws IOException | ||
{ | ||
String jbossHome = System.getProperty(JBOSS_HOME_PROPERTY_NAME); | ||
if (jbossHome == null) | ||
{ | ||
throw new IllegalArgumentException("-DjbossHome must be set"); | ||
} | ||
deployDir = new File(jbossHome, "server/default/deploy"); | ||
if (!deployDir.isDirectory()) | ||
{ | ||
throw new IllegalArgumentException(deployDir.getPath() + " is not a directory"); | ||
} | ||
log.info("Deploying TCK artifacts to " + deployDir.getPath()); | ||
} | ||
|
||
public void deploy(InputStream archive, String name) throws IOException | ||
{ | ||
if (!validated) | ||
{ | ||
validate(); | ||
} | ||
File file = new File(deployDir, name); | ||
log.info("Deploying test " + name); | ||
file.createNewFile(); | ||
copy(archive, file); | ||
} | ||
|
||
public void undeploy(String name) throws IOException | ||
{ | ||
File file = new File(deployDir, name); | ||
if (file.exists()) | ||
{ | ||
file.delete(); | ||
} | ||
try | ||
{ | ||
// Give the app a chance to undeploy | ||
Thread.sleep(1000); | ||
} | ||
catch (InterruptedException e) | ||
{ | ||
Thread.currentThread().interrupt(); | ||
} | ||
} | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
...main/java/org/jboss/webbeans/tck/integration/jbossas/JBossTestServicesContainersImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.jboss.webbeans.tck.integration.jbossas; | ||
import java.io.File; | ||
import java.io.InputStream; | ||
|
||
import org.apache.log4j.Logger; | ||
import org.jboss.test.JBossTestServices; | ||
|
||
|
||
public class JBossTestServicesContainersImpl extends AbstractContainersImpl | ||
{ | ||
|
||
private Logger log = Logger.getLogger(JBossTestServicesContainersImpl.class); | ||
|
||
private final JBossTestServices testServices; | ||
private final File tmpdir; | ||
|
||
public JBossTestServicesContainersImpl() throws Exception | ||
{ | ||
this.testServices = new JBossTestServices(JBossTestServicesContainersImpl.class); | ||
testServices.setUpLogging(); | ||
testServices.init(); | ||
tmpdir = new File(System.getProperty("java.io.tmpdir"), "org.jboss.webbeans.tck.integration.jbossas"); | ||
tmpdir.mkdir(); | ||
tmpdir.deleteOnExit(); | ||
} | ||
|
||
public void deploy(InputStream archiveStream, String name) throws Exception | ||
{ | ||
if (!validated) | ||
{ | ||
validate(); | ||
} | ||
File archive = new File(tmpdir, name); | ||
archive.deleteOnExit(); | ||
copy(archiveStream, archive); | ||
testServices.deploy(getTmpArchiveName(name)); | ||
} | ||
|
||
public void undeploy(String name) throws Exception | ||
{ | ||
testServices.undeploy(getTmpArchiveName(name)); | ||
try | ||
{ | ||
// Give the app a chance to undeploy | ||
Thread.sleep(1000); | ||
} | ||
catch (InterruptedException e) | ||
{ | ||
Thread.currentThread().interrupt(); | ||
} | ||
} | ||
|
||
private String getTmpArchiveName(String name) | ||
{ | ||
File file = new File(tmpdir, name); | ||
return file.toURI().toString(); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
jboss-tck-runner/src/main/resources/META-INF/web-beans-tck.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
org.jboss.jsr299.tck.spi.Containers=org.jboss.webbeans.tck.integration.jbossas.ContainersImpl | ||
org.jboss.jsr299.tck.spi.Containers=org.jboss.webbeans.tck.integration.jbossas.JBossTestServicesContainersImpl | ||
org.jboss.jsr299.tck.api.TestLauncher=org.jboss.jsr299.tck.impl.runner.servlet.ServletTestLauncher | ||
org.jboss.jsr299.tck.connectDelay=1500 | ||
org.jboss.jsr299.tck.connectRetries=8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#jboss JNDI properties | ||
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory | ||
java.naming.provider.url=jnp://localhost:1099 | ||
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters