Skip to content

Commit

Permalink
refs #49
Browse files Browse the repository at this point in the history
  • Loading branch information
rmpestano committed Sep 11, 2016
1 parent cb95a52 commit fb0abaf
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 53 deletions.
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ This module is the basis for subsequent modules. It contains a JUnit rule (shown
<dependency>
<groupId>com.github.dbunit-rules</groupId>
<artifactId>core</artifactId>
<version>0.13.1</version>
<version>0.13.2</version>
<scope>test</scope>
</dependency>
----
Expand Down Expand Up @@ -637,7 +637,7 @@ If you use CDI in your tests then you should give a try in DBUnit rules https://
<dependency>
<groupId>com.github.dbunit-rules</groupId>
<artifactId>cdi</artifactId>
<version>0.13.1</version>
<version>0.13.2</version>
<scope>test</scope>
</dependency>
----
Expand Down Expand Up @@ -704,7 +704,7 @@ NOTE: If you don't use CDI you need to <<Programmatically creating datasets, cre
<dependency>
<groupId>com.github.dbunit-rules</groupId>
<artifactId>cucumber</artifactId>
<version>0.13.1</version>
<version>0.13.2</version>
<scope>test</scope>
</dependency>
----
Expand Down Expand Up @@ -906,7 +906,7 @@ http://junit.org/junit5/[JUnit 5] is the new version of JUnit and comes with a n
<dependency>
<groupId>com.github.dbunit-rules</groupId>
<artifactId>junit5</artifactId>
<version>0.13.1</version>
<version>0.13.2</version>
<scope>test</scope>
</dependency>
----
Expand Down
4 changes: 3 additions & 1 deletion cdi/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A CDI interceptor to configure DBUnit datasets in your tests.
<dependency>
<groupId>com.github.dbunit-rules</groupId>
<artifactId>cdi</artifactId>
<version>0.13.1</version>
<version>0.13.2</version>
<scope>test</scope>
</dependency>
----
Expand Down Expand Up @@ -50,6 +50,7 @@ property in test/resources/META-INF/apache-deltaspike.properties:
[source,java]
----
@RunWith(CdiTestRunner.class)
@DBUnitInterceptor <1>
public class ContactServiceIt {
@Inject
Expand All @@ -64,6 +65,7 @@ public class ContactServiceIt {
}
}
----
<1> Activates the CDI interceptor which will seed database based on @DataSet annotation.

.contacts.yml
----
Expand Down
46 changes: 0 additions & 46 deletions cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,50 +93,4 @@

</dependencies>

<profiles>
<profile>
<id>docs</id>
<build>
<plugins>
<plugin>
<groupId>com.github.cukedoctor</groupId>
<artifactId>cukedoctor-maven-plugin</artifactId>
<version>1.0.4</version>
<configuration>
<outputFileName>documentation</outputFileName>
<outputDir>docs</outputDir>
<!--pdf and html5 -->
<format>all</format>
<toc>center</toc>
<numbered>true</numbered>
<docVersion>${project.version}</docVersion>
</configuration>
<executions>
<execution>
<goals>
<goal>execute</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>1.1</version>
<configuration>
<checkoutDirectory>${project.build.outputDirectory}</checkoutDirectory>
<checkinComment>Publishing DBUnit Rules CDI ${project.parent.version} living documentation.
</checkinComment>
<content>target/docs</content>
<skipDeletedFiles>true</skipDeletedFiles>
<pubScmUrl>scm:git:https://${USER}:${PASS}@github.com/rmpestano/dbunit-rules.git
</pubScmUrl>
<scmBranch>gh-pages</scmBranch>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
47 changes: 47 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,51 @@
</plugins>
</build>

<profiles>
<profile>
<id>docs</id>
<build>
<plugins>
<plugin>
<groupId>com.github.cukedoctor</groupId>
<artifactId>cukedoctor-maven-plugin</artifactId>
<version>1.0.4</version>
<configuration>
<outputFileName>documentation</outputFileName>
<outputDir>docs</outputDir>
<!--pdf and html5 -->
<format>all</format>
<toc>center</toc>
<numbered>true</numbered>
<docVersion>${project.version}</docVersion>
</configuration>
<executions>
<execution>
<goals>
<goal>execute</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>1.1</version>
<configuration>
<checkoutDirectory>${project.build.outputDirectory}</checkoutDirectory>
<checkinComment>Publishing DBUnit Rules CDI ${project.parent.version} living documentation.
</checkinComment>
<content>target/docs</content>
<skipDeletedFiles>true</skipDeletedFiles>
<pubScmUrl>scm:git:https://${USER}:${PASS}@github.com/rmpestano/dbunit-rules.git
</pubScmUrl>
<scmBranch>gh-pages</scmBranch>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public OutputStream export(Connection connection, DataSetExportConfig dataSetExp
}else {
filter = new DatabaseSequenceFilter(dbunitConnection);
}


/* JSONDataSet j;
j.
FlatXmlWriter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import java.util.List;

import static com.github.dbunit.rules.util.EntityManagerProvider.*;
import static org.assertj.core.api.Assertions.assertThat;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;
import static com.github.dbunit.rules.util.EntityManagerProvider.*;

/**
* Created by pestano on 28/08/16.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.util.List;

import static com.github.dbunit.rules.util.EntityManagerProvider.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;

Expand All @@ -29,7 +30,7 @@ public class ScriptsIt {

@BeforeAll
public static void before() {
EntityManagerProvider provider = EntityManagerProvider.instance("junit5-pu");
EntityManagerProvider provider = instance("junit5-pu");
tx().begin();
em().createNativeQuery("DELETE FROM USER").executeUpdate();
em().createNativeQuery("INSERT INTO USER VALUES (6,'user6')").executeUpdate();
Expand All @@ -52,7 +53,7 @@ public void shouldExecuteScriptsBefore() {
}

private List<User> listUsers(String sql) {
return EntityManagerProvider.instance("junit5-pu").em().createQuery(sql).getResultList();
return instance("junit5-pu").em().createQuery(sql).getResultList();
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import static com.github.dbunit.rules.util.EntityManagerProvider.*;

/**
* Created by rmpestano on 6/21/16.
Expand Down

0 comments on commit fb0abaf

Please sign in to comment.