Commit 5ceeaf7123b8a35d245a73d94e676f6bf68a5b6b
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
6 changed files
with
19 additions
and
55 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
@@ -50,11 +50,11 @@ | @@ -50,11 +50,11 @@ | ||
50 | <property name="jbossHome">target/jboss-as-${jboss.as.version}</property> | 50 | <property name="jbossHome">target/jboss-as-${jboss.as.version}</property> |
51 | </configuration> | 51 | </configuration> |
52 | </container> | 52 | </container> |
53 | - --> | ||
54 | 53 | ||
55 | <container qualifier="glassfish-embedded" default="true"> | 54 | <container qualifier="glassfish-embedded" default="true"> |
56 | <configuration> | 55 | <configuration> |
57 | <property name="resourcesXml">src/test/resources/glassfish-resources.xml</property> | 56 | <property name="resourcesXml">src/test/resources/glassfish-resources.xml</property> |
58 | </configuration> | 57 | </configuration> |
59 | </container> | 58 | </container> |
59 | + --> | ||
60 | </arquillian> | 60 | </arquillian> |
61 | \ No newline at end of file | 61 | \ 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 |