Commit d3e937094bda6783099819b90e17815d7def2f26
1 parent
4f82fb95
Exists in
master
Remoção do glassfish-resources.xml. Agora as conexões JNDI utilizam o
nome padrão do Glassfish
Showing
12 changed files
with
26 additions
and
122 deletions
Show diff stats
impl/extension/jdbc/src/test/java/connection/producer/ConnectionProducerMultipleConnectionsTest.java
@@ -37,9 +37,12 @@ | @@ -37,9 +37,12 @@ | ||
37 | package connection.producer; | 37 | package connection.producer; |
38 | 38 | ||
39 | import static org.junit.Assert.assertEquals; | 39 | import static org.junit.Assert.assertEquals; |
40 | +import static org.junit.Assert.assertTrue; | ||
40 | 41 | ||
41 | import java.sql.Connection; | 42 | import java.sql.Connection; |
42 | import java.sql.SQLException; | 43 | import java.sql.SQLException; |
44 | +import java.util.regex.Matcher; | ||
45 | +import java.util.regex.Pattern; | ||
43 | 46 | ||
44 | import javax.inject.Inject; | 47 | import javax.inject.Inject; |
45 | 48 | ||
@@ -85,7 +88,10 @@ public class ConnectionProducerMultipleConnectionsTest { | @@ -85,7 +88,10 @@ public class ConnectionProducerMultipleConnectionsTest { | ||
85 | assertEquals(conn1.getMetaData().getURL(), "jdbc:hsqldb:mem:hsql1"); | 88 | assertEquals(conn1.getMetaData().getURL(), "jdbc:hsqldb:mem:hsql1"); |
86 | assertEquals(conn2.getMetaData().getURL(), "jdbc:hsqldb:mem:hsql2"); | 89 | assertEquals(conn2.getMetaData().getURL(), "jdbc:hsqldb:mem:hsql2"); |
87 | assertEquals(conn3.getMetaData().getURL(), "jdbc:hsqldb:mem:hsql3"); | 90 | assertEquals(conn3.getMetaData().getURL(), "jdbc:hsqldb:mem:hsql3"); |
88 | - assertEquals(conn4.getMetaData().getURL(), "jdbc:derby:target/databases/derby"); | ||
89 | - } | ||
90 | 91 | ||
92 | + String regexp = "^jdbc:derby:(.*)/databases/embedded_default$"; | ||
93 | + Pattern pattern = Pattern.compile(regexp); | ||
94 | + Matcher matcher = pattern.matcher(conn4.getMetaData().getURL()); | ||
95 | + assertTrue(matcher.matches()); | ||
96 | + } | ||
91 | } | 97 | } |
impl/extension/jdbc/src/test/java/connection/producer/ConnectionProducerWithJndiTest.java
@@ -36,10 +36,12 @@ | @@ -36,10 +36,12 @@ | ||
36 | */ | 36 | */ |
37 | package connection.producer; | 37 | package connection.producer; |
38 | 38 | ||
39 | -import static org.junit.Assert.assertEquals; | 39 | +import static org.junit.Assert.assertTrue; |
40 | 40 | ||
41 | import java.sql.Connection; | 41 | import java.sql.Connection; |
42 | import java.sql.SQLException; | 42 | import java.sql.SQLException; |
43 | +import java.util.regex.Matcher; | ||
44 | +import java.util.regex.Pattern; | ||
43 | 45 | ||
44 | import javax.inject.Inject; | 46 | import javax.inject.Inject; |
45 | 47 | ||
@@ -70,6 +72,10 @@ public class ConnectionProducerWithJndiTest { | @@ -70,6 +72,10 @@ public class ConnectionProducerWithJndiTest { | ||
70 | 72 | ||
71 | @Test | 73 | @Test |
72 | public void createConnection() throws SQLException { | 74 | public void createConnection() throws SQLException { |
73 | - assertEquals(conn1.getMetaData().getURL(), "jdbc:derby:target/databases/derby"); | 75 | + String regexp = "^jdbc:derby:(.*)/databases/embedded_default$"; |
76 | + Pattern pattern = Pattern.compile(regexp); | ||
77 | + Matcher matcher = pattern.matcher(conn1.getMetaData().getURL()); | ||
78 | + | ||
79 | + assertTrue(matcher.matches()); | ||
74 | } | 80 | } |
75 | } | 81 | } |
impl/extension/jdbc/src/test/resources/arquillian.xml
@@ -51,10 +51,4 @@ | @@ -51,10 +51,4 @@ | ||
51 | </configuration> | 51 | </configuration> |
52 | </container> | 52 | </container> |
53 | --> | 53 | --> |
54 | - | ||
55 | - <container qualifier="glassfish-embedded" default="true"> | ||
56 | - <configuration> | ||
57 | - <property name="resourcesXml">src/test/resources/glassfish-resources.xml</property> | ||
58 | - </configuration> | ||
59 | - </container> | ||
60 | </arquillian> | 54 | </arquillian> |
61 | \ No newline at end of file | 55 | \ No newline at end of file |
impl/extension/jdbc/src/test/resources/glassfish-resources.xml
@@ -1,48 +0,0 @@ | @@ -1,48 +0,0 @@ | ||
1 | -<!-- | ||
2 | - Demoiselle Framework | ||
3 | - Copyright (C) 2010 SERPRO | ||
4 | - ============================================================================ | ||
5 | - This file is part of Demoiselle Framework. | ||
6 | - | ||
7 | - Demoiselle Framework is free software; you can redistribute it and/or | ||
8 | - modify it under the terms of the GNU Lesser General Public License version 3 | ||
9 | - as published by the Free Software Foundation. | ||
10 | - | ||
11 | - This program is distributed in the hope that it will be useful, | ||
12 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | - GNU General Public License for more details. | ||
15 | - | ||
16 | - You should have received a copy of the GNU Lesser General Public License version 3 | ||
17 | - along with this program; if not, see <http://www.gnu.org/licenses /> | ||
18 | - or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
19 | - Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | - ============================================================================ | ||
21 | - Este arquivo é parte do Framework Demoiselle. | ||
22 | - | ||
23 | - O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
24 | - modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
25 | - do Software Livre (FSF). | ||
26 | - | ||
27 | - Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
28 | - GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
29 | - APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
30 | - para maiores detalhes. | ||
31 | - | ||
32 | - Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
33 | - "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | ||
34 | - ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
35 | - 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
36 | ---> | ||
37 | -<!DOCTYPE resources PUBLIC | ||
38 | - "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" | ||
39 | - "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"> | ||
40 | -<resources> | ||
41 | - <jdbc-resource pool-name="ArquillianEmbeddedDerbyPool" jndi-name="jdbc/arquillian" /> | ||
42 | - | ||
43 | - <jdbc-connection-pool name="ArquillianEmbeddedDerbyPool" res-type="javax.sql.DataSource" datasource-classname="org.apache.derby.jdbc.EmbeddedDataSource" | ||
44 | - is-isolation-level-guaranteed="false"> | ||
45 | - <property name="databaseName" value="target/databases/derby" /> | ||
46 | - <property name="createDatabase" value="create" /> | ||
47 | - </jdbc-connection-pool> | ||
48 | -</resources> | ||
49 | \ No newline at end of file | 0 | \ No newline at end of file |
impl/extension/jdbc/src/test/resources/producer/multiple-connections/demoiselle.properties
@@ -48,6 +48,6 @@ frameworkdemoiselle.persistence.conn3.url=jdbc:hsqldb:mem:hsql3 | @@ -48,6 +48,6 @@ frameworkdemoiselle.persistence.conn3.url=jdbc:hsqldb:mem:hsql3 | ||
48 | frameworkdemoiselle.persistence.conn3.username=sa | 48 | frameworkdemoiselle.persistence.conn3.username=sa |
49 | frameworkdemoiselle.persistence.conn3.password= | 49 | frameworkdemoiselle.persistence.conn3.password= |
50 | 50 | ||
51 | -frameworkdemoiselle.persistence.conn4.jndi.name=jdbc/arquillian | 51 | +frameworkdemoiselle.persistence.conn4.jndi.name=jdbc/__default |
52 | 52 | ||
53 | frameworkdemoiselle.persistence.default.datasource.name=conn3 | 53 | frameworkdemoiselle.persistence.default.datasource.name=conn3 |
impl/extension/jdbc/src/test/resources/producer/with-jndi/demoiselle.properties
@@ -33,4 +33,4 @@ | @@ -33,4 +33,4 @@ | ||
33 | # ou escreva para a Fundação do Software Livre (FSF) Inc., | 33 | # ou escreva para a Fundação do Software Livre (FSF) Inc., |
34 | # 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | 34 | # 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. |
35 | 35 | ||
36 | -frameworkdemoiselle.persistence.conn1.jndi.name=jdbc/arquillian | 36 | +frameworkdemoiselle.persistence.conn1.jndi.name=jdbc/__default |
impl/extension/jpa/src/test/resources/arquillian.xml
@@ -51,10 +51,4 @@ | @@ -51,10 +51,4 @@ | ||
51 | </configuration> | 51 | </configuration> |
52 | </container> | 52 | </container> |
53 | --> | 53 | --> |
54 | - | ||
55 | - <container qualifier="glassfish-embedded" default="true"> | ||
56 | - <configuration> | ||
57 | - <property name="resourcesXml">src/test/resources/glassfish-resources.xml</property> | ||
58 | - </configuration> | ||
59 | - </container> | ||
60 | </arquillian> | 54 | </arquillian> |
impl/extension/jpa/src/test/resources/glassfish-resources.xml
@@ -1,48 +0,0 @@ | @@ -1,48 +0,0 @@ | ||
1 | -<!-- | ||
2 | - Demoiselle Framework | ||
3 | - Copyright (C) 2010 SERPRO | ||
4 | - ============================================================================ | ||
5 | - This file is part of Demoiselle Framework. | ||
6 | - | ||
7 | - Demoiselle Framework is free software; you can redistribute it and/or | ||
8 | - modify it under the terms of the GNU Lesser General Public License version 3 | ||
9 | - as published by the Free Software Foundation. | ||
10 | - | ||
11 | - This program is distributed in the hope that it will be useful, | ||
12 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | - GNU General Public License for more details. | ||
15 | - | ||
16 | - You should have received a copy of the GNU Lesser General Public License version 3 | ||
17 | - along with this program; if not, see <http://www.gnu.org/licenses /> | ||
18 | - or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
19 | - Fifth Floor, Boston, MA 02110-1301, USA. | ||
20 | - ============================================================================ | ||
21 | - Este arquivo é parte do Framework Demoiselle. | ||
22 | - | ||
23 | - O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
24 | - modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
25 | - do Software Livre (FSF). | ||
26 | - | ||
27 | - Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
28 | - GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
29 | - APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
30 | - para maiores detalhes. | ||
31 | - | ||
32 | - Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
33 | - "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | ||
34 | - ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
35 | - 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
36 | ---> | ||
37 | -<!DOCTYPE resources PUBLIC | ||
38 | - "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" | ||
39 | - "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"> | ||
40 | -<resources> | ||
41 | - <jdbc-resource pool-name="ArquillianEmbeddedDerbyPool" jndi-name="jboss/datasources/ExampleDS" /> | ||
42 | - | ||
43 | - <jdbc-connection-pool name="ArquillianEmbeddedDerbyPool" res-type="javax.sql.DataSource" datasource-classname="org.apache.derby.jdbc.EmbeddedDataSource" | ||
44 | - is-isolation-level-guaranteed="false"> | ||
45 | - <property name="databaseName" value="target/databases/derby" /> | ||
46 | - <property name="createDatabase" value="create" /> | ||
47 | - </jdbc-connection-pool> | ||
48 | -</resources> | ||
49 | \ No newline at end of file | 0 | \ No newline at end of file |
impl/extension/jpa/src/test/resources/productor/persistence.xml
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | 38 | xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> |
39 | 39 | ||
40 | <persistence-unit name="pu" transaction-type="RESOURCE_LOCAL"> | 40 | <persistence-unit name="pu" transaction-type="RESOURCE_LOCAL"> |
41 | - <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source> | 41 | + <non-jta-data-source>jdbc/__default</non-jta-data-source> |
42 | 42 | ||
43 | <class>productor.MyEntity</class> | 43 | <class>productor.MyEntity</class> |
44 | 44 | ||
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | </persistence-unit> | 50 | </persistence-unit> |
51 | 51 | ||
52 | <persistence-unit name="pu2" transaction-type="RESOURCE_LOCAL"> | 52 | <persistence-unit name="pu2" transaction-type="RESOURCE_LOCAL"> |
53 | - <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source> | 53 | + <non-jta-data-source>jdbc/__default</non-jta-data-source> |
54 | 54 | ||
55 | <class>productor.MyEntity</class> | 55 | <class>productor.MyEntity</class> |
56 | 56 |
impl/extension/jpa/src/test/resources/template/persistence.xml
@@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
54 | <!-- | 54 | <!-- |
55 | --> | 55 | --> |
56 | <persistence-unit name="pu" transaction-type="RESOURCE_LOCAL"> | 56 | <persistence-unit name="pu" transaction-type="RESOURCE_LOCAL"> |
57 | - <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source> | 57 | + <non-jta-data-source>jdbc/__default</non-jta-data-source> |
58 | 58 | ||
59 | <class>template.MyEntity</class> | 59 | <class>template.MyEntity</class> |
60 | 60 |
impl/extension/jpa/src/test/resources/transaction/interceptor/persistence.xml
@@ -68,7 +68,7 @@ | @@ -68,7 +68,7 @@ | ||
68 | <!-- | 68 | <!-- |
69 | --> | 69 | --> |
70 | <persistence-unit name="pu1" transaction-type="RESOURCE_LOCAL"> | 70 | <persistence-unit name="pu1" transaction-type="RESOURCE_LOCAL"> |
71 | - <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source> | 71 | + <non-jta-data-source>jdbc/__default</non-jta-data-source> |
72 | 72 | ||
73 | <class>transaction.interceptor.MyEntity1</class> | 73 | <class>transaction.interceptor.MyEntity1</class> |
74 | <class>transaction.interceptor.MyEntity2</class> | 74 | <class>transaction.interceptor.MyEntity2</class> |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | </persistence-unit> | 81 | </persistence-unit> |
82 | 82 | ||
83 | <persistence-unit name="pu2" transaction-type="RESOURCE_LOCAL"> | 83 | <persistence-unit name="pu2" transaction-type="RESOURCE_LOCAL"> |
84 | - <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source> | 84 | + <non-jta-data-source>jdbc/__default</non-jta-data-source> |
85 | 85 | ||
86 | <class>transaction.interceptor.MyEntity1</class> | 86 | <class>transaction.interceptor.MyEntity1</class> |
87 | <class>transaction.interceptor.MyEntity2</class> | 87 | <class>transaction.interceptor.MyEntity2</class> |
impl/extension/jpa/src/test/resources/transaction/manual/persistence.xml
@@ -68,7 +68,7 @@ | @@ -68,7 +68,7 @@ | ||
68 | <!-- | 68 | <!-- |
69 | --> | 69 | --> |
70 | <persistence-unit name="pu1" transaction-type="RESOURCE_LOCAL"> | 70 | <persistence-unit name="pu1" transaction-type="RESOURCE_LOCAL"> |
71 | - <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source> | 71 | + <non-jta-data-source>jdbc/__default</non-jta-data-source> |
72 | 72 | ||
73 | <class>transaction.manual.MyEntity1</class> | 73 | <class>transaction.manual.MyEntity1</class> |
74 | <class>transaction.manual.MyEntity2</class> | 74 | <class>transaction.manual.MyEntity2</class> |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | </persistence-unit> | 81 | </persistence-unit> |
82 | 82 | ||
83 | <persistence-unit name="pu2" transaction-type="RESOURCE_LOCAL"> | 83 | <persistence-unit name="pu2" transaction-type="RESOURCE_LOCAL"> |
84 | - <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source> | 84 | + <non-jta-data-source>jdbc/__default</non-jta-data-source> |
85 | 85 | ||
86 | <class>transaction.manual.MyEntity1</class> | 86 | <class>transaction.manual.MyEntity1</class> |
87 | <class>transaction.manual.MyEntity2</class> | 87 | <class>transaction.manual.MyEntity2</class> |
@@ -94,7 +94,7 @@ | @@ -94,7 +94,7 @@ | ||
94 | </persistence-unit> | 94 | </persistence-unit> |
95 | 95 | ||
96 | <persistence-unit name="pu3" transaction-type="RESOURCE_LOCAL"> | 96 | <persistence-unit name="pu3" transaction-type="RESOURCE_LOCAL"> |
97 | - <non-jta-data-source>java:jboss/datasources/ExampleDS</non-jta-data-source> | 97 | + <non-jta-data-source>jdbc/__default</non-jta-data-source> |
98 | 98 | ||
99 | <class>transaction.manual.MyEntity1</class> | 99 | <class>transaction.manual.MyEntity1</class> |
100 | <class>transaction.manual.MyEntity2</class> | 100 | <class>transaction.manual.MyEntity2</class> |