arquillian configuration with domain mode test?
soul2zimate Jul 26, 2013 7:46 AMHi all,
I'm trying to write a cluster test case with domain mode in JBoss. According to https://github.com/jbossas/jboss-as/commit/47fa68f11029d35e827c65e4a09306664df56f1e and ManagedDomainTestCase and its arquillian.xml. It should work for server start/stop and artifact deploy/undeploy.
I tried to add similar configuration in my arquillian.xml :
<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://www.jboss.org/arquillian-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/arquillian-1.0 http://jboss.org/schema/arquillian/arquillian-1.0.xsd">
<engine>
<property name="deploymentExportPath">target/</property>
</engine>
... ...
<group qualifier="clustering-all">
.... ...
<container qualifier="container-domain" mode="custom" managed="false" default="true">
<configuration>
<property name="jbossHome">${basedir}/target/jbossas-clustering-${cacheMode}-${stack}-Domain</property>
<property name="serverConfig">${jboss.server.config.file.name:domain.xml}</property>
<property name="containerNameMap">
main-server-group=backend,
master:server-one=backend-1,
master:server-two=backend-2,
master:server-three=frontend-1
</property>
<property name="containerModeMap">
other.*=manual
</property>
</configuration>
</container>
</group>
</arquillian>
and in my test, I want to deploy simple test war to main-server-group members server-one and server-two and later simple Http request to test them. I use @Deployment and @TargetsContainer as follow:
@Deployment(name = DEPLOYMENT_DOMAIN, managed = false) | |
@TargetsContainer(backend) | |
public static Archive<?> deployment0() { | |
return getDeployment(); | |
} |
However, after serve statup-up, test run turns out a failure during deployment with following error message:
<error message="DeploymentScenario contains a target (backend) not matching any defined Container in the registry.
Possible causes are: None of the 4 Containers are marked as default or you have defined a @Deployment with a @TargetsContainer of value (backend) that does not match any found/configured Containers (container-0,container-1,container-domain,container-single), see arquillian.xml container@qualifier" type="org.jboss.arquillian.container.test.impl.client.deployment.ValidationException">org.jboss.arquillian.container.test.impl.client.deployment.ValidationException: DeploymentScenario contains a target (backend) not matching any defined Container in the registry.
Possible causes are: None of the 4 Containers are marked as default or you have defined a @Deployment with a @TargetsContainer of value (backend) that does not match any found/configured Containers (container-0,container-1,container-domain,container-single), see arquillian.xml container@qualifier
at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.throwNoMatchFound(DeploymentGenerator.java:254)
at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.throwTargetNotFoundValidationException(DeploymentGenerator.java:242)
at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.validate(DeploymentGenerator.java:102)
at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:234)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:101)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
</error>
<system-out>19:31:29,208 WARNING [org.jboss.arquillian.container.impl.MapObject] (main) Configuration contain properties not supported by the backing object org.jboss.as.arquillian.container.managed.ManagedContainerConfiguration
Unused property entries: {containerNameMap=
main-server-group=backend,
master:server-one=backend-1,
master:server-two=backend-2,
master:server-three=frontend-1
, containerModeMap=
other.*=manual
}
Supported property names: [outputToConsole, jbossHome, enableAssertions, waitForPorts, password, adminOnly, managementPort, javaVmArguments, javaHome, username, waitForPortsTimeoutInSeconds, managementAddress, serverConfig, allowConnectingToRunningServer, bundlePath, stopTimeoutInSeconds, startupTimeoutInSeconds, modulePath]
Looks like property containerNameMap is not supported here, Do I miss some configuration here to make the @TargetsContainer works?
Thanks,