public ConfigurationImpl(Configuration configuration) { this.outputDirectory = configuration.getOutputDirectory(); this.standalone = configuration.isStandalone(); this.runIntegrationTests = configuration.isRunIntegrationTests(); this.connectTimeout = configuration.getConnectTimeout(); this.libraryDirectory = configuration.getLibraryDirectory(); this.testLauncher = configuration.getInContainerTestLauncher(); this.containers = configuration.getContainers(); this.standaloneContainers = configuration.getStandaloneContainers(); this.host = configuration.getHost(); this.extraPackages = configuration.getExtraPackages(); this.extraResources = configuration.getExtraResources(); }
@Override public DeploymentException getDeploymentException() { try { return (DeploymentException) exception; } catch (final Exception e) { System.out.println("BADCAST"); return new DeploymentException("", exception); } }
public ConfigurationBuilder init() { if (!AbstractTest.isInContainer()) { configuration.setInContainerTestLauncher(getInstanceValue(TestLauncher.PROPERTY_NAME, TestLauncher.class, configuration.isRunIntegrationTests() || !configuration.isStandalone())); configuration.setContainers(getInstanceValue(Containers.PROPERTY_NAME, Containers.class, !configuration.isStandalone() || configuration.isRunIntegrationTests())); configuration.setStandaloneContainers(getInstanceValue(StandaloneContainers.PROPERTY_NAME, StandaloneContainers.class, configuration.isStandalone())); } return this; }
public PropertiesBasedConfigurationBuilder(T configuration) { this.propertiesManager = new PropertiesManager(); this.configuration = configuration; configuration.setOutputDirectory(propertiesManager.getStringValue(OUTPUT_DIRECTORY_PROPERTY_NAME, DEFAULT_OUTPUT_DIRECTORY, false)); configuration.setStandalone(propertiesManager.getBooleanValue(STANDALONE_PROPERTY_NAME, DEFAULT_STANDALONE, false)); configuration.setRunIntegrationTests(propertiesManager.getBooleanValue(RUN_INTEGRATION_TESTS_PROPERTY_NAME, DEFAULT_RUN_INTEGRATION_TESTS, false)); configuration.setConnectTimeout(propertiesManager.getIntValue(CONNECT_TIMEOUT_PROPERTY_NAME, DEFAULT_CONNECT_DELAY, false)); configuration.setLibraryDirectory(propertiesManager.getStringValue(LIBRARY_DIRECTORY_PROPERTY_NAME, DEFAULT_LIBRARY_DIRECTORY, false)); configuration.setHost(propertiesManager.getStringValue(HOST_PROPERTY_NAME, DEFAULT_HOST, false)); configuration.setTestPackage(propertiesManager.getStringValue(TEST_PACKAGE_PROPERTY_NAME, null, false)); }
public boolean isDeploymentProblem(org.jboss.testharness.api.DeploymentException deploymentException) { return isDeploymentException(deploymentException.getCause()); }
public TCKArtifact createArtifact(Class<?> declaringClass) { if ( declaringClass.isAnnotationPresent( Artifact.class ) ) { return new ArtifactProcessor( declaringClass, configuration.isStandalone(), configuration.getLibraryDirectory() ).createArtifact(); } else { return null; } }
private boolean isSuiteDeployingTestsToContainer() { return !isInContainer() && (!getCurrentConfiguration().isStandalone() || getCurrentConfiguration().isRunIntegrationTests()); }
@Override public void dumpArtifacts() { Configuration configuration = getConfiguration(); configuration.setStandalone(false); new ArtifactGenerator(configuration).dumpArtifacts(configuration.getTestPackage()); }
protected <T> T getInstanceValue(String propertyName, Class<T> expectedType, boolean required) { T instance = propertiesManager.getInstanceValue(propertyName, expectedType, required); if (instance instanceof Configurable) { ((Configurable) instance).setConfiguration(configuration); } return instance; }
public TestResult launchTest(InvocationContext ctx) throws IOException { try { ctx.proceed(); return new TestResultImpl(Status.PASSED, null); } catch (Exception e) { return new TestResultImpl(Status.FAILED, e); } }
@Override public DeploymentException getDeploymentException() { if (exception instanceof DeploymentException) { return (DeploymentException) exception; } System.out.println("BADCAST"); return new DeploymentException("", exception); }
public boolean isDefinitionError(org.jboss.testharness.api.DeploymentException deploymentException) { return isDefinitionException(deploymentException.getCause()); }
@Override public DeploymentException getDeploymentException() { if (exception instanceof DeploymentException) { return (DeploymentException) exception; } System.out.println("BADCAST"); return new DeploymentException("", exception); }
public boolean isDeploymentProblem(org.jboss.testharness.api.DeploymentException deploymentException) { return isDeploymentException(deploymentException.getCause()); }
@Override public DeploymentException getDeploymentException() { try { return (DeploymentException) exception; } catch (final Exception e) { System.out.println("BADCAST"); return new DeploymentException("", exception); } }
public boolean isDefinitionError(org.jboss.testharness.api.DeploymentException deploymentException) { return isDefinitionException(deploymentException.getCause()); }
@Override public DeploymentException getDeploymentException() { return new DeploymentException(exception.getLocalizedMessage(), exception); }
@Override public DeploymentException getDeploymentException() { return new DeploymentException(exception.getLocalizedMessage(), exception); }
public boolean deploy(Collection<Class<?>> classes, Collection<URL> beansXml) { this.testContainer = new TestContainer(beansXml, classes); try { testContainer.startContainer(); } catch (Exception e) { this.deploymentException = new DeploymentException("Error deploying beans", e); return false; } testContainer.ensureRequestActive(); return true; }
public boolean deploy(Collection<Class<?>> classes, Collection<URL> beansXml) { this.testContainer = new TestContainer(beansXml, classes); try { testContainer.startContainer(); } catch (Exception e) { this.deploymentException = new DeploymentException("Error deploying beans", e); return false; } testContainer.ensureRequestActive(); return true; }