Commit 1c2193dc9ee286ae70ec5aec73637639cc63567e

Authored by Dancovich
2 parents 147c8050 47a9e855
Exists in master

Merge branch '2.4.0' of https://github.com/demoiselle/framework.git into 2.4.0

impl/extension/jdbc/src/test/java/connection/producer/ConnectionProducerMultipleConnectionsTest.java
... ... @@ -37,9 +37,12 @@
37 37 package connection.producer;
38 38  
39 39 import static org.junit.Assert.assertEquals;
  40 +import static org.junit.Assert.assertTrue;
40 41  
41 42 import java.sql.Connection;
42 43 import java.sql.SQLException;
  44 +import java.util.regex.Matcher;
  45 +import java.util.regex.Pattern;
43 46  
44 47 import javax.inject.Inject;
45 48  
... ... @@ -85,7 +88,10 @@ public class ConnectionProducerMultipleConnectionsTest {
85 88 assertEquals(conn1.getMetaData().getURL(), "jdbc:hsqldb:mem:hsql1");
86 89 assertEquals(conn2.getMetaData().getURL(), "jdbc:hsqldb:mem:hsql2");
87 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 36 */
37 37 package connection.producer;
38 38  
39   -import static org.junit.Assert.assertEquals;
  39 +import static org.junit.Assert.assertTrue;
40 40  
41 41 import java.sql.Connection;
42 42 import java.sql.SQLException;
  43 +import java.util.regex.Matcher;
  44 +import java.util.regex.Pattern;
43 45  
44 46 import javax.inject.Inject;
45 47  
... ... @@ -70,6 +72,10 @@ public class ConnectionProducerWithJndiTest {
70 72  
71 73 @Test
72 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 51 </configuration>
52 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>
61 54 \ No newline at end of file
  55 +</arquillian>
... ...
impl/extension/jdbc/src/test/resources/glassfish-resources.xml
... ... @@ -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 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 48 frameworkdemoiselle.persistence.conn3.username=sa
49 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 53 frameworkdemoiselle.persistence.default.datasource.name=conn3
... ...
impl/extension/jdbc/src/test/resources/producer/with-jndi/demoiselle.properties
... ... @@ -33,4 +33,4 @@
33 33 # ou escreva para a Fundação do Software Livre (FSF) Inc.,
34 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 51 </configuration>
52 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 54 </arquillian>
... ...
impl/extension/jpa/src/test/resources/glassfish-resources.xml
... ... @@ -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 0 \ No newline at end of file
impl/extension/jpa/src/test/resources/productor/persistence.xml
... ... @@ -38,7 +38,7 @@
38 38 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
39 39  
40 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 43 <class>productor.MyEntity</class>
44 44  
... ... @@ -50,7 +50,7 @@
50 50 </persistence-unit>
51 51  
52 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 55 <class>productor.MyEntity</class>
56 56  
... ...
impl/extension/jpa/src/test/resources/template/persistence.xml
... ... @@ -54,7 +54,7 @@
54 54 <!--
55 55 -->
56 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 59 <class>template.MyEntity</class>
60 60  
... ...
impl/extension/jpa/src/test/resources/transaction/interceptor/persistence.xml
... ... @@ -68,7 +68,7 @@
68 68 <!--
69 69 -->
70 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 73 <class>transaction.interceptor.MyEntity1</class>
74 74 <class>transaction.interceptor.MyEntity2</class>
... ... @@ -81,7 +81,7 @@
81 81 </persistence-unit>
82 82  
83 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 86 <class>transaction.interceptor.MyEntity1</class>
87 87 <class>transaction.interceptor.MyEntity2</class>
... ...
impl/extension/jpa/src/test/resources/transaction/manual/persistence.xml
... ... @@ -68,7 +68,7 @@
68 68 <!--
69 69 -->
70 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 73 <class>transaction.manual.MyEntity1</class>
74 74 <class>transaction.manual.MyEntity2</class>
... ... @@ -81,7 +81,7 @@
81 81 </persistence-unit>
82 82  
83 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 86 <class>transaction.manual.MyEntity1</class>
87 87 <class>transaction.manual.MyEntity2</class>
... ... @@ -94,7 +94,7 @@
94 94 </persistence-unit>
95 95  
96 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 99 <class>transaction.manual.MyEntity1</class>
100 100 <class>transaction.manual.MyEntity2</class>
... ...