[JBoss JIRA] Created: (ARQ-332) Add support for injectable configuration options
by John Ament (JIRA)
Add support for injectable configuration options
------------------------------------------------
Key: ARQ-332
URL: https://jira.jboss.org/browse/ARQ-332
Project: Arquillian
Issue Type: Feature Request
Components: Configuration
Environment: All
Reporter: John Ament
Priority: Minor
I may have more of a unique situation here, not sure, but I figure something like this would be useful to a lot of …
[View More]people. In my case, I have to test my application against multiple RDBMSs. Amongst the test cases I need to execute, the only deltas between them is really the orm.xml and persistence.xml for JPA, since we override the configuration. Currently, arquillian requires me to point to the files in my test cases. Granted, I could use a static string to manage them, but I was wondering if arquillian could provide something like this in arquillian.xml
<?xml version="1.0"?>
<arquillian xmlns="http://jboss.com/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:glassfish="urn:arq:org.jboss.arquillian.container.glassfish.embedded_3">
<glassfish:container>
<glassfish:sunResourcesXml>src/test/resources/sun-resources-mysql.xml</glassfish:sunResourcesXml>
</glassfish:container>
<properties>
<property name="orm-xml" value="src/test/resources/orm-mysql.xml"/>
<property name="persistence-xml" value="src/test/resources/pers-mysql.xml"/>
</properties>
</arquillian>
And then in the test case itself
@Inject ArquillianConfiguration config;
config.getProperty("orm-xml");
in order to access the property.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[View Less]
14 years, 4 months
[JBoss JIRA] Created: (ARQ-327) Tests called twice
by Stan Silvert (JIRA)
Tests called twice
------------------
Key: ARQ-327
URL: https://jira.jboss.org/browse/ARQ-327
Project: Arquillian
Issue Type: Bug
Components: Base Implementation
Affects Versions: 1.0.0.Alpha4
Reporter: Stan Silvert
Attachments: aqbug.jar
I have a simple bean and test class. testFoo will always be called an extra time with every test. When it wants to do testFoo it will call testFoo twice. When it …
[View More]wants to do testBar it will call testFoo and then testBar. Both result with failure in assertEquals(0, myFieldBean.getCounter())
Full Maven project attached as a jar.
public class MyBean {
private int counter = 0;
public int getCounter() { return counter++; }
}
@RunWith(Arquillian.class)
public class FooBarTest
{
@Inject MyBean myFieldBean;
public FooBarTest()
{
System.out.println("Called FooBarTest constructor");
}
@Test @Inject
public void testFoo(MyBean myBean)
{
System.out.println("Called testFoo");
System.out.println("myBean=" + myBean.toString());
System.out.println("myFieldBean=" + myFieldBean.toString());
Assert.assertEquals(0, myBean.getCounter());
Assert.assertEquals(0, myFieldBean.getCounter());
}
@Test
public void testBar()
{
System.out.println("Called testBar");
System.out.println("myFieldBean=" + myFieldBean.toString());
Assert.assertEquals(0, myFieldBean.getCounter());
}
}
Output is:
16:42:44,892 INFO [STDOUT] Called FooBarTest constructor
16:42:44,904 INFO [STDOUT] Called testFoo
16:42:44,905 INFO [STDOUT] myBean=org.jboss.aqbug.MyBean@2a5772
16:42:44,907 INFO [STDOUT] myFieldBean=org.jboss.aqbug.MyBean@1d3018e
16:42:44,915 INFO [STDOUT] Called testFoo
16:42:44,917 INFO [STDOUT] myBean=org.jboss.aqbug.MyBean@11821
16:42:44,918 INFO [STDOUT] myFieldBean=org.jboss.aqbug.MyBean@1d3018e
16:42:44,965 INFO [STDOUT] Called FooBarTest constructor
16:42:44,974 INFO [STDOUT] Called testFoo
16:42:44,977 INFO [STDOUT] myBean=org.jboss.aqbug.MyBean@12b4d3
16:42:44,978 INFO [STDOUT] myFieldBean=org.jboss.aqbug.MyBean@1d9604
16:42:45,036 INFO [STDOUT] Called testBar
16:42:45,037 INFO [STDOUT] myFieldBean=org.jboss.aqbug.MyBean@1d9604
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[View Less]
14 years, 5 months