Foren

6.2 Integration Test Fails

thumbnail
Charalampos Chrysikopoulos, geändert vor 9 Jahren.

6.2 Integration Test Fails

Junior Member Beiträge: 79 Beitrittsdatum: 09.12.11 Neueste Beiträge
I am trying to be able to write an integration test for a custom entity (generated by service builder) in a custom plugin in liferay 6.2.

Because I couldn't find any documentation for that task, I tried some thing I read for liferay in 6.1, that are not working entirely anymore in 6.2.

I created a service.xml with an entity (actually with the sample entity). I run the service builder.

I created a test directory (as sibling to docroot) and inside it an integration directory. Then a src dir and in it a class IntegrationTest.java with the following code:


public class IntegrationTest {

	private static final Log logger = LogFactoryUtil.getLog(IntegrationTest.class);

	@Before
	public void setUp()
		throws Exception {

		InitUtil.initWithSpring();

	}

	@After
	public void tearDown()
		throws Exception {

	}

	@Test
	public void test() {

	}
}


Running the task "integration-test" from the ant, throws the following exception:


    [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.253 sec
    [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.253 sec
    [junit] Testcase: test(IntegrationTest):	Caused an ERROR
    [junit] Error creating bean with name 'com.liferay.portal.kernel.spring.util.SpringFactoryUtil#0' defined in class path resource [META-INF/base-spring.xml]: Cannot create inner bean 'com.liferay.portal.kernel.spring.util.SpringFactoryUtil#13d510' of type [com.liferay.portal.kernel.spring.util.SpringFactoryUtil] while setting constructor argument with key [TypedStringValue: value [beanMatcher], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.spring.util.SpringFactoryUtil#13d510' defined in class path resource [META-INF/base-spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static java.lang.Object com.liferay.portal.kernel.spring.util.SpringFactoryUtil.newBean(java.lang.String) throws com.liferay.portal.kernel.spring.util.SpringFactoryException] threw exception; nested exception is java.lang.NullPointerException
    [junit] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.spring.util.SpringFactoryUtil#0' defined in class path resource [META-INF/base-spring.xml]: Cannot create inner bean 'com.liferay.portal.kernel.spring.util.SpringFactoryUtil#13d510' of type [com.liferay.portal.kernel.spring.util.SpringFactoryUtil] while setting constructor argument with key [TypedStringValue: value [beanMatcher], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.spring.util.SpringFactoryUtil#13d510' defined in class path resource [META-INF/base-spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static java.lang.Object com.liferay.portal.kernel.spring.util.SpringFactoryUtil.newBean(java.lang.String) throws com.liferay.portal.kernel.spring.util.SpringFactoryException] threw exception; nested exception is java.lang.NullPointerException
    [junit] 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
    [junit] 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
    [junit] 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:378)
    [junit] 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:161)
    [junit] 	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
    [junit] 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:441)
    [junit] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:982)
    [junit] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:878)
    [junit] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:484)
    [junit] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
    [junit] 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    [junit] 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    [junit] 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    [junit] 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    [junit] 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    [junit] 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    [junit] 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    [junit] 	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    [junit] 	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    [junit] 	at com.liferay.portal.spring.context.ArrayApplicationContext.<init>(ArrayApplicationContext.java:31)
    [junit] 	at com.liferay.portal.spring.util.SpringUtil._loadContext(SpringUtil.java:74)
    [junit] 	at com.liferay.portal.spring.util.SpringUtil.loadContext(SpringUtil.java:60)
    [junit] 	at com.liferay.portal.util.InitUtil.initWithSpring(InitUtil.java:193)
    [junit] 	at com.liferay.portal.util.InitUtil.initWithSpring(InitUtil.java:166)
    [junit] 	at IntegrationTest.setUp(IntegrationTest.java:26)
    [junit] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.spring.util.SpringFactoryUtil#13d510' defined in class path resource [META-INF/base-spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static java.lang.Object com.liferay.portal.kernel.spring.util.SpringFactoryUtil.newBean(java.lang.String) throws com.liferay.portal.kernel.spring.util.SpringFactoryException] threw exception; nested exception is java.lang.NullPointerException
    [junit] 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
    [junit] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:982)
    [junit] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:878)
    [junit] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:484)
    [junit] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
    [junit] 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
    [junit] Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static java.lang.Object com.liferay.portal.kernel.spring.util.SpringFactoryUtil.newBean(java.lang.String) throws com.liferay.portal.kernel.spring.util.SpringFactoryException] threw exception; nested exception is java.lang.NullPointerException
    [junit] 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:157)
    [junit] 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)
    [junit] Caused by: java.lang.NullPointerException
    [junit] 	at com.liferay.portal.kernel.spring.util.SpringFactoryUtil.newBean(SpringFactoryUtil.java:35)
    [junit] 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:145)
    [junit] Test IntegrationTest FAILED
</init></init></init>


Without the service builder code there is no exception.

Can anybody help me here?
Thanks in advance.
thumbnail
Manuel de la Peña, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hey Charalampos

It's not possible to execute an integration test on plugins following a traditional approach. Please read this blog entry to execute integration test on plugins using Arquillian integration: https://www.liferay.com/es/web/manuel.delapenya/blog/-/blogs/-the-plugin-worked-on-my-computer-is-not-valid-anymore

I've to say that we haven't backported it to 6.2 yet, but I believe it will be a very easy task to implement, as it is not master-dependent code (it relys on ANT build.xml files).

Please tell us had you make progress on it!

Thanks!
thumbnail
Manuel de la Peña, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hi Charalampos

Did you make progress on it?

Thanks!
thumbnail
Charalampos Chrysikopoulos, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 79 Beitrittsdatum: 09.12.11 Neueste Beiträge
Hi Manuel,

I saw your comment and I read your article, but I didn't have time to try it out. It was not something trivial for me, so it must wait till I have enough time to get involved with it.

Thanks for your answer.
thumbnail
Charalampos Chrysikopoulos, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 79 Beitrittsdatum: 09.12.11 Neueste Beiträge
Hi Manuel,

I wanted to add my questions about your blog entry. You are describing a way to run the tests with Arquillian and you share some code in the git repository of the liferay-portal. I am using the liferay 6.2 SDK with the appropriate portal bundled with tomcat. I have in front of me a custom liferay plugin. So, I don't know how to use the code pieces from the GIT you are sharing. If I understand correctly, I should create a ant task (setup-testable-tomcat) to configure the tomcat, so that he can run the tests. But the task wasn't in the code. Perhaps it is in some other part of the portal code but I didn't have the time to look at it. Is it even possible to add this functionality in a sdk, simply be adding some tasks and perhaps some classes, or do I have to work on the portal sources to work it out? I will give it a try again perhaps next week.

Thanks again.
thumbnail
Manuel de la Peña, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hi Charalampos

The setup-testable-tomcat only configures your tomcat to use Arquillian, which means:
  • To enable JMX on the setenv.sh file form your CATALINA_HOME/bin
  • To install Tomcat's manager as web application under webapps
  • To configure Tomcat users to deal with manager, editing tomcat-users.xml file under CATALINA_HOME/conf

So maybe you can do it manually, as it is a once-to-be-done task (we created it to facilitate developers the integration: one target execution and.. voilá! the tomcat supports Arquillian)

Then, you need to add Arquillian dependencies to your plugin, via IVY configuration, and add an Arquillian descriptor for your tests, arquillian.xml file available on test classpath (maybe under YOUR_PORTLET/test/integration folder).

You could see this lab-project to understand it better: https://github.com/liferay-labs/jira-metrics-portlet (it is a 6.2.x plugin)

Please see ivy-setting.xml and ivy.xml to understand dependencies.

This project was a prototype to integrate arquillian, so it has everything to work alone. For our master branch we have tuned the conf files no to duplicate dependencies across plugins, just having then on the SDK. But I believe it will work for you.

Cheers!
thumbnail
Charalampos Chrysikopoulos, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 79 Beitrittsdatum: 09.12.11 Neueste Beiträge
Hi Manuel,

thanks a lot about all this information and your quick reply. As soon as I have some results I will post them here.
Joerg Schaefer, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 12 Beitrittsdatum: 21.10.14 Neueste Beiträge
Hi,

are there any news regarding this topic. Is there a backport for 6.2 available now?
I saw a presentation about that last week at the Liferay devcon. Automated testing with Arquillian
There was a question if this feature is available for 6.2 and the answer was yes.

regards Jörg
thumbnail
Manuel de la Peña, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hey Jorg

Sure, it's available on 6.2.x branch on github, so you can build it or port to your SDK.

Look here:
https://github.com/liferay/liferay-plugins/blob/6.2.x/build.properties

The jmx properties are present on build time, so the targets described on the blog post will generate the arquillian stuff.


Please share with us your feedback once you get it working

Thanks!
Joerg Schaefer, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 12 Beitrittsdatum: 21.10.14 Neueste Beiträge
Hi Manuel,

thanks for your answer. Cool! All there are all ant targets i need in the current 6.2.x branch.
As is can see there are some bigger changes made in the plugins SDK ant scripts.
E.g. You use more and more the macrodef element instead of antcall.
Do you know when this new scripts are released for CE and EE customers?

As i understood the only thing i have to change in the current EE plugins SDK is to change the test.classpath (adding the arquillian dependencies via ivy to that classpath) to run the arquillian tests, right? Do you have examples how i can do this?
The other stuff like configure tomcat i can do manually. That is no problem.

regards and thanks
Jörg
thumbnail
Manuel de la Peña, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hi Jorg

You can take a look on the examples Carlos Sierra presented on DevCon here:

Demo Arquillian Hook
Demo Arquillian Portlet

Related to the release process, we would need to confirm with our release team, we'll let you know once they are published, via blog entry and/or in this thread.

Thanks!
thumbnail
Krzysztof Gołębiowski, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Liferay Master Beiträge: 549 Beitrittsdatum: 25.06.11 Neueste Beiträge
Hello Manuel,
I've been also on the talk at Devcon which helped me to start playing with Arquilian. I'm trying now to use this in our maven projects. I know I have to port some of your code to my plugin (like WebArchiveBuilder.java as it is required by Arquilian) and perform all the other changes done by you ant target manually (create arquilian.xml, configure Tomcat, etc.).

Everything I have is the code of the plugin. Do you have any other materials that could help me (and can you share them with the public emoticon )? Do you know anybody that used arquilian with liferay and maven? Tha plugins or actually commit streams that you published contain only the services and tests itself, can you point the changes introduced in SDK instance that made arquillian working?

Regards and thanks for any help in advance,
Krzysztof Gołębiowski
Éric Barboza, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 11 Beitrittsdatum: 28.10.13 Neueste Beiträge
Hi Krzysztof,

Did you manage to integrate Arquillian into Liferay app tests using Maven? If yes, could you share something?

Thanks in advance.
thumbnail
Krzysztof Gołębiowski, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

Liferay Master Beiträge: 549 Beitrittsdatum: 25.06.11 Neueste Beiträge
Nope, unfortunately I haven't had any more time for this task and left it for better times emoticon
Jordi Joan Gomez Augustin, geändert vor 9 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 21 Beitrittsdatum: 18.05.11 Neueste Beiträge
Is there any news on integrating Arquillian using Maven?

Thanks a lot

Jordi-Joan
Rino Finazzo, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 7 Beitrittsdatum: 28.05.15 Neueste Beiträge
Hi Manuel,

Having no setup-testable-tomcat in Liferay 6.2 cega1, that I'm currently using, what are the steps in order to have it working ?
jira-metrics-portlet is enough to explain it on the portlet side, but what about the server configuration ?

Thanks
thumbnail
Manuel de la Peña, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hey Rino, thanks participating in the conversation!

For the server side, just follow these simple steps:

- install Tomcat's manager
- enable the JMX on Tomcat's setenv.sh:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=8099 -Dcom.sun.management.jmxremote.ssl=false

- configure tomcat-users.xml:

<tomcat-users>
        <role rolename="tomcat" />
        <role rolename="manager-gui" />
        <role rolename="manager-script" />
        <role rolename="manager-jmx" />
        <role rolename="manager-status" />
        <user password="tomcat" roles="tomcat,manager-gui,manager-script,manager-jmx,manager-status" username="tomcat" />
</tomcat-users>

Take into account that Spotify uses 8099 port for its stuff.

For the portlet side, remember that your arquillian.xml will use manager's credentials, and JMX port.
Rino Finazzo, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 7 Beitrittsdatum: 28.05.15 Neueste Beiträge
Manuel,
Server configuration seems to be ok now, I just imported Arquillian dependencies with ivy in eclipse, but I can't figure out how the arquillian.xml can be generated, should I write it manually and put it under test/integration directory of the plug-in ?
thumbnail
Manuel de la Peña, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Yes, you can create it by hand. See here the example: https://github.com/liferay-labs/jira-metrics-portlet/blob/master/test/integration/arquillian.xml

You could add this target, or similar, to your SDK:

<macrodef name="setup-arquillian">
		<attribute name="module.dir" />

		<sequential>
			<if>
				<and>
					<available file="@{module.dir}/test/integration" />
					<not>
						<resourcecontains resource="${module.dir.unix}/build.xml" substring="/build-common-osgi-plugin.xml&quot;" />
					</not>
					<not>
						<available file="@{module.dir}/test/integration/arquillian.xml" />
					</not>
				</and>
				<then>
					<echo file="@{module.dir}/test/integration/arquillian.xml">&lt;?xml version="1.0"?&gt;

&lt;arquillian
	xmlns="http://jboss.org/schema/arquillian"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"
&gt;
	&lt;container qualifier="tomcat" default="true"&gt;
		&lt;configuration&gt;
			&lt;property name="jmxPort"&gt;${jmx.remote.port}&lt;/property&gt;
			&lt;property name="pass"&gt;${app.server.tomcat.manager.password}&lt;/property&gt;
			&lt;property name="user"&gt;${app.server.tomcat.manager.user}&lt;/property&gt;
		&lt;/configuration&gt;
	&lt;/container&gt;
&lt;/arquillian&gt;</echo>
				</then>
			</if>
		</sequential>
	</macrodef>
Rino Finazzo, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 7 Beitrittsdatum: 28.05.15 Neueste Beiträge
I was able to resolve dependencies with ivy and then launch test target from eclipse ide, I'm launching test from liferay plugins 6.2 cega4, and all I get on console is
Buildfile: C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\build.xml
test:
   [delete] Deleting directory C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\test-classes\integration
   [delete] Deleting directory C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\test-results\integration
    [mkdir] Created dir: C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\test-classes\integration
    [mkdir] Created dir: C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\test-results\integration
     [copy] Copying 1 file to C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\test-classes\integration
[ivy:resolve] :: Apache Ivy 2.4.0 - 20141213170938 :: http://ant.apache.org/ivy/ ::
[ivy:resolve] :: loading settings :: file = C:\Program Files\eclipse\liferay-plugins-sdk-6.2\ivy-settings.xml
     [copy] Copied 4 empty directories to 4 empty directories under C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\test-classes\integration
    [javac] Compiling 1 source file to C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\test-classes\integration
BUILD SUCCESSFUL
Total time: 9 seconds


Is it necessary to use plugins-6.2.x branch to have arquillian working or I am missing something ?
thumbnail
Manuel de la Peña, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Ok, let's check your configuration:

- is JMX enabled on tomcat?
- is tomcat-users configured?
- is tomcat's manager installed?
- does the arquillian.xml exist in the plugin's test classpath?
- does the arquillian.xml point to the tomcat (URL and port)?
- is tomcat running?
- is IVY resolving arquillian dependencies, and putting them into your classpath?
- do you have "SDK/portlets/my-portlet/test/integration" as folder structure?

I believe that these steps should guide you to test execution of integration tests on your server.
Rino Finazzo, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 7 Beitrittsdatum: 28.05.15 Neueste Beiträge
Hi Manuel
Jmx enabled in tomcat with following configurations:

-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=8099
-Dcom.sun.management.jmxremote.ssl=false


I can access it at port 8099 with Visual VM client at localhost, anyway netstat says service is running
  TCP    0.0.0.0:8099           0.0.0.0:0              LISTENING


tomcat-users.xml
configured with
<role rolename="tomcat" />
         <role rolename="manager-gui" />
         <role rolename="manager-script" />
        <role rolename="manager-jmx" />
        <role rolename="manager-status" />
        <user password="tomcat" roles="tomcat,manager-gui,manager-script,manager-jmx,manager-status" username="tomcat" />


tomcat manager installed and I can access it at http://localhost:8080/manager/html, with user tomcat and password tomcat

arquillian.xml is located at:
plugins/portlets/my-portlet/test/integration/arquillian.xml

and it points to :

<!--?xml version="1.0" encoding="UTF-8"?-->
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian" xsi:schemalocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
	<container qualifier="tomcat" default="true">
		<configuration>
			<property name="jmxPort">8099</property>
			<property name="user">tomcat</property>
			<property name="pass">tomcat</property>
		</configuration>
	</container>
</arquillian>


tomcat is running at localhost:8080

ivy resolved all dependencies:

dependencies configured in ivy.xml are:
<dependencies defaultconf="default">
		<dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.3.Final" />
		<dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
		<dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0-SNAPSHOT" />
		<dependency conf="test->default" name="junit" org="junit" rev="4.8" />
	</dependencies>


entry classpath is
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=my-portlet&amp;ivyXmlPath=ivy.xml&amp;confs=*" />


all dependencies are located at C:\Users\MyUser\.ivy2\cache

the test cases with annotation @RunWith(Arquillian.class) correctly uses
import org.jboss.arquillian.junit.Arquillian;
with no error

Still test target stops at

  [javac] Compiling 1 source file to C:\Program Files\eclipse\liferay-plugins-sdk-6.2\portlets\my-portlet\test-classes\integration
BUILD SUCCESSFUL
Total time: 10 seconds
thumbnail
Manuel de la Peña, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Could you share an example? That way we could identify where the problem is.

emoticon
Rino Finazzo, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 7 Beitrittsdatum: 28.05.15 Neueste Beiträge
Just changed the file name with suffix *Test.java, now i'm getting

 [junit] WARNING: multiple versions of ant detected in path for junit 
    [junit]          jar:file:/C:/Program%20Files/eclipse/plugins/org.apache.ant_1.9.2.v201404171502/lib/ant.jar!/org/apache/tools/ant/Project.class
    [junit]      and jar:file:/C:/Program%20Files/eclipse/liferay-plugins-sdk-6.2/portlets/my-portlet/docroot/WEB-INF/lib/ant.jar!/org/apache/tools/ant/Project.class
    [junit] Testsuite: it.test.arqtest.user.ArquillianTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
    [junit] Testcase: it.test.arqtest.user.ArquillianTest:null:	Caused an ERROR
    [junit] Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
    [junit] junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
    [junit] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
    [junit] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
    [junit] 	at groovy.util.AntBuilder.performTask(AntBuilder.java:260)
    [junit] 	at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:220)
    [junit] 	at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
    [junit] 	at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:170)
    [junit] 	at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
    [junit] 	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:854)
    [junit] 	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:831)
    [junit] 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:164)
    [junit] 	at embedded_script_in_C__Program_Files_eclipse_liferay_plugins_sdk_6_dot_2_build_common_dot_xml.run(embedded_script_in_C__Program_Files_eclipse_liferay_plugins_sdk_6_dot_2_build_common_dot_xml:27)
    [junit] 	at org.codehaus.groovy.ant.Groovy.parseAndRunScript(Groovy.java:440)
    [junit] 	at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:414)
    [junit] 	at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:280)
    [junit] 	at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
    [junit] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:452)
    [junit] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:139)
    [junit] Running it.test.arqtest.user.ArquillianTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec

BUILD FAILED
C:\Program Files\eclipse\liferay-plugins-sdk-6.2\build-common.xml:3095: The following error occurred while executing this line:
: The following error occurred while executing this line:
C:\Program Files\eclipse\liferay-plugins-sdk-6.2\build-common.xml:2292: The following error occurred while executing this line:
C:\Program Files\eclipse\liferay-plugins-sdk-6.2\build-common.xml:2446: The following error occurred while executing this line:
C:\Program Files\eclipse\liferay-plugins-sdk-6.2\build-common.xml:2404: Process fork failed.


No jmx connections though
thumbnail
Manuel de la Peña, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

Junior Member Beiträge: 62 Beitrittsdatum: 06.07.11 Neueste Beiträge
Rino Finazzo:
Just changed the file name with suffix *Test.java,

Of course! our "ant test" target filters by Test classes
Rino Finazzo, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 7 Beitrittsdatum: 28.05.15 Neueste Beiträge
Sorry for bothering emoticon
but I have an error at junit task ant :

[junit] junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit.
    [junit] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
    [junit] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
    [junit] 	at groovy.util.AntBuilder.performTask(AntBuilder.java:260)
    [junit] 	at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:220)
    [junit] 	at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
    [junit] 	at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:170)
    [junit] 	at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
    [junit] 	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:854)
    [junit] 	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:831)
    [junit] 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:164)
    [junit] 	at embedded_script_in_C__Program_Files_eclipse_liferay_plugins_sdk_6_dot_2_build_common_dot_xml.run(embedded_script_in_C__Program_Files_eclipse_liferay_plugins_sdk_6_dot_2_build_common_dot_xml:27)
    [junit] 	at org.codehaus.groovy.ant.Groovy.parseAndRunScript(Groovy.java:440)
    [junit] 	at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:414)
    [junit] 	at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:280)
    [junit] 	at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
    [junit] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:452)
    [junit] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:139)
    [junit] Running it.test.arqtest.user.ArquillianTest



Here my test:

@RunWith(Arquillian.class)
public class ArquillianTest {
private List<user> users;
	@Before
	public void setUp() throws SystemException
	{
		users=UserLocalServiceUtil.getGroupUsers(10184);
	}
	@Test
	public void test() throws SystemException {
		
		
		Assert.assertEquals(58, users.size());
	}

}</user>


Any suggestion ?
Rino Finazzo, geändert vor 8 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 7 Beitrittsdatum: 28.05.15 Neueste Beiträge
After setting junit task with fork=false on build-common.xml, I had something more on my output

  [junit] Testcase: it.test.arqtest.user.ArquillianTest:	Caused an ERROR
    [junit] com.liferay.portal.kernel.process.ProcessUtil.execute(Lcom/liferay/portal/kernel/process/OutputProcessor;[Ljava/lang/String;)Lcom/liferay/portal/kernel/concurrent/NoticeableFuture;
    [junit] java.lang.NoSuchMethodError: com.liferay.portal.kernel.process.ProcessUtil.execute(Lcom/liferay/portal/kernel/process/OutputProcessor;[Ljava/lang/String;)Lcom/liferay/portal/kernel/concurrent/NoticeableFuture;
    [junit] 	at com.liferay.ant.arquillian.WebArchiveBuilder.build(WebArchiveBuilder.java:41)
    [junit] 	at com.liferay.ant.arquillian.generator.AntDeploymentScenarioGenerator.generate(AntDeploymentScenarioGenerator.java:47)
    [junit] 	at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:79)
    [junit] 	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
    [junit] 	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
    [junit] 	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
    [junit] 	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
    [junit] 	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
    [junit] 	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
    [junit] 	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)
    [junit] 	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
    [junit] 	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
    [junit] 	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
    [junit] 	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)
    [junit] 	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
    [junit] 	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
    [junit] 	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
    [junit] 	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
    [junit] 	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
    [junit] 	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
    [junit] 	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
    [junit] 	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
    [junit] 	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)
    [junit] 	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
    [junit] 	at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
    [junit] 	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
    [junit] 	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
    [junit] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
    [junit] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
    [junit] 	at groovy.util.AntBuilder.performTask(AntBuilder.java:260)
    [junit] 	at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:220)
    [junit] 	at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
    [junit] 	at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:170)
    [junit] 	at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
    [junit] 	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:854)
    [junit] 	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:831)
    [junit] 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:164)
    [junit] 	at embedded_script_in_C__Program_Files_eclipse_liferay_plugins_sdk_6_dot_2_build_common_dot_xml.run(embedded_script_in_C__Program_Files_eclipse_liferay_plugins_sdk_6_dot_2_build_common_dot_xml:27)
    [junit] 	at org.codehaus.groovy.ant.Groovy.parseAndRunScript(Groovy.java:440)
    [junit] 	at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:414)
    [junit] 	at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:280)
    [junit] 	at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
    [junit] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:452)
    [junit] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:139)
    [junit] Test it.test.arqtest.ArquillianTest FAILED
Rafal Pydyniak, geändert vor 7 Jahren.

RE: 6.2 Integration Test Fails

New Member Beiträge: 4 Beitrittsdatum: 06.12.16 Neueste Beiträge
Have you found any solution to this problem? I'm currently facing the same exception