[JBoss JIRA] (ARQ-1782) @UsingDataSet/@ShouldMatchDataSet always makes test succeed
by Nicklas Karlsson (JIRA)
[ https://issues.jboss.org/browse/ARQ-1782?page=com.atlassian.jira.plugin.s... ]
Nicklas Karlsson updated ARQ-1782:
----------------------------------
Description:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fi.affecto.marela</groupId>
<artifactId>arq-concept</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<browser>chrome</browser>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.4.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-bom</artifactId>
<version>1.3.0.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.selenium</groupId>
<artifactId>selenium-bom</artifactId>
<version>2.41.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>4.3.5.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<version>2.0.2.Final</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-core</artifactId>
<version>1.0.0.Alpha7</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-dbunit</artifactId>
<version>1.0.0.Alpha7</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>arq-wildfly</id>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-7.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>8.1.0.CR2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
</project>
{code}
{code:java}
package fi.affecto.marela.test;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.UserTransaction;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.persistence.ShouldMatchDataSet;
import org.jboss.arquillian.persistence.UsingDataSet;
import org.jboss.arquillian.transaction.api.annotation.Transactional;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import fi.affecto.marela.jpa.Game;
@RunWith(Arquillian.class)
public class PersistenceExtensionTest
{
@Deployment
public static Archive<?> createDeployment()
{
return ShrinkWrap.create(WebArchive.class, "test.war").addPackage(Game.class.getPackage())
.addAsResource("persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
@PersistenceContext
EntityManager em;
@Inject
UserTransaction utx;
@Test
public void testA() throws Exception
{
Assert.assertNotNull(em);
utx.begin();
// em.joinTransaction();
Game g = new Game();
g.setId(666L);
g.setTitle("x");
Assert.assertFalse(em.contains(g));
g = em.merge(g);
Assert.assertTrue(em.contains(g));
utx.rollback();
}
@Test
@Transactional
public void testB() throws Exception
{
Assert.assertNotNull(em);
Game g = new Game();
g.setId(666L);
g.setTitle("x");
Assert.assertFalse(em.contains(g));
g = em.merge(g);
Assert.assertTrue(em.contains(g));
}
@Test
// @UsingDataSet("games.yml")
// @ShouldMatchDataSet("games-check.yml")
@Transactional
public void testC() throws Exception
{
Assert.assertTrue(false);
}
}
{code}
testC succeeds if the annotations are uncommented.
Furthermore, there is something strange with the em/transactions, the persistence works even if the em doesn't join the transaction and the em complains of a detached instance if merge() is switched for persist()
was:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fi.affecto.marela</groupId>
<artifactId>arq-concept</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<browser>chrome</browser>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.4.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-bom</artifactId>
<version>1.3.0.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.selenium</groupId>
<artifactId>selenium-bom</artifactId>
<version>2.41.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>4.3.5.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<version>2.0.2.Final</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-core</artifactId>
<version>1.0.0.Alpha7</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-dbunit</artifactId>
<version>1.0.0.Alpha7</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>arq-wildfly</id>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-7.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>8.1.0.CR2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
</project>
{code:xml}
{code:java}
package fi.affecto.marela.test;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.UserTransaction;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.persistence.ShouldMatchDataSet;
import org.jboss.arquillian.persistence.UsingDataSet;
import org.jboss.arquillian.transaction.api.annotation.Transactional;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import fi.affecto.marela.jpa.Game;
@RunWith(Arquillian.class)
public class PersistenceExtensionTest
{
@Deployment
public static Archive<?> createDeployment()
{
return ShrinkWrap.create(WebArchive.class, "test.war").addPackage(Game.class.getPackage())
.addAsResource("persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
@PersistenceContext
EntityManager em;
@Inject
UserTransaction utx;
@Test
public void testA() throws Exception
{
Assert.assertNotNull(em);
utx.begin();
// em.joinTransaction();
Game g = new Game();
g.setId(666L);
g.setTitle("x");
Assert.assertFalse(em.contains(g));
g = em.merge(g);
Assert.assertTrue(em.contains(g));
utx.rollback();
}
@Test
@Transactional
public void testB() throws Exception
{
Assert.assertNotNull(em);
Game g = new Game();
g.setId(666L);
g.setTitle("x");
Assert.assertFalse(em.contains(g));
g = em.merge(g);
Assert.assertTrue(em.contains(g));
}
@Test
// @UsingDataSet("games.yml")
// @ShouldMatchDataSet("games-check.yml")
@Transactional
public void testC() throws Exception
{
Assert.assertTrue(false);
}
}
{code:java}
testC succeeds if the annotations are uncommented.
Furthermore, there is something strange with the em/transactions, the persistence works even if the em doesn't join the transaction and the em complains of a detached instance if merge() is switched for persist()
> @UsingDataSet/@ShouldMatchDataSet always makes test succeed
> -----------------------------------------------------------
>
> Key: ARQ-1782
> URL: https://issues.jboss.org/browse/ARQ-1782
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Extension - Persistence
> Affects Versions: persistence_1.0.0.Alpha7
> Environment: WildFly 8 CR 2
> Reporter: Nicklas Karlsson
> Assignee: Bartosz Majsak
>
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>fi.affecto.marela</groupId>
> <artifactId>arq-concept</artifactId>
> <version>1.0.0-SNAPSHOT</version>
> <packaging>jar</packaging>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <browser>chrome</browser>
> </properties>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>org.jboss.arquillian</groupId>
> <artifactId>arquillian-bom</artifactId>
> <version>1.1.4.Final</version>
> <scope>import</scope>
> <type>pom</type>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.extension</groupId>
> <artifactId>arquillian-drone-bom</artifactId>
> <version>1.3.0.Final</version>
> <type>pom</type>
> <scope>import</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.selenium</groupId>
> <artifactId>selenium-bom</artifactId>
> <version>2.41.0</version>
> <type>pom</type>
> <scope>import</scope>
> </dependency>
> </dependencies>
> </dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.11</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.junit</groupId>
> <artifactId>arquillian-junit-container</artifactId>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-jpamodelgen</artifactId>
> <version>4.3.5.Final</version>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.graphene</groupId>
> <artifactId>graphene-webdriver</artifactId>
> <version>2.0.2.Final</version>
> <type>pom</type>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.extension</groupId>
> <artifactId>arquillian-persistence-core</artifactId>
> <version>1.0.0.Alpha7</version>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.extension</groupId>
> <artifactId>arquillian-persistence-dbunit</artifactId>
> <version>1.0.0.Alpha7</version>
> </dependency>
> </dependencies>
> <profiles>
> <profile>
> <id>arq-wildfly</id>
> <dependencies>
> <dependency>
> <groupId>org.jboss.spec</groupId>
> <artifactId>jboss-javaee-7.0</artifactId>
> <version>1.0.0.Final</version>
> <type>pom</type>
> <scope>provided</scope>
> </dependency>
> <dependency>
> <groupId>org.wildfly</groupId>
> <artifactId>wildfly-arquillian-container-remote</artifactId>
> <version>8.1.0.CR2</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>org.jboss.arquillian.protocol</groupId>
> <artifactId>arquillian-protocol-servlet</artifactId>
> <scope>test</scope>
> </dependency>
> </dependencies>
> </profile>
> </profiles>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.3.2</version>
> <configuration>
> <source>1.7</source>
> <target>1.7</target>
> </configuration>
> </plugin>
> </plugins>
> <testResources>
> <testResource>
> <directory>src/test/resources</directory>
> <filtering>true</filtering>
> </testResource>
> </testResources>
> </build>
> </project>
> {code}
> {code:java}
> package fi.affecto.marela.test;
> import javax.inject.Inject;
> import javax.persistence.EntityManager;
> import javax.persistence.PersistenceContext;
> import javax.transaction.UserTransaction;
> import org.jboss.arquillian.container.test.api.Deployment;
> import org.jboss.arquillian.junit.Arquillian;
> import org.jboss.arquillian.persistence.ShouldMatchDataSet;
> import org.jboss.arquillian.persistence.UsingDataSet;
> import org.jboss.arquillian.transaction.api.annotation.Transactional;
> import org.jboss.shrinkwrap.api.Archive;
> import org.jboss.shrinkwrap.api.ShrinkWrap;
> import org.jboss.shrinkwrap.api.asset.EmptyAsset;
> import org.jboss.shrinkwrap.api.spec.WebArchive;
> import org.junit.Assert;
> import org.junit.Test;
> import org.junit.runner.RunWith;
> import fi.affecto.marela.jpa.Game;
> @RunWith(Arquillian.class)
> public class PersistenceExtensionTest
> {
> @Deployment
> public static Archive<?> createDeployment()
> {
> return ShrinkWrap.create(WebArchive.class, "test.war").addPackage(Game.class.getPackage())
> .addAsResource("persistence.xml", "META-INF/persistence.xml")
> .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
> }
> @PersistenceContext
> EntityManager em;
> @Inject
> UserTransaction utx;
> @Test
> public void testA() throws Exception
> {
> Assert.assertNotNull(em);
> utx.begin();
> // em.joinTransaction();
> Game g = new Game();
> g.setId(666L);
> g.setTitle("x");
> Assert.assertFalse(em.contains(g));
> g = em.merge(g);
> Assert.assertTrue(em.contains(g));
> utx.rollback();
> }
>
> @Test
> @Transactional
> public void testB() throws Exception
> {
> Assert.assertNotNull(em);
> Game g = new Game();
> g.setId(666L);
> g.setTitle("x");
> Assert.assertFalse(em.contains(g));
> g = em.merge(g);
> Assert.assertTrue(em.contains(g));
> }
> @Test
> // @UsingDataSet("games.yml")
> // @ShouldMatchDataSet("games-check.yml")
> @Transactional
> public void testC() throws Exception
> {
> Assert.assertTrue(false);
> }
> }
> {code}
> testC succeeds if the annotations are uncommented.
> Furthermore, there is something strange with the em/transactions, the persistence works even if the em doesn't join the transaction and the em complains of a detached instance if merge() is switched for persist()
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (ARQ-1782) @UsingDataSet/@ShouldMatchDataSet always makes test succeed
by Nicklas Karlsson (JIRA)
Nicklas Karlsson created ARQ-1782:
-------------------------------------
Summary: @UsingDataSet/@ShouldMatchDataSet always makes test succeed
Key: ARQ-1782
URL: https://issues.jboss.org/browse/ARQ-1782
Project: Arquillian
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Extension - Persistence
Affects Versions: persistence_1.0.0.Alpha7
Environment: WildFly 8 CR 2
Reporter: Nicklas Karlsson
Assignee: Bartosz Majsak
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fi.affecto.marela</groupId>
<artifactId>arq-concept</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<browser>chrome</browser>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.4.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-bom</artifactId>
<version>1.3.0.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.selenium</groupId>
<artifactId>selenium-bom</artifactId>
<version>2.41.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>4.3.5.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<version>2.0.2.Final</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-core</artifactId>
<version>1.0.0.Alpha7</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-dbunit</artifactId>
<version>1.0.0.Alpha7</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>arq-wildfly</id>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-7.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>8.1.0.CR2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
</project>
{code:xml}
{code:java}
package fi.affecto.marela.test;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.UserTransaction;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.persistence.ShouldMatchDataSet;
import org.jboss.arquillian.persistence.UsingDataSet;
import org.jboss.arquillian.transaction.api.annotation.Transactional;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import fi.affecto.marela.jpa.Game;
@RunWith(Arquillian.class)
public class PersistenceExtensionTest
{
@Deployment
public static Archive<?> createDeployment()
{
return ShrinkWrap.create(WebArchive.class, "test.war").addPackage(Game.class.getPackage())
.addAsResource("persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
@PersistenceContext
EntityManager em;
@Inject
UserTransaction utx;
@Test
public void testA() throws Exception
{
Assert.assertNotNull(em);
utx.begin();
// em.joinTransaction();
Game g = new Game();
g.setId(666L);
g.setTitle("x");
Assert.assertFalse(em.contains(g));
g = em.merge(g);
Assert.assertTrue(em.contains(g));
utx.rollback();
}
@Test
@Transactional
public void testB() throws Exception
{
Assert.assertNotNull(em);
Game g = new Game();
g.setId(666L);
g.setTitle("x");
Assert.assertFalse(em.contains(g));
g = em.merge(g);
Assert.assertTrue(em.contains(g));
}
@Test
// @UsingDataSet("games.yml")
// @ShouldMatchDataSet("games-check.yml")
@Transactional
public void testC() throws Exception
{
Assert.assertTrue(false);
}
}
{code:java}
testC succeeds if the annotations are uncommented.
Furthermore, there is something strange with the em/transactions, the persistence works even if the em doesn't join the transaction and the em complains of a detached instance if merge() is switched for persist()
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (ARQ-1743) Merge configuration and callable creation together
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/ARQ-1743?page=com.atlassian.jira.plugin.s... ]
Karel Piwko updated ARQ-1743:
-----------------------------
Fix Version/s: drone_2.0.0.Alpha3
(was: drone_2.0.0.Alpha2)
> Merge configuration and callable creation together
> --------------------------------------------------
>
> Key: ARQ-1743
> URL: https://issues.jboss.org/browse/ARQ-1743
> Project: Arquillian
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Extension - Drone
> Affects Versions: drone_2.0.0.Alpha1
> Reporter: Karel Piwko
> Fix For: drone_2.0.0.Alpha3
>
>
> There should be just one event and either both or none of the object should be present.
> This mean that callable and configuration should be created at the same time. This would make usage of Drone much easier.
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months
[JBoss JIRA] (ARQ-1647) Allow Executor to set process exit code
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/ARQ-1647?page=com.atlassian.jira.plugin.s... ]
Karel Piwko resolved ARQ-1647.
------------------------------
Assignee: Karel Piwko
Resolution: Done
> Allow Executor to set process exit code
> ---------------------------------------
>
> Key: ARQ-1647
> URL: https://issues.jboss.org/browse/ARQ-1647
> Project: Arquillian
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Extension - Spacelift
> Affects Versions: spacelift_1.0.0.Alpha1
> Reporter: Karel Piwko
> Assignee: Karel Piwko
> Fix For: spacelift_1.0.0.Alpha2
>
>
> Currently, it is not possible to setup exit code for external process. This makes handling of execution failure quite complicated.
> Figure out what API should be used to let user define allowed exit values. 0 is to be kept as default value. Additionally, there might be multiple values to be set.
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 7 months