liferay-labs / arquillian-liferay

Arquillian Liferay Extension
Apache License 2.0
8 stars 12 forks source link

multiple deployments error #9

Closed gamerson closed 7 years ago

gamerson commented 7 years ago

I'm trying to use this extension in a multi-project gradle build here: https://github.com/gamerson/arquillian-workspace-example

When I run the testIntegration task of the sample-portlet module, it is configured to use 2 deployments, see here: https://github.com/gamerson/arquillian-workspace-example/blob/master/modules/sample-portlet/src/testIntegration/java/sample/portlet/test/SamplePortletFunctionalTest.java#L50-L62

I'm not sure if this is using arquillian correctly, but it seems to error

:modules:sample-portlet:compileTestIntegrationJava
:modules:sample-portlet:processTestIntegrationResources UP-TO-DATE
:modules:sample-portlet:testIntegrationClasses
:modules:sample-portlet:testIntegration

sample.portlet.test.SamplePortletFunctionalTest STANDARD_ERROR
    SLF4J: The requested version 1.5.11 by your slf4j binding is not compatible with [1.6, 1.7]
    SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
    Dec 02, 2016 9:49:00 PM org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ReusedSessionPermanentFileStorage readStore
    INFO: Reused session store is not available at /Users/greg/.drone-webdriver-session-store, a new one will be created.
21:49:01,707 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:02,162 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:02,272 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:02,473 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
    log4j:WARN No appenders could be found for logger (org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
21:49:02,805 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:02,978 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:03,125 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:03,366 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:03,430 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:04,077 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:04,484 INFO  [elasticsearch[Dragon Man][clusterService#updateTask][T#1]][metadata:317] [Dragon Man] [liferay-20116] update_mapping [LiferayDocumentType]
21:49:16,785 INFO  [RMI TCP Connection(2)-127.0.0.1][BundleStartStopLogger:35] STARTED sample.service_1.0.0 [489]
21:49:26,508 INFO  [RMI TCP Connection(2)-127.0.0.1][BundleStartStopLogger:38] STOPPED sample.portlet_1.0.0 [490]
21:49:26,559 INFO  [RMI TCP Connection(2)-127.0.0.1][BundleStartStopLogger:38] STOPPED sample.service_1.0.0 [489]

sample.portlet.test.SamplePortletFunctionalTest > classMethod FAILED
    java.io.IOException: Start of bundle with id 490 failed with message: Exception in com.liferay.arquillian.container.osgi.remote.activator.ArquillianBundleActivator.start() of bundle sample.portlet.

        Caused by:
        org.osgi.framework.BundleException: Exception in com.liferay.arquillian.container.osgi.remote.activator.ArquillianBundleActivator.start() of bundle sample.portlet.

            Caused by:
            javax.management.InstanceAlreadyExistsException: jboss.arquillian:service=jmx-test-runner

1 test completed, 1 failed
:modules:sample-portlet:testIntegration FAILED

Seems that the ArquillianBundleActivator is starting some jboss.arquillian:service service that already exists?

gamerson commented 7 years ago

I debugged this a bit and turns out that the JMXTestRunner being registered twice for each deployment was causing this to fail. So I just modified the registering of the JMXTestRunner beans to add a suffix based on the BSN. This fixed the error I was seeing with the FunctionalTest here: https://github.com/gamerson/arquillian-workspace-example/blob/master/modules/sample-portlet/src/testIntegration/java/sample/portlet/test/SamplePortletFunctionalTest.java