Commit 6304f7c6fd319d1874171a99e1fb56dc0efe96a3
1 parent
51f14ef0
Exists in
master
Adição de testes do ConnectionProducer
Showing
2 changed files
with
55 additions
and
0 deletions
Show diff stats
impl/extension/jdbc/src/test/java/connection/producer/ConnectionProducerTest.java
0 → 100644
| @@ -0,0 +1,46 @@ | @@ -0,0 +1,46 @@ | ||
| 1 | +package connection.producer; | ||
| 2 | + | ||
| 3 | +import static org.junit.Assert.assertNotNull; | ||
| 4 | + | ||
| 5 | +import java.sql.Connection; | ||
| 6 | + | ||
| 7 | +import javax.inject.Inject; | ||
| 8 | + | ||
| 9 | +import org.jboss.arquillian.container.test.api.Deployment; | ||
| 10 | +import org.jboss.arquillian.junit.Arquillian; | ||
| 11 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
| 12 | +import org.junit.Test; | ||
| 13 | +import org.junit.runner.RunWith; | ||
| 14 | + | ||
| 15 | +import test.Tests; | ||
| 16 | +import br.gov.frameworkdemoiselle.annotation.Name; | ||
| 17 | + | ||
| 18 | +@RunWith(Arquillian.class) | ||
| 19 | +public class ConnectionProducerTest { | ||
| 20 | + | ||
| 21 | + private static String PATH = "src/test/resources/producer"; | ||
| 22 | + | ||
| 23 | + @Inject | ||
| 24 | + @Name("conn1") | ||
| 25 | + private Connection connectionWithName; | ||
| 26 | + | ||
| 27 | + @Inject | ||
| 28 | + private Connection connectionWithoutName; | ||
| 29 | + | ||
| 30 | + @Deployment | ||
| 31 | + public static WebArchive createDeployment() { | ||
| 32 | + WebArchive deployment = Tests.createDeployment(ConnectionProducerTest.class); | ||
| 33 | + deployment.addAsResource(Tests.createFileAsset(PATH + "/demoiselle.properties"), "demoiselle.properties"); | ||
| 34 | + return deployment; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + @Test | ||
| 38 | + public void createDefaultConnectionWithName(){ | ||
| 39 | + assertNotNull(connectionWithName); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @Test | ||
| 43 | + public void createDefaultConnectionWithoutName(){ | ||
| 44 | + assertNotNull(connectionWithoutName); | ||
| 45 | + } | ||
| 46 | +} |
impl/extension/jdbc/src/test/resources/producer/demoiselle.properties
0 → 100644
| @@ -0,0 +1,9 @@ | @@ -0,0 +1,9 @@ | ||
| 1 | +frameworkdemoiselle.persistence.driver.class=org.hsqldb.jdbcDriver | ||
| 2 | +frameworkdemoiselle.persistence.url=jdbc:hsqldb:hsql | ||
| 3 | +frameworkdemoiselle.persistence.username=sa | ||
| 4 | +frameworkdemoiselle.persistence.password= | ||
| 5 | + | ||
| 6 | +frameworkdemoiselle.persistence.conn1.driver.class=org.hsqldb.jdbcDriver | ||
| 7 | +frameworkdemoiselle.persistence.conn1.url=jdbc:hsqldb:hsql | ||
| 8 | +frameworkdemoiselle.persistence.conn1.username=sa | ||
| 9 | +frameworkdemoiselle.persistence.conn1.password= | ||
| 0 | \ No newline at end of file | 10 | \ No newline at end of file |