[JBoss JIRA] (ARQ-618) ValidationException "DeploymentScenario contains targets not matching any defined Container in the registry." could be even more clear
by Geoffrey De Smet (Created) (JIRA)
ValidationException "DeploymentScenario contains targets not matching any defined Container in the registry." could be even more clear
--------------------------------------------------------------------------------------------------------------------------------------
Key: ARQ-618
URL: https://issues.jboss.org/browse/ARQ-618
Project: Arquillian
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Reporter: Geoffrey De Smet
Priority: Minor
I deployed to jetty 6 embedded and configured a container qualifier called "jetty-embedded".
Instead of seeing this error message:
{code}
ValidationException: DeploymentScenario contains targets not matching any defined Container in the registry. _DEFAULT_.
Possible causes are: No Deployable Container found on Classpath or your have defined a @org.jboss.arquillian.container.test.api.Deployment with a @org.jboss.arquillian.container.test.api.TargetsContainer value that does not match any found/configured Containers (see arquillian.xml container@qualifier)
{code}
I would like to see these error messages instead:
if ContainerRegistry.getContainers() == 0 then
{code}
ValidationException: DeploymentScenario contains a target (_DEFAULT_) not matching any defined Container in the registry.
Please include at least 1 Deployable Container in your Classpath.
{code}
otherwise
{code}
ValidationException: DeploymentScenario contains a target (_DEFAULT_) not matching any defined Container in the registry.
Possible causes are: None of the 2 Deployable Containers on your Classpath match or you have defined a @org.jboss.arquillian.container.test.api.Deployment with a @org.jboss.arquillian.container.test.api.TargetsContainer of value (_DEFAULT_) that does not match any found/configured Containers (jboss-embedded, jetty-embedded), see arquillian.xml container@qualifier.
{code}
Every "()" part contains the runtime values.
Here's the full original exception:
{code}
org.jboss.arquillian.container.test.impl.client.deployment.ValidationException: DeploymentScenario contains targets not matching any defined Container in the registry. _DEFAULT_. Possible causes are: No Deployable Container found on Classpath or your have defined a @org.jboss.arquillian.container.test.api.Deployment with a @org.jboss.arquillian.container.test.api.TargetsContainer value that does not match any found/configured Containers (see arquillian.xml container@qualifier)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
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:134)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
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:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
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:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
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:134)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:158)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 12 months
[JBoss JIRA] (ARQ-619) If multiple DeployableContainers are in the classpath the exception message should clearly say that
by Geoffrey De Smet (Created) (JIRA)
If multiple DeployableContainers are in the classpath the exception message should clearly say that
---------------------------------------------------------------------------------------------------
Key: ARQ-619
URL: https://issues.jboss.org/browse/ARQ-619
Project: Arquillian
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Affects Versions: 1.0.0.CR5
Reporter: Geoffrey De Smet
I 've configured both arquillian-jetty-embedded-6.1 and jboss-as-arquillian-container-managed in my pom.xml.
As a result of some weird exception based code in arquillian, I get this stacktrace which tells me it's another problem (which it is not):
{code}
org.jboss.arquillian.container.test.impl.client.deployment.ValidationException: DeploymentScenario contains targets not matching any defined Container in the registry. _DEFAULT_. Possible causes are: No Deployable Container found on Classpath or your have defined a @org.jboss.arquillian.container.test.api.Deployment with a @org.jboss.arquillian.container.test.api.TargetsContainer value that does not match any found/configured Containers (see arquillian.xml container@qualifier)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
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:134)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
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:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
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:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
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:134)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:158)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
{code}
So, what happened?
The method org.jboss.arquillian.core.impl.loadable.ServiceRegistryLoader#onlyOne
throw an exception:
{code}
public <T> T onlyOne(Class<T> serviceClass)
{
Collection<T> all = all(serviceClass);
if(all.size() == 1)
{
return all.iterator().next();
}
if(all.size() > 1)
{
throw new IllegalStateException("Multiple service implementations found for " + serviceClass + ". " + toClassString(all)); // <================ GOOD
}
return null;
}
{code}
and the method org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator#createRegistry
swept it under the covers:
{code} public void createRegistry(@Observes ArquillianDescriptor event)
{
...
if(activeConfiguration == null && reg.getContainers().size() == 0)
{
try
{
DeployableContainer<?> deployableContainer = serviceLoader.onlyOne(DeployableContainer.class);
if(deployableContainer != null)
{
reg.create(new ContainerDefImpl("arquillian.xml").setContainerName("default"), serviceLoader);
}
}
catch (Exception e)
{
// ignore // <====================================================== BAD
}
}
// export
registry.set(reg);
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 12 months
[JBoss JIRA] (ARQ-735) Problem with @Before - @After methods for in-container mode
by George Vagenas (JIRA)
George Vagenas created ARQ-735:
----------------------------------
Summary: Problem with @Before - @After methods for in-container mode
Key: ARQ-735
URL: https://issues.jboss.org/browse/ARQ-735
Project: Arquillian
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Base Implementation
Affects Versions: 1.0.0.CR7
Reporter: George Vagenas
Priority: Minor
Working with an unmanaged deployment and container in manualy mode. I notice that when running on in-container test mode there is an problem with the @Before and @After methods.
More specific for the first test in the suite, only the @Before method is being called while the @After method is never get called. For the rest of the test cases, neither the @Before nor the @After method is get called.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 12 months
[JBoss JIRA] (ARQ-736) Problem with ContainerController and passing config
by George Vagenas (JIRA)
George Vagenas created ARQ-736:
----------------------------------
Summary: Problem with ContainerController and passing config
Key: ARQ-736
URL: https://issues.jboss.org/browse/ARQ-736
Project: Arquillian
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Base Implementation, Deployable Containers SPI
Affects Versions: 1.0.0.CR7
Reporter: George Vagenas
I am using ContainerController to manually start and stop the container between test executions and pass new configuration parameters if needed. The problem is that once i pass some parameters for a test, the new configuration with the extra parameters is still there for the next test, if the test doesn't define any extra parameters and should work only with the configuration provided by arquillian.xml.
What i was expecting is to add extra configuration parameters for a specific test case and start the container, for the next test execution and if the test doesn't define any extra configuration parameters, it should start with the default configuration as defined in the arquillian.xml. Instead what is happenming is the following:
Test1 -> define extra param1=12345 -> containerController.start(container, extraParameters1) -> Configuration = arquillian.xml + param1 - OK
Test2 -> define extra param2 =54321-> containerController.start(container, extraParameters2) -> Configuration = arquillian.xml + param2 - OK
Test3 -> define NO EXTRA PARAM -> containerController.start(container) -> Configuration = arquillian.xml + param2 - NOT OK
If the previous test started the container with some extra parameters (param2) and the next test doesn't define any extra parameters, the configuration keeps the previous extra parameters instead of discard them.
On the containerController.stop() the configuration should be updated again.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 12 months