From 29296286ce4894db5b948124a374e4a6f8a6367d Mon Sep 17 00:00:00 2001 From: Cleverson Sacramento Date: Mon, 19 Aug 2013 16:37:11 -0300 Subject: [PATCH] Experimentos com o Arquillian na extensão JPA --- impl/extension/jpa/pom.xml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- impl/extension/jpa/src/test/java/template/JPACrudTest.java | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ impl/extension/jpa/src/test/java/template/MyCrud.java | 9 +++++++++ impl/extension/jpa/src/test/java/template/MyEntity.java | 29 +++++++++++++++++++++++++++++ impl/extension/jpa/src/test/java/test/Tests.java | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ impl/extension/jpa/src/test/java/transaction/manual/JPATransactionTest.java | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ impl/extension/jpa/src/test/java/transaction/manual/MyEntity.java | 29 +++++++++++++++++++++++++++++ impl/extension/jpa/src/test/resources/arquillian.xml | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ impl/extension/jpa/src/test/resources/glassfish-resources.xml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ impl/extension/jpa/src/test/resources/logging.properties | 39 +++++++++++++++++++++++++++++++++++++++ impl/extension/jpa/src/test/resources/template/persistence.xml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ impl/extension/jpa/src/test/resources/test/beans.xml | 11 +++++++++++ impl/extension/jpa/src/test/resources/transaction/manual/persistence.xml | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 13 files changed, 762 insertions(+), 2 deletions(-) create mode 100644 impl/extension/jpa/src/test/java/template/JPACrudTest.java create mode 100644 impl/extension/jpa/src/test/java/template/MyCrud.java create mode 100644 impl/extension/jpa/src/test/java/template/MyEntity.java create mode 100644 impl/extension/jpa/src/test/java/test/Tests.java create mode 100644 impl/extension/jpa/src/test/java/transaction/manual/JPATransactionTest.java create mode 100644 impl/extension/jpa/src/test/java/transaction/manual/MyEntity.java create mode 100644 impl/extension/jpa/src/test/resources/arquillian.xml create mode 100644 impl/extension/jpa/src/test/resources/glassfish-resources.xml create mode 100644 impl/extension/jpa/src/test/resources/logging.properties create mode 100644 impl/extension/jpa/src/test/resources/template/persistence.xml create mode 100644 impl/extension/jpa/src/test/resources/test/beans.xml create mode 100644 impl/extension/jpa/src/test/resources/transaction/manual/persistence.xml diff --git a/impl/extension/jpa/pom.xml b/impl/extension/jpa/pom.xml index 23a5fbb..c410970 100755 --- a/impl/extension/jpa/pom.xml +++ b/impl/extension/jpa/pom.xml @@ -115,7 +115,8 @@ --> - + org.jboss.arquillian.container arquillian-glassfish-embedded-3.1 @@ -128,7 +129,6 @@ test --> - org.glassfish.main.extras glassfish-embedded-all @@ -136,16 +136,33 @@ test + + org.jboss.shrinkwrap.resolver shrinkwrap-resolver-impl-maven test + + + + + + target/deployments + + + + + + + + src/test/resources/glassfish-resources.xml + + + + + + \ No newline at end of file diff --git a/impl/extension/jpa/src/test/resources/glassfish-resources.xml b/impl/extension/jpa/src/test/resources/glassfish-resources.xml new file mode 100644 index 0000000..c4e65a3 --- /dev/null +++ b/impl/extension/jpa/src/test/resources/glassfish-resources.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/impl/extension/jpa/src/test/resources/logging.properties b/impl/extension/jpa/src/test/resources/logging.properties new file mode 100644 index 0000000..ba0fa45 --- /dev/null +++ b/impl/extension/jpa/src/test/resources/logging.properties @@ -0,0 +1,39 @@ +# Demoiselle Framework +# Copyright (C) 2010 SERPRO +# ---------------------------------------------------------------------------- +# This file is part of Demoiselle Framework. +# +# Demoiselle Framework is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public License version 3 +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License version 3 +# along with this program; if not, see +# or write to the Free Software Foundation, Inc., 51 Franklin Street, +# Fifth Floor, Boston, MA 02110-1301, USA. +# ---------------------------------------------------------------------------- +# Este arquivo é parte do Framework Demoiselle. +# +# O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou +# modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação +# do Software Livre (FSF). +# +# Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA +# GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou +# APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português +# para maiores detalhes. +# +# Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título +# "LICENCA.txt", junto com esse programa. Se não, acesse +# ou escreva para a Fundação do Software Livre (FSF) Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + +handlers=java.util.logging.ConsoleHandler +java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter +java.util.logging.SimpleFormatter.format=%4$s: %5$s%n +java.util.logging.ConsoleHandler.level=FINEST \ No newline at end of file diff --git a/impl/extension/jpa/src/test/resources/template/persistence.xml b/impl/extension/jpa/src/test/resources/template/persistence.xml new file mode 100644 index 0000000..3b22637 --- /dev/null +++ b/impl/extension/jpa/src/test/resources/template/persistence.xml @@ -0,0 +1,66 @@ + + + + + jdbc/arquillian1 + + template.MyEntity + + + + + + + + + + + \ No newline at end of file diff --git a/impl/extension/jpa/src/test/resources/test/beans.xml b/impl/extension/jpa/src/test/resources/test/beans.xml new file mode 100644 index 0000000..d85497f --- /dev/null +++ b/impl/extension/jpa/src/test/resources/test/beans.xml @@ -0,0 +1,11 @@ + + + + br.gov.frameworkdemoiselle.transaction.TransactionalInterceptor + br.gov.frameworkdemoiselle.security.RequiredPermissionInterceptor + br.gov.frameworkdemoiselle.security.RequiredRoleInterceptor + br.gov.frameworkdemoiselle.exception.ExceptionHandlerInterceptor + + + diff --git a/impl/extension/jpa/src/test/resources/transaction/manual/persistence.xml b/impl/extension/jpa/src/test/resources/transaction/manual/persistence.xml new file mode 100644 index 0000000..3f172f6 --- /dev/null +++ b/impl/extension/jpa/src/test/resources/transaction/manual/persistence.xml @@ -0,0 +1,90 @@ + + + + + jdbc/arquillian1 + + transaction.manual.MyEntity + + + + + + + + + + jdbc/arquillian2 + + transaction.manual.MyEntity + + + + + + + + + + + \ No newline at end of file -- libgit2 0.21.2