Commit b119a61238e6f15e3cd1e9fc90a5764e99595c0a
Exists in
master
Merge branch '2.4.0' of https://github.com/demoiselle/framework.git into 2.4.0
Showing
16 changed files
with
496 additions
and
32 deletions
Show diff stats
impl/extension/jdbc/pom.xml
| ... | ... | @@ -34,7 +34,8 @@ |
| 34 | 34 | ou escreva para a Fundação do Software Livre (FSF) Inc., |
| 35 | 35 | 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. |
| 36 | 36 | --> |
| 37 | -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| 37 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 38 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| 38 | 39 | |
| 39 | 40 | <modelVersion>4.0.0</modelVersion> |
| 40 | 41 | |
| ... | ... | @@ -71,8 +72,95 @@ |
| 71 | 72 | <groupId>commons-dbcp</groupId> |
| 72 | 73 | <artifactId>commons-dbcp</artifactId> |
| 73 | 74 | </dependency> |
| 75 | + | |
| 76 | + <!-- for tests --> | |
| 77 | + <dependency> | |
| 78 | + <groupId>junit</groupId> | |
| 79 | + <artifactId>junit</artifactId> | |
| 80 | + <scope>test</scope> | |
| 81 | + </dependency> | |
| 82 | + <dependency> | |
| 83 | + <groupId>org.jboss.arquillian.junit</groupId> | |
| 84 | + <artifactId>arquillian-junit-container</artifactId> | |
| 85 | + <scope>test</scope> | |
| 86 | + </dependency> | |
| 87 | + <dependency> | |
| 88 | + <groupId>org.jboss.shrinkwrap.resolver</groupId> | |
| 89 | + <artifactId>shrinkwrap-resolver-impl-maven</artifactId> | |
| 90 | + <scope>test</scope> | |
| 91 | + </dependency> | |
| 74 | 92 | </dependencies> |
| 75 | 93 | |
| 94 | + <build> | |
| 95 | + <testResources> | |
| 96 | + <testResource> | |
| 97 | + <directory>src/test/resources</directory> | |
| 98 | + <filtering>true</filtering> | |
| 99 | + </testResource> | |
| 100 | + </testResources> | |
| 101 | + <plugins> | |
| 102 | + <plugin> | |
| 103 | + <artifactId>maven-dependency-plugin</artifactId> | |
| 104 | + <executions> | |
| 105 | + <execution> | |
| 106 | + <id>unpack</id> | |
| 107 | + <phase>process-test-classes</phase> | |
| 108 | + <goals> | |
| 109 | + <goal>unpack</goal> | |
| 110 | + </goals> | |
| 111 | + <configuration> | |
| 112 | + <artifactItems> | |
| 113 | + <artifactItem> | |
| 114 | + <groupId>org.jboss.as</groupId> | |
| 115 | + <artifactId>jboss-as-dist</artifactId> | |
| 116 | + <version>${jbossas.version}</version> | |
| 117 | + <type>zip</type> | |
| 118 | + <overWrite>false</overWrite> | |
| 119 | + <outputDirectory>target</outputDirectory> | |
| 120 | + </artifactItem> | |
| 121 | + </artifactItems> | |
| 122 | + </configuration> | |
| 123 | + </execution> | |
| 124 | + </executions> | |
| 125 | + </plugin> | |
| 126 | + | |
| 127 | + <plugin> | |
| 128 | + <groupId>org.apache.maven.plugins</groupId> | |
| 129 | + <artifactId>maven-surefire-plugin</artifactId> | |
| 130 | + <version>2.16</version> | |
| 131 | + </plugin> | |
| 132 | + </plugins> | |
| 133 | + <pluginManagement> | |
| 134 | + <plugins> | |
| 135 | + <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> | |
| 136 | + <plugin> | |
| 137 | + <groupId>org.eclipse.m2e</groupId> | |
| 138 | + <artifactId>lifecycle-mapping</artifactId> | |
| 139 | + <version>1.0.0</version> | |
| 140 | + <configuration> | |
| 141 | + <lifecycleMappingMetadata> | |
| 142 | + <pluginExecutions> | |
| 143 | + <pluginExecution> | |
| 144 | + <pluginExecutionFilter> | |
| 145 | + <groupId>org.apache.maven.plugins</groupId> | |
| 146 | + <artifactId>maven-dependency-plugin</artifactId> | |
| 147 | + <versionRange>[2.1,)</versionRange> | |
| 148 | + <goals> | |
| 149 | + <goal>unpack</goal> | |
| 150 | + </goals> | |
| 151 | + </pluginExecutionFilter> | |
| 152 | + <action> | |
| 153 | + <ignore></ignore> | |
| 154 | + </action> | |
| 155 | + </pluginExecution> | |
| 156 | + </pluginExecutions> | |
| 157 | + </lifecycleMappingMetadata> | |
| 158 | + </configuration> | |
| 159 | + </plugin> | |
| 160 | + </plugins> | |
| 161 | + </pluginManagement> | |
| 162 | + </build> | |
| 163 | + | |
| 76 | 164 | <repositories> |
| 77 | 165 | <repository> |
| 78 | 166 | <id>sonatype-nexus-snapshots</id> |
| ... | ... | @@ -97,4 +185,46 @@ |
| 97 | 185 | </releases> |
| 98 | 186 | </repository> |
| 99 | 187 | </repositories> |
| 188 | + | |
| 189 | + <profiles> | |
| 190 | + <profile> | |
| 191 | + <id>arquillian-test</id> | |
| 192 | + | |
| 193 | + <dependencies> | |
| 194 | + <dependency> | |
| 195 | + <groupId>br.gov.frameworkdemoiselle</groupId> | |
| 196 | + <artifactId>demoiselle-core</artifactId> | |
| 197 | + <exclusions> | |
| 198 | + <exclusion> | |
| 199 | + <groupId>javax.enterprise</groupId> | |
| 200 | + <artifactId>cdi-api</artifactId> | |
| 201 | + </exclusion> | |
| 202 | + <exclusion> | |
| 203 | + <artifactId>validation-api</artifactId> | |
| 204 | + <groupId>javax.validation</groupId> | |
| 205 | + </exclusion> | |
| 206 | + <exclusion> | |
| 207 | + <groupId>org.slf4j</groupId> | |
| 208 | + <artifactId>slf4j-api</artifactId> | |
| 209 | + </exclusion> | |
| 210 | + <!-- | |
| 211 | + --> | |
| 212 | + <exclusion> | |
| 213 | + <groupId>org.javassist</groupId> | |
| 214 | + <artifactId>javassist</artifactId> | |
| 215 | + </exclusion> | |
| 216 | + </exclusions> | |
| 217 | + </dependency> | |
| 218 | + <dependency> | |
| 219 | + <groupId>org.eclipse.persistence</groupId> | |
| 220 | + <artifactId>javax.persistence</artifactId> | |
| 221 | + <scope>provided</scope> | |
| 222 | + </dependency> | |
| 223 | + </dependencies> | |
| 224 | + </profile> | |
| 225 | + </profiles> | |
| 226 | + | |
| 227 | + <properties> | |
| 228 | + <jbossas.version>7.1.1.Final</jbossas.version> | |
| 229 | + </properties> | |
| 100 | 230 | </project> | ... | ... |
impl/extension/jdbc/src/main/java/br/gov/frameworkdemoiselle/internal/configuration/JDBCConfig.java
| ... | ... | @@ -53,7 +53,7 @@ public class JDBCConfig implements Serializable { |
| 53 | 53 | private static final long serialVersionUID = 1L; |
| 54 | 54 | |
| 55 | 55 | @Name("default.datasource.name") |
| 56 | - private String defaultDataDourceName; | |
| 56 | + private String defaultDataSourceName; | |
| 57 | 57 | |
| 58 | 58 | @Name("jndi.name") |
| 59 | 59 | private Map<String, String> jndiName; |
| ... | ... | @@ -70,8 +70,8 @@ public class JDBCConfig implements Serializable { |
| 70 | 70 | @Name("password") |
| 71 | 71 | private Map<String, String> password; |
| 72 | 72 | |
| 73 | - public String getDefaultDataDourceName() { | |
| 74 | - return defaultDataDourceName; | |
| 73 | + public String getDefaultDataSourceName() { | |
| 74 | + return defaultDataSourceName; | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | public Map<String, String> getJndiName() { | ... | ... |
impl/extension/jdbc/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ConnectionProducer.java
| ... | ... | @@ -99,7 +99,7 @@ public class ConnectionProducer implements Serializable { |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | private String getNameFromProperties(JDBCConfig config) { |
| 102 | - String result = config.getDefaultDataDourceName(); | |
| 102 | + String result = config.getDefaultDataSourceName(); | |
| 103 | 103 | |
| 104 | 104 | if (result != null) { |
| 105 | 105 | logger.debug(bundle.getString("getting-default-datasource-name-from-properties", result)); | ... | ... |
impl/extension/jdbc/src/test/java/connection/producer/ConnectionProducerDefaultTestWithName.java
0 → 100644
| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | +package connection.producer; | |
| 2 | + | |
| 3 | +import static org.junit.Assert.assertEquals; | |
| 4 | +import static org.junit.Assert.assertNotNull; | |
| 5 | +import static org.junit.Assert.fail; | |
| 6 | + | |
| 7 | +import java.sql.Connection; | |
| 8 | +import java.sql.SQLException; | |
| 9 | + | |
| 10 | +import javax.inject.Inject; | |
| 11 | + | |
| 12 | +import org.jboss.arquillian.container.test.api.Deployment; | |
| 13 | +import org.jboss.arquillian.junit.Arquillian; | |
| 14 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | |
| 15 | +import org.junit.Test; | |
| 16 | +import org.junit.runner.RunWith; | |
| 17 | + | |
| 18 | +import test.Tests; | |
| 19 | +import br.gov.frameworkdemoiselle.internal.configuration.JDBCConfig; | |
| 20 | + | |
| 21 | +@RunWith(Arquillian.class) | |
| 22 | +public class ConnectionProducerDefaultTestWithName { | |
| 23 | + | |
| 24 | + @Inject | |
| 25 | + private JDBCConfig config; | |
| 26 | + | |
| 27 | + private static String PATH = "src/test/resources/producer"; | |
| 28 | + | |
| 29 | + @Inject | |
| 30 | + private Connection connection; | |
| 31 | + | |
| 32 | + @Deployment | |
| 33 | + public static WebArchive createDeployment() { | |
| 34 | + WebArchive deployment = Tests.createDeployment(ConnectionProducerDefaultTestWithName.class); | |
| 35 | + deployment.addAsResource(Tests.createFileAsset(PATH + "/default-producer-with-name.properties"), "default-producer-with-name.properties"); | |
| 36 | + return deployment; | |
| 37 | + } | |
| 38 | + | |
| 39 | + @Test | |
| 40 | + public void createDefaultConnectionWithoutName(){ | |
| 41 | + try { | |
| 42 | + assertNotNull(connection); | |
| 43 | + //verificar se retorna realmente o nome da conexão | |
| 44 | + assertEquals(connection.getCatalog(), config.getDefaultDataSourceName()); | |
| 45 | + } catch (SQLException e) { | |
| 46 | + e.printStackTrace(); | |
| 47 | + fail(); | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} | ... | ... |
impl/extension/jdbc/src/test/java/connection/producer/ConnectionProducerDefaultTestWithoutName.java
0 → 100644
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +package connection.producer; | |
| 2 | + | |
| 3 | +import static org.junit.Assert.assertNotNull; | |
| 4 | +import static org.junit.Assert.fail; | |
| 5 | + | |
| 6 | +import java.sql.Connection; | |
| 7 | +import java.sql.SQLException; | |
| 8 | + | |
| 9 | +import javax.inject.Inject; | |
| 10 | + | |
| 11 | +import org.junit.Test; | |
| 12 | + | |
| 13 | +import br.gov.frameworkdemoiselle.internal.configuration.JDBCConfig; | |
| 14 | + | |
| 15 | + | |
| 16 | +public class ConnectionProducerDefaultTestWithoutName { | |
| 17 | + | |
| 18 | + @Inject | |
| 19 | + private JDBCConfig config; | |
| 20 | + | |
| 21 | + private String PATH = "src/test/resources/producer"; | |
| 22 | + | |
| 23 | + @Inject | |
| 24 | + private Connection connection; | |
| 25 | + | |
| 26 | + @Test | |
| 27 | + public void createDefaultConnectionWithoutName(){ | |
| 28 | + //utilizar o arquivo de propriedade sem o name | |
| 29 | + try { | |
| 30 | + assertNotNull(connection); | |
| 31 | + //verificar se retorna realmente o nome da conexão | |
| 32 | + assertNotNull(connection.getCatalog()); | |
| 33 | + } catch (SQLException e) { | |
| 34 | + // TODO Auto-generated catch block | |
| 35 | + e.printStackTrace(); | |
| 36 | + fail(); | |
| 37 | + } | |
| 38 | + } | |
| 39 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,97 @@ |
| 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 | +package test; | |
| 38 | + | |
| 39 | +import java.io.File; | |
| 40 | +import java.util.Locale; | |
| 41 | + | |
| 42 | +import javax.enterprise.inject.Default; | |
| 43 | +import javax.enterprise.inject.Produces; | |
| 44 | + | |
| 45 | +import org.jboss.shrinkwrap.api.ShrinkWrap; | |
| 46 | +import org.jboss.shrinkwrap.api.asset.FileAsset; | |
| 47 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | |
| 48 | +import org.jboss.shrinkwrap.resolver.api.maven.Maven; | |
| 49 | +import org.junit.Ignore; | |
| 50 | + | |
| 51 | +import br.gov.frameworkdemoiselle.internal.configuration.JDBCConfig; | |
| 52 | +import br.gov.frameworkdemoiselle.internal.producer.ConnectionProducer; | |
| 53 | +import br.gov.frameworkdemoiselle.internal.producer.DataSourceProducer; | |
| 54 | +import br.gov.frameworkdemoiselle.internal.proxy.BasicDataSourceProxy; | |
| 55 | +import br.gov.frameworkdemoiselle.internal.proxy.ConnectionProxy; | |
| 56 | +import br.gov.frameworkdemoiselle.transaction.JDBCTransaction; | |
| 57 | + | |
| 58 | +@Ignore | |
| 59 | +public final class Tests { | |
| 60 | + | |
| 61 | + private Tests() { | |
| 62 | + } | |
| 63 | + | |
| 64 | + public static WebArchive createDeployment(final Class<?> baseClass) { | |
| 65 | + return createDeployment().addPackages(true, baseClass.getPackage()); | |
| 66 | + } | |
| 67 | + | |
| 68 | + public static WebArchive createDeployment() { | |
| 69 | + File[] libs = Maven.resolver().offline().loadPomFromFile("pom.xml", "arquillian-test") | |
| 70 | + .importCompileAndRuntimeDependencies().resolve().withTransitivity().asFile(); | |
| 71 | + | |
| 72 | + return ShrinkWrap | |
| 73 | + .create(WebArchive.class) | |
| 74 | + .addClass(Tests.class) | |
| 75 | + .addClass(JDBCConfig.class) | |
| 76 | + .addClass(ConnectionProducer.class) | |
| 77 | + .addClass(DataSourceProducer.class) | |
| 78 | + .addClass(BasicDataSourceProxy.class) | |
| 79 | + .addClass(ConnectionProxy.class) | |
| 80 | + .addClass(JDBCTransaction.class) | |
| 81 | + .addAsResource(createFileAsset("src/main/resources/demoiselle-jdbc-bundle.properties"), | |
| 82 | + "demoiselle-jdbc-bundle.properties") | |
| 83 | +// .addAsResource(createFileAsset("src/test/resources/logging.properties"), "logging.properties") | |
| 84 | + .addAsWebInfResource(createFileAsset("src/test/resources/META-INF/beans.xml"), "beans.xml") | |
| 85 | + .addAsLibraries(libs); | |
| 86 | + } | |
| 87 | + | |
| 88 | + public static FileAsset createFileAsset(final String pathname) { | |
| 89 | + return new FileAsset(new File(pathname)); | |
| 90 | + } | |
| 91 | + | |
| 92 | + @Default | |
| 93 | + @Produces | |
| 94 | + public Locale create() { | |
| 95 | + return Locale.getDefault(); | |
| 96 | + } | |
| 97 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,100 @@ |
| 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 | +<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 38 | + xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> | |
| 39 | + | |
| 40 | + <!-- | |
| 41 | + --> | |
| 42 | + <engine> | |
| 43 | + <property name="deploymentExportPath">target/deployments</property> | |
| 44 | + </engine> | |
| 45 | + | |
| 46 | + <container qualifier="jbossas-managed" default="true"> | |
| 47 | + <protocol type="Servlet 3.0" /> | |
| 48 | + | |
| 49 | + <configuration> | |
| 50 | + <property name="jbossHome">target/jboss-as-7.1.1.Final</property> | |
| 51 | + <property name="javaHome">/usr/lib/jvm/java-6-sun/</property> | |
| 52 | + <!-- | |
| 53 | + <property name="serverConfig">../../../../src/test/resources/standalone.xml</property> | |
| 54 | + --> | |
| 55 | + </configuration> | |
| 56 | + </container> | |
| 57 | + <!-- | |
| 58 | + <container qualifier="jbossas-managed" default="true"> | |
| 59 | + <configuration> | |
| 60 | + <property name="jbossHome">target/jboss-as-${jbossas.version}</property> | |
| 61 | + <property name="javaVmArguments">-Djboss.socket.binding.port-offset=10000 -Xmx512m -XX:MaxPermSize=128m</property> | |
| 62 | + </configuration> | |
| 63 | + </container> | |
| 64 | + --> | |
| 65 | + <!-- | |
| 66 | + <container qualifier="jbossas-managed" default="true"> | |
| 67 | + <configuration> | |
| 68 | + <property name="javaHome">/usr/lib/jvm/java-6-serpro/</property> | |
| 69 | + <property name="jbossHome">/opt/demoiselle/server/jboss-7.1/</property> | |
| 70 | + </configuration> | |
| 71 | + </container> | |
| 72 | + --> | |
| 73 | + | |
| 74 | + <!-- | |
| 75 | + <container qualifier="glassfish-embedded" default="true"> | |
| 76 | + <configuration> | |
| 77 | + <property name="resourcesXml">src/test/resources/glassfish-resources.xml</property> | |
| 78 | + </configuration> | |
| 79 | + </container> | |
| 80 | + --> | |
| 81 | + | |
| 82 | + <!-- | |
| 83 | + <container qualifier="tomee" default="true"> | |
| 84 | + <configuration> | |
| 85 | + <property name="httpPort">-1</property> | |
| 86 | + <property name="stopPort">-1</property> | |
| 87 | + </configuration> | |
| 88 | + </container> | |
| 89 | + --> | |
| 90 | + | |
| 91 | + <!-- | |
| 92 | + <container qualifier="jbossas-embedded" default="true"> | |
| 93 | + <configuration> | |
| 94 | + <property name="bindaddress">127.0.0.1</property> | |
| 95 | + <property name="httpport">8081</property> | |
| 96 | + </configuration> | |
| 97 | + </container> | |
| 98 | + --> | |
| 99 | + | |
| 100 | +</arquillian> | |
| 0 | 101 | \ No newline at end of file | ... | ... |
impl/extension/jdbc/src/test/resources/producer/default-producer-with-name.properties
0 → 100644
| ... | ... | @@ -0,0 +1,5 @@ |
| 1 | +frameworkdemoiselle.persistence.driver.class=org.h2.jdbcx.JdbcDataSource | |
| 2 | +frameworkdemoiselle.persistence.url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 | |
| 3 | +frameworkdemoiselle.persistence.username=sa | |
| 4 | +frameworkdemoiselle.persistence.password=sa | |
| 5 | +frameworkdemoiselle.persistence.default.datasource.name=databasename | |
| 0 | 6 | \ No newline at end of file | ... | ... |
impl/extension/jdbc/src/test/resources/producer/default-producer-without-name.properties
0 → 100644
| ... | ... | @@ -0,0 +1,4 @@ |
| 1 | +frameworkdemoiselle.persistence.driver.class=org.h2.jdbcx.JdbcDataSource | |
| 2 | +frameworkdemoiselle.persistence.url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 | |
| 3 | +frameworkdemoiselle.persistence.username=sa | |
| 4 | +frameworkdemoiselle.persistence.password=sa | |
| 0 | 5 | \ No newline at end of file | ... | ... |
impl/extension/jpa/pom.xml
| ... | ... | @@ -73,7 +73,7 @@ |
| 73 | 73 | <filtering>true</filtering> |
| 74 | 74 | </testResource> |
| 75 | 75 | </testResources> |
| 76 | - | |
| 76 | + | |
| 77 | 77 | <plugins> |
| 78 | 78 | <plugin> |
| 79 | 79 | <artifactId>maven-dependency-plugin</artifactId> |
| ... | ... | @@ -158,12 +158,8 @@ |
| 158 | 158 | <version>2.12</version> |
| 159 | 159 | <configuration> |
| 160 | 160 | <systemPropertyVariables> |
| 161 | - <java.util.logging.config.file> | |
| 162 | - ${project.build.testOutputDirectory}/logging.properties | |
| 163 | - </java.util.logging.config.file> | |
| 164 | - <derby.stream.error.file> | |
| 165 | - ${project.build.directory}/derby.log | |
| 166 | - </derby.stream.error.file> | |
| 161 | + <java.util.logging.config.file>${project.build.testOutputDirectory}/logging.properties</java.util.logging.config.file> | |
| 162 | + <derby.stream.error.file>${project.build.directory}/derby.log</derby.stream.error.file> | |
| 167 | 163 | </systemPropertyVariables> |
| 168 | 164 | </configuration> |
| 169 | 165 | </plugin> |
| ... | ... | @@ -238,6 +234,8 @@ |
| 238 | 234 | </dependency> |
| 239 | 235 | --> |
| 240 | 236 | |
| 237 | + <!-- | |
| 238 | + --> | |
| 241 | 239 | <dependency> |
| 242 | 240 | <groupId>org.jboss.as</groupId> |
| 243 | 241 | <artifactId>jboss-as-arquillian-container-managed</artifactId> |
| ... | ... | @@ -265,13 +263,18 @@ |
| 265 | 263 | </dependency> |
| 266 | 264 | <dependency> |
| 267 | 265 | <groupId>org.glassfish.main.extras</groupId> |
| 268 | - <artifactId>glassfish-embedded-web</artifactId> | |
| 266 | + <artifactId>glassfish-embedded-all</artifactId> | |
| 267 | + <version>3.1.2.2</version> | |
| 268 | + <version>4.0</version> | |
| 269 | + <version>3.2-b06</version> | |
| 270 | + <version>3.1.2</version> | |
| 269 | 271 | <scope>test</scope> |
| 270 | 272 | </dependency> |
| 273 | + --> | |
| 274 | + <!-- | |
| 271 | 275 | <dependency> |
| 272 | 276 | <groupId>org.glassfish.main.extras</groupId> |
| 273 | - <artifactId>glassfish-embedded-all</artifactId> | |
| 274 | - <version>3.1.2</version> | |
| 277 | + <artifactId>glassfish-embedded-web</artifactId> | |
| 275 | 278 | <scope>test</scope> |
| 276 | 279 | </dependency> |
| 277 | 280 | --> |
| ... | ... | @@ -317,6 +320,25 @@ |
| 317 | 320 | <scope>test</scope> |
| 318 | 321 | </dependency> |
| 319 | 322 | --> |
| 323 | + | |
| 324 | + <!-- | |
| 325 | + <dependency> | |
| 326 | + <groupId>org.jboss.arquillian.protocol</groupId> | |
| 327 | + <artifactId>arquillian-protocol-servlet</artifactId> | |
| 328 | + <scope>test</scope> | |
| 329 | + </dependency> | |
| 330 | + <dependency> | |
| 331 | + <groupId>org.jboss.arquillian.extension</groupId> | |
| 332 | + <artifactId>arquillian-jacoco</artifactId> | |
| 333 | + <version>1.0.0.Alpha5</version> | |
| 334 | + <scope>test</scope> | |
| 335 | + </dependency> | |
| 336 | + <dependency> | |
| 337 | + <groupId>org.jacoco</groupId> | |
| 338 | + <artifactId>org.jacoco.core</artifactId> | |
| 339 | + <version>0.6.3.201306030806</version> | |
| 340 | + </dependency> | |
| 341 | + --> | |
| 320 | 342 | |
| 321 | 343 | <!-- |
| 322 | 344 | <dependency> |
| ... | ... | @@ -417,12 +439,12 @@ |
| 417 | 439 | <artifactId>validation-api</artifactId> |
| 418 | 440 | <groupId>javax.validation</groupId> |
| 419 | 441 | </exclusion> |
| 442 | + <!-- | |
| 443 | + --> | |
| 420 | 444 | <exclusion> |
| 421 | 445 | <groupId>org.slf4j</groupId> |
| 422 | 446 | <artifactId>slf4j-api</artifactId> |
| 423 | 447 | </exclusion> |
| 424 | - <!-- | |
| 425 | - --> | |
| 426 | 448 | <exclusion> |
| 427 | 449 | <groupId>org.javassist</groupId> |
| 428 | 450 | <artifactId>javassist</artifactId> |
| ... | ... | @@ -434,6 +456,21 @@ |
| 434 | 456 | <artifactId>javax.persistence</artifactId> |
| 435 | 457 | <scope>provided</scope> |
| 436 | 458 | </dependency> |
| 459 | + | |
| 460 | + <!-- | |
| 461 | + <dependency> | |
| 462 | + <groupId>org.slf4j</groupId> | |
| 463 | + <artifactId>jul-to-slf4j</artifactId> | |
| 464 | + <version>1.7.5</version> | |
| 465 | + <scope>runtime</scope> | |
| 466 | + </dependency> | |
| 467 | + <dependency> | |
| 468 | + <groupId>ch.qos.logback</groupId> | |
| 469 | + <artifactId>logback-classic</artifactId> | |
| 470 | + <version>1.0.13</version> | |
| 471 | + <scope>runtime</scope> | |
| 472 | + </dependency> | |
| 473 | + --> | |
| 437 | 474 | </dependencies> |
| 438 | 475 | </profile> |
| 439 | 476 | </profiles> | ... | ... |
impl/extension/jpa/src/test/java/template/JPACrudTest.java
| ... | ... | @@ -22,7 +22,7 @@ public class JPACrudTest { |
| 22 | 22 | @Inject |
| 23 | 23 | private MyCrud crud; |
| 24 | 24 | |
| 25 | - @Deployment | |
| 25 | + @Deployment(name = "1") | |
| 26 | 26 | public static WebArchive createDeployment() { |
| 27 | 27 | WebArchive deployment = Tests.createDeployment(JPACrudTest.class); |
| 28 | 28 | deployment.addAsResource(Tests.createFileAsset(PATH + "/persistence.xml"), "META-INF/persistence.xml"); | ... | ... |
impl/extension/jpa/src/test/java/test/Tests.java
| ... | ... | @@ -67,7 +67,7 @@ public final class Tests { |
| 67 | 67 | return createDeployment().addPackages(true, baseClass.getPackage()); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - public static WebArchive createDeployment() { | |
| 70 | + private static WebArchive createDeployment() { | |
| 71 | 71 | File[] libs = Maven.resolver().offline().loadPomFromFile("pom.xml", "arquillian-test") |
| 72 | 72 | .importCompileAndRuntimeDependencies().resolve().withTransitivity().asFile(); |
| 73 | 73 | |
| ... | ... | @@ -85,7 +85,6 @@ public final class Tests { |
| 85 | 85 | .addAsResource(createFileAsset("src/main/resources/demoiselle-jpa-bundle.properties"), |
| 86 | 86 | "demoiselle-jpa-bundle.properties") |
| 87 | 87 | .addAsResource(createFileAsset("src/test/resources/logging.properties"), "logging.properties") |
| 88 | - .addAsLibraries(libs) | |
| 89 | 88 | .addAsWebInfResource(createFileAsset("src/test/resources/test/beans.xml"), "beans.xml") |
| 90 | 89 | .addAsLibraries(libs); |
| 91 | 90 | } | ... | ... |
impl/extension/jpa/src/test/java/transaction/manual/JPATransactionTest.java
| ... | ... | @@ -37,7 +37,7 @@ public class JPATransactionTest { |
| 37 | 37 | @Name("pu2") |
| 38 | 38 | private EntityManager em2; |
| 39 | 39 | |
| 40 | - @Deployment(testable = true) | |
| 40 | + @Deployment(name = "2") | |
| 41 | 41 | public static WebArchive createDeployment() { |
| 42 | 42 | WebArchive deployment = Tests.createDeployment(JPATransactionTest.class); |
| 43 | 43 | deployment.addAsResource(Tests.createFileAsset(PATH + "/persistence.xml"), "META-INF/persistence.xml"); | ... | ... |
impl/extension/jpa/src/test/resources/arquillian.xml
| ... | ... | @@ -45,13 +45,8 @@ |
| 45 | 45 | |
| 46 | 46 | <container qualifier="jbossas-managed" default="true"> |
| 47 | 47 | <protocol type="Servlet 3.0" /> |
| 48 | - | |
| 49 | 48 | <configuration> |
| 50 | - <!-- <property name="javaHome">/usr/lib/jvm/java-6-serpro/</property> --> | |
| 51 | 49 | <property name="jbossHome">target/jboss-as-${jbossas.version}</property> |
| 52 | - <!-- | |
| 53 | - <property name="serverConfig">../../../../src/test/resources/standalone.xml</property> | |
| 54 | - --> | |
| 55 | 50 | </configuration> |
| 56 | 51 | </container> |
| 57 | 52 | <!-- |
| ... | ... | @@ -73,8 +68,9 @@ |
| 73 | 68 | |
| 74 | 69 | <!-- |
| 75 | 70 | <container qualifier="glassfish-embedded" default="true"> |
| 71 | + <protocol type="Servlet 3.0" /> | |
| 76 | 72 | <configuration> |
| 77 | - <property name="resourcesXml">src/test/resources/glassfish-resources.xml</property> | |
| 73 | + <property name="sunResourcesXml">src/test/resources/glassfish-resources.xml</property> | |
| 78 | 74 | </configuration> |
| 79 | 75 | </container> |
| 80 | 76 | --> |
| ... | ... | @@ -97,4 +93,4 @@ |
| 97 | 93 | </container> |
| 98 | 94 | --> |
| 99 | 95 | |
| 100 | -</arquillian> | |
| 101 | 96 | \ No newline at end of file |
| 97 | +</arquillian> | ... | ... |
impl/extension/jpa/src/test/resources/transaction/manual/persistence.xml
| ... | ... | @@ -41,7 +41,8 @@ |
| 41 | 41 | <persistence-unit name="pu1" transaction-type="RESOURCE_LOCAL"> |
| 42 | 42 | <non-jta-data-source>jdbc/arquillian1</non-jta-data-source> |
| 43 | 43 | |
| 44 | - <class>transaction.manual.MyEntity</class> | |
| 44 | + <class>transaction.manual.MyEntity1</class> | |
| 45 | + <class>transaction.manual.MyEntity2</class> | |
| 45 | 46 | |
| 46 | 47 | <properties> |
| 47 | 48 | <property name="eclipselink.ddl-generation" value="drop-and-create-tables" /> |
| ... | ... | @@ -53,7 +54,8 @@ |
| 53 | 54 | <persistence-unit name="pu2" transaction-type="RESOURCE_LOCAL"> |
| 54 | 55 | <non-jta-data-source>jdbc/arquillian2</non-jta-data-source> |
| 55 | 56 | |
| 56 | - <class>transaction.manual.MyEntity</class> | |
| 57 | + <class>transaction.manual.MyEntity1</class> | |
| 58 | + <class>transaction.manual.MyEntity2</class> | |
| 57 | 59 | |
| 58 | 60 | <properties> |
| 59 | 61 | <property name="eclipselink.ddl-generation" value="drop-and-create-tables" /> | ... | ... |
parent/bom/pom.xml
| ... | ... | @@ -351,12 +351,14 @@ |
| 351 | 351 | <artifactId>arquillian-glassfish-embedded-3.1</artifactId> |
| 352 | 352 | <version>${arquillian.glassfish.embedded.version}</version> |
| 353 | 353 | </dependency> |
| 354 | + <!-- | |
| 354 | 355 | <dependency> |
| 355 | 356 | <groupId>org.jboss.arquillian.extension</groupId> |
| 356 | 357 | <artifactId>arquillian-persistence-impl</artifactId> |
| 357 | 358 | <version>${arquillian.persistence.version}</version> |
| 358 | 359 | <scope>test</scope> |
| 359 | 360 | </dependency> |
| 361 | + --> | |
| 360 | 362 | <dependency> |
| 361 | 363 | <groupId>org.jboss.weld.se</groupId> |
| 362 | 364 | <artifactId>weld-se-core</artifactId> |
| ... | ... | @@ -420,11 +422,14 @@ |
| 420 | 422 | |
| 421 | 423 | <junit.version>4.8.1</junit.version> |
| 422 | 424 | <easymock.version>3.0</easymock.version> |
| 423 | - | |
| 425 | + | |
| 424 | 426 | <arquillian.version>1.1.1.Final</arquillian.version> |
| 427 | + <!-- | |
| 428 | + <arquillian.version>1.0.4.Final</arquillian.version> | |
| 429 | + --> | |
| 425 | 430 | <arquillian.weld.se.embedded.version>1.0.0.CR7</arquillian.weld.se.embedded.version> |
| 426 | 431 | <arquillian.persistence.version>1.0.0.Alpha6</arquillian.persistence.version> |
| 427 | - <arquillian.glassfish.embedded.version>1.0.0.CR3</arquillian.glassfish.embedded.version> | |
| 432 | + <arquillian.glassfish.embedded.version>1.0.0.CR4</arquillian.glassfish.embedded.version> | |
| 428 | 433 | |
| 429 | 434 | <glassfish.embedded.version>3.1.2</glassfish.embedded.version> |
| 430 | 435 | ... | ... |