Commit 98a7160b authored by Administrator's avatar Administrator

Updates the project for the 17/18 course

The project dependencies have been updated, including a change from
WildFly 8.2.1 to 10.1.0. This change affects the project configuration
in several ways, specially in tests configuration.

The README.md file has been updated to reflect the configuration
changes.
parent 7acab75f
...@@ -8,6 +8,7 @@ target ...@@ -8,6 +8,7 @@ target
#General #General
bak bak
angularjs
#Firefox #Firefox
C:\\nppdf32Log\\debuglog.txt C:\\nppdf32Log\\debuglog.txt
...@@ -5,13 +5,14 @@ the XCS subject inside the DGSS itinerary. ...@@ -5,13 +5,14 @@ the XCS subject inside the DGSS itinerary.
## 1. Deployment Environment ## 1. Deployment Environment
The environment is based on Java 8, Maven 3.3+, Git 1.9+, MySQL 5.5+, The environment is based on Java 8, Maven 3.3+, Git 1.9+, MySQL 5.5+,
WildFly 8.2.1 and Eclipse Neon for JavaEE. WildFly 10.1.0 and Eclipse Oxygen for JavaEE.
### 1.1. Java JDK 8 ### 1.1. Java JDK 8
Download and install Java JDK 8, preferably the Oracle version (the commands Download and install Java JDK 8, preferably the Oracle version (the commands
`java` and `javac` must be available). `java` and `javac` must be available).
You can test your Java installation with the commands: You can test your Java installation with the commands:
```bash ```bash
java -version java -version
javac -version javac -version
...@@ -20,27 +21,34 @@ javac -version ...@@ -20,27 +21,34 @@ javac -version
### 1.2. Maven 3.3+ ### 1.2. Maven 3.3+
Install Maven 3 in your system, if it was not installed (the `mvn` command must Install Maven 3 in your system, if it was not installed (the `mvn` command must
be available). If you are in a Debian-based OS, install the `maven` package be available). If you are in a Debian-based OS, install the `maven` package
(**don't install `maven2` package!!**). (**don't install `maven2` package!!**):
```
sudo apt-get install maven
```
You can test your Maven installation with the command: You can test your Maven installation with the command:
```bash ```bash
mvn --version mvn --version
``` ```
### 1.3. Git 1.9+ ### 1.3. Git 1.9+
First, install Git in your system if it was not installed (the `git` command Firstly, install Git in your system if it was not installed (the `git` command
must be available). We will work with Git to get updates of these sample. must be available). We will work with Git to get updates of these sample.
Concretely, we will work with a Git repository inside Concretely, we will work with a Git repository inside
[our Gitlab server](http://sing.ei.uvigo.es/dt/gitlab). [our Gitlab server](https://www.sing-group.org/dt/gitlab).
You can tests your Git installation with the command: You can tests your Git installation with the command:
```bash ```bash
git --version git --version
``` ```
Once Git is installed in your system, clone the project: Once Git is installed in your system, clone the project:
```bash ```bash
git clone http://sing.ei.uvigo.es/dt/gitlab/dgss-1617/xcs-sample.git git clone http://sing-group.org/dt/gitlab/dgss-1718/xcs-sample.git
``` ```
### 1.4. MySQL 5.5+ ### 1.4. MySQL 5.5+
...@@ -111,8 +119,8 @@ VALUES ('CAT','2000-01-01 01:01:01','Pepecat','pepe'), ...@@ -111,8 +119,8 @@ VALUES ('CAT','2000-01-01 01:01:01','Pepecat','pepe'),
You can find the `xcs-sample-mysql.sql` and `xcs-sample-test-mysql.sql` scripts You can find the `xcs-sample-mysql.sql` and `xcs-sample-test-mysql.sql` scripts
with these queries stored in the `additional-material/db` project folder. with these queries stored in the `additional-material/db` project folder.
### 1.5. Eclipse Neon for Java EE ### 1.5. Eclipse Oxygen for Java EE
Open Eclipse Neon for Java EE and import your Maven project with Open Eclipse Oxygen for Java EE and import your Maven project with
`File -> Import -> Maven -> Existing Maven Projects`. In the dialog opened you `File -> Import -> Maven -> Existing Maven Projects`. In the dialog opened you
have to select as `Root directory` the directory of the project that you have have to select as `Root directory` the directory of the project that you have
just cloned (it should contain a `pom.xml` file). just cloned (it should contain a `pom.xml` file).
...@@ -126,9 +134,9 @@ advanced settings of the dialog and use a custom `Name template` (for example, ...@@ -126,9 +134,9 @@ advanced settings of the dialog and use a custom `Name template` (for example,
If you want, you can use any other IDE, such as IntelliJ IDEA or NetBeans, as If you want, you can use any other IDE, such as IntelliJ IDEA or NetBeans, as
long as they are compatible with Maven projects, but we recommend using Eclipse long as they are compatible with Maven projects, but we recommend using Eclipse
Neon for Java EE. Oxygen for Java EE.
### 1.6 WildFly 8.2.1 ### 1.6 WildFly 10.1.0
If you want to run the project you need a Java EE server. In this section you If you want to run the project you need a Java EE server. In this section you
can find how to configure a local WildFly server to execute the project. can find how to configure a local WildFly server to execute the project.
Basically, we need to configure the WildFly server to include the datasource and Basically, we need to configure the WildFly server to include the datasource and
...@@ -137,14 +145,16 @@ the security configuration needed by the application. ...@@ -137,14 +145,16 @@ the security configuration needed by the application.
In the following sections you can find an explanation of how you can configure In the following sections you can find an explanation of how you can configure
the WildFly server by editing the `standalone.xml`. However, the the WildFly server by editing the `standalone.xml`. However, the
`additional-material/wildfly` directory of the project includes a `additional-material/wildfly` directory of the project includes a
`standalone.xml` ready to be used that you can just copy to your WildFly server `standalone.xml` ready to be used for the 10.1.0 and 10.1.0 versions that you can
(replacing the original `standalone/configuration/standalone.xml` file). just copy to your WildFly server (replacing the original
`standalone/configuration/standalone.xml` file).
#### 1.6.1. Datasource configuration #### 1.6.1. Datasource configuration
There are several ways to add a datasource to a WildFly server. We are going to There are several ways to add a datasource to a WildFly server. We are going to
add it by editing the `standalone/configuration/standalone.xml` configuration add it by editing the `standalone/configuration/standalone.xml` configuration
file of the server. To do so, you have to edit this file and add the following file of the server. To do so, you have to edit this file and add the following
content to the `<datasources>` element: content to the `<datasources>` element:
```xml ```xml
<datasource jndi-name="java:jboss/datasources/xcs" pool-name="MySQLPool"> <datasource jndi-name="java:jboss/datasources/xcs" pool-name="MySQLPool">
<connection-url>jdbc:mysql://localhost:3306/xcs</connection-url> <connection-url>jdbc:mysql://localhost:3306/xcs</connection-url>
...@@ -169,6 +179,7 @@ All the WildFly security configuration is done in the ...@@ -169,6 +179,7 @@ All the WildFly security configuration is done in the
`standalone/configuration/standalone.xml` file of the server. `standalone/configuration/standalone.xml` file of the server.
Inside the `<security-reamls>` element you have to add a new security realm: Inside the `<security-reamls>` element you have to add a new security realm:
```xml ```xml
<security-realm name="RemotingRealm"> <security-realm name="RemotingRealm">
<authentication> <authentication>
...@@ -179,6 +190,7 @@ Inside the `<security-reamls>` element you have to add a new security realm: ...@@ -179,6 +190,7 @@ Inside the `<security-reamls>` element you have to add a new security realm:
Then, inside the `<security-domains>` element you have to add the following Then, inside the `<security-domains>` element you have to add the following
security domains: security domains:
```xml ```xml
<security-domain name="AppRealmLoopThrough" cache-type="default"> <security-domain name="AppRealmLoopThrough" cache-type="default">
<authentication> <authentication>
...@@ -236,17 +248,16 @@ following command: ...@@ -236,17 +248,16 @@ following command:
```bash ```bash
mvn install -P wildfly-mysql-run,-wildfly-embedded-h2 mvn install -P wildfly-mysql-run,-wildfly-embedded-h2
``` ```
This will launch the complete construction cycle (remember that you can skip This will launch the complete construction cycle without running the tests,
test execution adding the `-DskipTests=true` parameter), start a WildFly server start a WildFly server and deploy the application. Once the application is
and deploy the application. Once the application is running you can access it running you can access it in the URL http://localhost:8080/xcs-sample/jsf.
in the URL http://localhost:8080/xcs-sample/jsf.
**Important**: You shouldn't have a local WildFly instance running or Maven will **Important**: You shouldn't have a local WildFly instance running or Maven will
not be able to start its own WildFly and will try to deploy the application in not be able to start its own WildFly and will try to deploy the application in
the running instance. This will cause changes to the WildFly configuration that the running instance. This will cause changes to the WildFly configuration that
may leave it in an unstable state. may leave it in an unstable state.
To stop the WildFly lauched you can execute the following command: To stop the WildFly launched you can execute the following command:
```bash ```bash
mvn wildfly:shutdown mvn wildfly:shutdown
...@@ -272,8 +283,8 @@ database, whose driver is included by default in WilFly. ...@@ -272,8 +283,8 @@ database, whose driver is included by default in WilFly.
In both profiles, the WildFly server is automatically downloaded using the In both profiles, the WildFly server is automatically downloaded using the
`maven-dependency-plugin`, that extracts it in the `target/wildfly-<version>` `maven-dependency-plugin`, that extracts it in the `target/wildfly-<version>`
folder (`target/wildfly-8.2.1.Final` currently). In the MySQL profile, the MySQL folder (`target/wildfly-10.1.0.Final` currently). In the MySQL profile, the
driver is also downloaded using this plugin and added to the MySQL driver is also downloaded using this plugin and added to the
`target/wildfly-<version>/standalone/deployments` folder, to make it available `target/wildfly-<version>/standalone/deployments` folder, to make it available
in the WildFly server. in the WildFly server.
...@@ -295,25 +306,37 @@ external requirement. ...@@ -295,25 +306,37 @@ external requirement.
#### 2.2.1.1 Arquillian tests in Eclipse #### 2.2.1.1 Arquillian tests in Eclipse
To run Arquillian tests in Eclipse (or in any non-Maven enviroment) a further To run Arquillian tests in Eclipse (or in any non-Maven enviroment) a further
step is needed. You must configure the following system properties: step is needed. You must configure the following system properties:
* `arquillian.launch`: the launch configuration that arquillian should use.
* `wildfly.version`: the version of the WildFly server stored in `target`.
The current version is `10.1.0.Final`.
* `wildfly.jbossHome`: the location of the WildFly server.
* `wildfly.modulePath`: the location of the module of the WildFly server.
* `java.util.logging.manager`: the logger to be used by the standard Java * `java.util.logging.manager`: the logger to be used by the standard Java
logger. Commonly, the value `org.jboss.logmanager.LogManager` is used. logger. Commonly, the value `org.jboss.logmanager.LogManager` is used.
* `wildfly.version`: the version of the WildFly server stored in `target`. * `jboss.socket.binding.port-offset`: this is an optional parameter that
The current version is `8.2.1.Final`. can be used to move the WildFly default ports.
* `wildfly.http.port`: HTTP of the WildFly server.
* `wildfly.management.port`: management port of the WildFly server.
In Eclipse, this system properties can be added to the run configuration in the In Eclipse, this system properties can be added to the run configuration in the
`VM arguments` field of the `Arguments` tab. For example, the following `VM arguments` field of the `Arguments` tab. For example, the following
configuration will work for the current configuration: configuration will work for the current configuration:
``` ```
-Dwildfly.version=8.2.1.Final -Darquillian.launch=wildfly-embedded
-Dwildfly.version=10.1.0.Final
-Dwildfly.jbossHome=target/wildfly-10.1.0.Final
-Dwildfly.modulePath=target/wildfly-10.1.0.Final/modules
-Djava.util.logging.manager=org.jboss.logmanager.LogManager -Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Djboss.socket.binding.port-offset=10000
-Dwildfly.http.port=18080
-Dwildfly.management.port=19990
``` ```
This configuration will run with the **H2** database. If you wish to run the This configuration will run with the **H2** database. If you wish to run the
tests with the **MySQL** database, you have to add to additional system tests with the **MySQL** database, you have to add to additional system
configuration: configuration:
* `mysql.version`: The version of the MySQL driver (currently, `5.1.21`). This * `mysql.version`: The version of the MySQL driver (currently, `5.1.21`).
version is used by the `mysql-ds.xml` configuration files.
* `arquillian.launch`: This system property is used to change the profile used * `arquillian.launch`: This system property is used to change the profile used
by Arquillian. It should be `wildfly-embedded-mysql` to use the MySQL profile. by Arquillian. It should be `wildfly-embedded-mysql` to use the MySQL profile.
...@@ -321,10 +344,15 @@ Therefore, the `VM arguments` configuration for running the tests in Eclipse ...@@ -321,10 +344,15 @@ Therefore, the `VM arguments` configuration for running the tests in Eclipse
using the MySQL database is: using the MySQL database is:
``` ```
-Dwildfly.version=8.2.1.Final
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Dmysql.version=5.1.21
-Darquillian.launch=wildfly-embedded-mysql -Darquillian.launch=wildfly-embedded-mysql
-Dmysql.version=5.1.21
-Dwildfly.version=10.1.0.Final
-Dwildfly.jbossHome=target/wildfly-10.1.0.Final
-Dwildfly.modulePath=target/wildfly-10.1.0.Final/modules
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Djboss.socket.binding.port-offset=10000
-Dwildfly.http.port=18080
-Dwildfly.management.port=19990
``` ```
## 2.3. Sample 3: Testing with test doubles ## 2.3. Sample 3: Testing with test doubles
......
<?xml version="1.0" ?>
<server xmlns="urn:jboss:domain:4.2">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.connector"/>
<extension module="org.jboss.as.deployment-scanner"/>
<extension module="org.jboss.as.ee"/>
<extension module="org.jboss.as.ejb3"/>
<extension module="org.jboss.as.jaxrs"/>
<extension module="org.jboss.as.jdr"/>
<extension module="org.jboss.as.jmx"/>
<extension module="org.jboss.as.jpa"/>
<extension module="org.jboss.as.jsf"/>
<extension module="org.jboss.as.logging"/>
<extension module="org.jboss.as.mail"/>
<extension module="org.jboss.as.naming"/>
<extension module="org.jboss.as.pojo"/>
<extension module="org.jboss.as.remoting"/>
<extension module="org.jboss.as.sar"/>
<extension module="org.jboss.as.security"/>
<extension module="org.jboss.as.transactions"/>
<extension module="org.jboss.as.webservices"/>
<extension module="org.jboss.as.weld"/>
<extension module="org.wildfly.extension.batch.jberet"/>
<extension module="org.wildfly.extension.bean-validation"/>
<extension module="org.wildfly.extension.io"/>
<extension module="org.wildfly.extension.request-controller"/>
<extension module="org.wildfly.extension.security.manager"/>
<extension module="org.wildfly.extension.undertow"/>
</extensions>
<management>
<security-realms>
<security-realm name="ManagementRealm">
<authentication>
<local default-user="$local" skip-group-loading="true"/>
<properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
</authentication>
<authorization map-groups-to-roles="false">
<properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
</authorization>
</security-realm>
<security-realm name="ApplicationRealm">
<server-identities>
<ssl>
<keystore path="application.keystore" relative-to="jboss.server.config.dir" keystore-password="password" alias="server" key-password="password" generate-self-signed-certificate-host="localhost"/>
</ssl>
</server-identities>
<authentication>
<local default-user="$local" allowed-users="*" skip-group-loading="true"/>
<properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
</authentication>
<authorization>
<properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
</authorization>
</security-realm>
<security-realm name="RemotingRealm">
<authentication>
<jaas name="AppRealmLoopThrough"/>
</authentication>
</security-realm>
</security-realms>
<audit-log>
<formatters>
<json-formatter name="json-formatter"/>
</formatters>
<handlers>
<file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>
</handlers>
<logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="file"/>
</handlers>
</logger>
</audit-log>
<management-interfaces>
<http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
<socket-binding http="management-http"/>
</http-interface>
</management-interfaces>
<access-control provider="simple">
<role-mapping>
<role name="SuperUser">
<include>
<user name="$local"/>
</include>
</role>
</role-mapping>
</access-control>
</management>
<profile>
<subsystem xmlns="urn:jboss:domain:logging:3.0">
<console-handler name="CONSOLE">
<level name="INFO"/>
<formatter>
<named-formatter name="COLOR-PATTERN"/>
</formatter>
</console-handler>
<periodic-rotating-file-handler name="FILE" autoflush="true">
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
<logger category="com.arjuna">
<level name="WARN"/>
</logger>
<logger category="org.jboss.as.config">
<level name="DEBUG"/>
</logger>
<logger category="sun.rmi">
<level name="WARN"/>
</logger>
<root-logger>
<level name="INFO"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
</handlers>
</root-logger>
<formatter name="PATTERN">
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
<formatter name="COLOR-PATTERN">
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
</subsystem>
<subsystem xmlns="urn:jboss:domain:batch-jberet:1.0">
<default-job-repository name="in-memory"/>
<default-thread-pool name="batch"/>
<job-repository name="in-memory">
<in-memory/>
</job-repository>
<thread-pool name="batch">
<max-threads count="10"/>
<keepalive-time time="30" unit="seconds"/>
</thread-pool>
</subsystem>
<subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
<subsystem xmlns="urn:jboss:domain:datasources:4.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:jboss/datasources/xcs" pool-name="xcs-mysql" enabled="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/xcs</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql-connector-java-5.1.21.jar</driver>
<security>
<user-name>xcs</user-name>
<password>xcs</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:ee:4.0">
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
<concurrent>
<context-services>
<context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
</context-services>
<managed-thread-factories>
<managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
</managed-thread-factories>
<managed-executor-services>
<managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/>
</managed-executor-services>
<managed-scheduled-executor-services>
<managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/>
</managed-scheduled-executor-services>
</concurrent>
<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:ejb3:4.0">
<session-bean>
<stateless>
<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
</stateless>
<stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>
<singleton default-access-timeout="5000"/>
</session-bean>
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
<strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
</bean-instance-pools>
</pools>
<caches>
<cache name="simple"/>
<cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
</caches>
<passivation-stores>
<passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
</passivation-stores>
<async thread-pool-name="default"/>
<timer-service thread-pool-name="default" default-data-store="default-file-store">
<data-stores>
<file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
</data-stores>
</timer-service>
<remote connector-ref="http-remoting-connector" thread-pool-name="default"/>
<thread-pools>
<thread-pool name="default">
<max-threads count="10"/>
<keepalive-time time="100" unit="milliseconds"/>
</thread-pool>
</thread-pools>
<default-security-domain value="other"/>
<default-missing-method-permissions-deny-access value="true"/>
<log-system-exceptions value="true"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:io:1.1">
<worker name="default"/>
<buffer-pool name="default"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:infinispan:4.0">
<cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">
<local-cache name="default">
<transaction mode="BATCH"/>
</local-cache>
</cache-container>
<cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan">
<local-cache name="passivation">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store passivation="true" purge="false"/>
</local-cache>
<local-cache name="persistent">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store passivation="false" purge="false"/>
</local-cache>
<local-cache name="concurrent">
<file-store passivation="true" purge="false"/>
</local-cache>
</cache-container>
<cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan">
<local-cache name="passivation">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store passivation="true" purge="false"/>
</local-cache>
<local-cache name="persistent">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store passivation="false" purge="false"/>
</local-cache>
</cache-container>
<cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
<local-cache name="entity">
<transaction mode="NON_XA"/>
<eviction strategy="LRU" max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="local-query">
<eviction strategy="LRU" max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="timestamps"/>
</cache-container>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:4.0">
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
<bean-validation enabled="true"/>
<default-workmanager>
<short-running-threads>
<core-threads count="50"/>
<queue-length count="50"/>
<max-threads count="50"/>
<keepalive-time time="10" unit="seconds"/>
</short-running-threads>
<long-running-threads>
<core-threads count="50"/>
<queue-length count="50"/>
<max-threads count="50"/>
<keepalive-time time="10" unit="seconds"/>
</long-running-threads>
</default-workmanager>
<cached-connection-manager/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jpa:1.1">
<jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jsf:1.0"/>
<subsystem xmlns="urn:jboss:domain:mail:2.0">
<mail-session name="default" jndi-name="java:jboss/mail/Default">
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
</mail-session>
</subsystem>
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<remote-naming/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
<subsystem xmlns="urn:jboss:domain:remoting:3.0">
<endpoint/>
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:resource-adapters:4.0"/>
<subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
<subsystem xmlns="urn:jboss:domain:sar:1.0"/>
<subsystem xmlns="urn:jboss:domain:security-manager:1.0">
<deployment-permissions>
<maximum-set>
<permission class="java.security.AllPermission"/>
</maximum-set>
</deployment-permissions>
</subsystem>
<subsystem xmlns="urn:jboss:domain:security:1.2">
<security-domains>
<security-domain name="other" cache-type="default">
<authentication>
<login-module code="Remoting" flag="optional">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
<login-module code="RealmDirect" flag="required">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
<security-domain name="jboss-web-policy" cache-type="default">
<authorization>
<policy-module code="Delegating" flag="required"/>
</authorization>
</security-domain>
<security-domain name="jboss-ejb-policy" cache-type="default">
<authorization>
<policy-module code="Delegating" flag="required"/>
</authorization>
</security-domain>
<security-domain name="jaspitest" cache-type="default">
<authentication-jaspi>
<login-module-stack name="dummy">
<login-module code="Dummy" flag="optional"/>
</login-module-stack>
<auth-module code="Dummy"/>
</authentication-jaspi>
</security-domain>
<!-- Custom domain -->
<security-domain name="AppRealmLoopThrough" cache-type="default">
<authentication>
<login-module code="Client" flag="required">
<module-option name="multi-threaded" value="true" />
</login-module>
</authentication>
</security-domain>
<security-domain name="xcs-sample-security-domain">
<authentication>
<login-module code="Database" flag="required">
<module-option name="dsJndiName" value="java:jboss/datasources/xcs" />
<module-option name="principalsQuery" value="SELECT password FROM User WHERE login=?" />
<module-option name="rolesQuery" value="SELECT role, 'Roles' FROM User WHERE login=?" />
<module-option name="hashAlgorithm" value="MD5" />
<module-option name="hashEncoding" value="hex" />
<module-option name="ignorePasswordCase" value="true" />
</login-module>
</authentication>
</security-domain>
</security-domains>
</subsystem>
<subsystem xmlns="urn:jboss:domain:transactions:3.0">
<core-environment>
<process-id>
<uuid/>
</process-id>
</core-environment>
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
<https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>
<subsystem xmlns="urn:jboss:domain:webservices:2.0">
<wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
<endpoint-config name="Standard-Endpoint-Config"/>
<endpoint-config name="Recording-Endpoint-Config">
<pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
<handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
</pre-handler-chain>
</endpoint-config>
<client-config name="Standard-Client-Config"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:weld:3.0"/>
</profile>
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
</interfaces>
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:8080}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
</server>
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<datasource jta="true" jndi-name="java:jboss/datasources/xcs" pool-name="xcs-mysql" enabled="true" use-ccm="true"> <datasource jta="true" jndi-name="java:jboss/datasources/xcs" pool-name="xcs-mysql" enabled="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/xcs</connection-url> <connection-url>jdbc:mysql://localhost:3306/xcs</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class> <driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql-connector-java-${mysql.version}.jar</driver> <driver>mysql-connector-java-5.1.21.jar</driver>
<security> <security>
<user-name>xcs</user-name> <user-name>xcs</user-name>
<password>xcs</password> <password>xcs</password>
...@@ -329,28 +329,26 @@ ...@@ -329,28 +329,26 @@
</authorization> </authorization>
</security-domain> </security-domain>
<!-- Custom domain --> <!-- Custom domain -->
<security-domain name="AppRealmLoopThrough" cache-type="default"> <security-domain name="AppRealmLoopThrough" cache-type="default">
<authentication> <authentication>
<login-module code="Client" flag="required"> <login-module code="Client" flag="required">
<module-option name="multi-threaded" value="true" /> <module-option name="multi-threaded" value="true" />
</login-module> </login-module>
</authentication> </authentication>
</security-domain> </security-domain>
<security-domain name="xcs-sample-security-domain"> <security-domain name="xcs-sample-security-domain">
<authentication> <authentication>
<login-module code="Database" flag="required"> <login-module code="Database" flag="required">
<module-option name="dsJndiName" value="java:jboss/datasources/xcs" /> <module-option name="dsJndiName" value="java:jboss/datasources/xcs" />
<module-option name="principalsQuery" <module-option name="principalsQuery" value="SELECT password FROM User WHERE login=?" />
value="SELECT password FROM User WHERE login=?" /> <module-option name="rolesQuery" value="SELECT role, 'Roles' FROM User WHERE login=?" />
<module-option name="rolesQuery" <module-option name="hashAlgorithm" value="MD5" />
value="SELECT role, 'Roles' FROM User WHERE login=?" /> <module-option name="hashEncoding" value="hex" />
<module-option name="hashAlgorithm" value="MD5"/> <module-option name="ignorePasswordCase" value="true" />
<module-option name="hashEncoding" value="hex"/> </login-module>
<module-option name="ignorePasswordCase" value="true"/> </authentication>
</login-module> </security-domain>
</authentication>
</security-domain>
</security-domains> </security-domains>
</subsystem> </subsystem>
<subsystem xmlns="urn:jboss:domain:transactions:2.0"> <subsystem xmlns="urn:jboss:domain:transactions:2.0">
......
...@@ -77,9 +77,9 @@ ...@@ -77,9 +77,9 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<configuration> <!-- >configuration>
<skipTests>true</skipTests> <skipTests>true</skipTests>
</configuration> </configuration-->
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1"> version="2.1">
<persistence-unit name="runtime"> <persistence-unit name="runtime">
<jta-data-source>java:jboss/datasources/xcs</jta-data-source> <jta-data-source>java:jboss/datasources/xcs</jta-data-source>
<class>es.uvigo.esei.xcs.domain.entities.Owner</class> <class>es.uvigo.esei.xcs.domain.entities.Owner</class>
<class>es.uvigo.esei.xcs.domain.entities.Pet</class> <class>es.uvigo.esei.xcs.domain.entities.Pet</class>
<class>es.uvigo.esei.xcs.domain.entities.Administrator</class> <class>es.uvigo.esei.xcs.domain.entities.Administrator</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes> <exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties> <properties>
<property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false"/> <property name="hibernate.show_sql" value="false" />
</properties> </properties>
</persistence-unit> </persistence-unit>
</persistence> </persistence>
\ No newline at end of file
...@@ -13,6 +13,7 @@ import static es.uvigo.esei.xcs.domain.entities.OwnersDataset.ownersWithout; ...@@ -13,6 +13,7 @@ import static es.uvigo.esei.xcs.domain.entities.OwnersDataset.ownersWithout;
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
import java.io.File;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
...@@ -32,6 +33,7 @@ import org.jboss.shrinkwrap.api.Archive; ...@@ -32,6 +33,7 @@ import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive; import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
...@@ -66,6 +68,8 @@ public class OwnerJsfTest { ...@@ -66,6 +68,8 @@ public class OwnerJsfTest {
.addAsWebInfResource(WEBAPP.resolve("WEB-INF/template.xhtml").toFile()) .addAsWebInfResource(WEBAPP.resolve("WEB-INF/template.xhtml").toFile())
.addAsWebInfResource(WEBAPP.resolve("WEB-INF/web.xml").toFile()) .addAsWebInfResource(WEBAPP.resolve("WEB-INF/web.xml").toFile())
.addAsWebInfResource(WEBAPP.resolve("WEB-INF/jboss-web.xml").toFile()) .addAsWebInfResource(WEBAPP.resolve("WEB-INF/jboss-web.xml").toFile())
.addAsResource("arquillian.extension.persistence.properties")
.addAsResource("arquillian.extension.persistence.dbunit.properties")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
} }
......
datatypeFactory = org.dbunit.ext.h2.H2DataTypeFactory
\ No newline at end of file
datatypeFactory = org.dbunit.ext.h2.H2DataTypeFactory
\ No newline at end of file
defaultDataSeedStrategy = CLEAN_INSERT
defaultCleanupPhase = BEFORE
defaultDataSource = java:jboss/datasources/xcs
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.org/schema/arquillian" <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
xsi:schemaLocation="
http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<extension qualifier="persistence">
<extension qualifier="persistence"> <property name="defaultDataSeedStrategy">CLEAN_INSERT</property>
<property name="defaultDataSeedStrategy">CLEAN_INSERT</property> <property name="defaultCleanupPhase">BEFORE</property>
</extension> <property name="defaultDataSource">java:jboss/datasources/xcs</property>
</extension>
<extension qualifier="webdriver">
<property name="browser">firefox</property> <extension qualifier="webdriver">
</extension> <property name="browser">firefox</property>
</extension>
<container qualifier="wildfly-embedded" default="true">
<configuration> <container qualifier="wildfly-embedded" default="true">
<property name="jbossHome">target/wildfly-${wildfly.version}</property> <configuration>
<property name="modulePath">target/wildfly-${wildfly.version}/modules</property> <property name="jbossHome">target/wildfly-${wildfly.version}</property>
<property name="managementPort">19990</property> <property name="modulePath">target/wildfly-${wildfly.version}/modules</property>
</configuration> <property name="managementPort">${wildfly.management.port}</property>
<protocol type="Servlet 3.0"> </configuration>
<property name="port">18080</property>
</protocol> <protocol type="Servlet 3.0">
</container> <property name="port">${wildfly.http.port}</property>
</protocol>
</container>
</arquillian> </arquillian>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1"> version="2.1">
<persistence-unit name="test"> <persistence-unit name="test">
<jta-data-source>java:jboss/datasources/xcs</jta-data-source> <jta-data-source>java:jboss/datasources/xcs</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties> <class>es.uvigo.esei.xcs.domain.entities.Owner</class>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/> <class>es.uvigo.esei.xcs.domain.entities.Pet</class>
<property name="hibernate.show_sql" value="true"/> <class>es.uvigo.esei.xcs.domain.entities.Administrator</class>
</properties> <exclude-unlisted-classes>false</exclude-unlisted-classes>
</persistence-unit>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence> </persistence>
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>es.uvigo.esei.xcs</groupId> <groupId>es.uvigo.esei.xcs</groupId>
<artifactId>sample</artifactId> <artifactId>sample</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Sample</name> <name>Sample</name>
<distributionManagement> <distributionManagement>
<repository> <repository>
<id>deployment</id> <id>deployment</id>
<name>Internal Releases</name> <name>Internal Releases</name>
<url>http://sing.ei.uvigo.es/dt/nexus/content/repositories/releases/</url> <url>https://www.sing-group.org/dt/nexus/content/repositories/releases/</url>
</repository> </repository>
<snapshotRepository> <snapshotRepository>
<id>deployment</id> <id>deployment</id>
<name>Internal SNAPSHOT Releases</name> <name>Internal SNAPSHOT Releases</name>
<url>http://sing.ei.uvigo.es/dt/nexus/content/repositories/snapshots/</url> <url>https://www.sing-group.org/dt/nexus/content/repositories/snapshots/</url>
</snapshotRepository> </snapshotRepository>
</distributionManagement> </distributionManagement>
...@@ -40,39 +38,42 @@ ...@@ -40,39 +38,42 @@
<!-- BOM versions --> <!-- BOM versions -->
<javaee.api.version>7.0</javaee.api.version> <javaee.api.version>7.0</javaee.api.version>
<arquillian.version>1.1.11.Final</arquillian.version> <arquillian.version>1.1.13.Final</arquillian.version>
<arquillian.rest.version>1.0.0.Alpha4</arquillian.rest.version> <arquillian.rest.version>1.0.0.Alpha4</arquillian.rest.version>
<arquillian.selenium.version>3.0.0</arquillian.selenium.version> <arquillian.selenium.version>3.4.0</arquillian.selenium.version>
<shrinkwrap.resolver.bom.version>3.0.0-beta-2</shrinkwrap.resolver.bom.version>
<!-- Dependencies versions --> <!-- Dependencies versions -->
<wildfly.version>8.2.1.Final</wildfly.version> <wildfly.version>10.1.0.Final</wildfly.version>
<commons.lang3.version>3.4</commons.lang3.version> <commons.lang3.version>3.4</commons.lang3.version>
<bootstrap.version>3.3.7-1</bootstrap.version> <bootstrap.version>3.3.7-1</bootstrap.version>
<!-- Testing dependecies versions --> <!-- Testing dependecies versions -->
<junit.version>4.12</junit.version> <arquillian.jacoco.version>1.0.0.Alpha9</arquillian.jacoco.version>
<hamcrest.version>2.0.0.0</hamcrest.version>
<easymock.version>3.4</easymock.version>
<jacoco.version>0.7.7.201606060606</jacoco.version>
<arquillian.jacoco.version>1.0.0.Alpha8</arquillian.jacoco.version>
<arquillian.persistence.dbunit.version>1.0.0.Alpha7</arquillian.persistence.dbunit.version> <arquillian.persistence.dbunit.version>1.0.0.Alpha7</arquillian.persistence.dbunit.version>
<slf4j.version>1.5.10</slf4j.version> <arquillian.wildfly.embedded.version>3.0.3.Final</arquillian.wildfly.embedded.version>
<arquillian.wildfly.embedded.container.version>2.1.0.Final</arquillian.wildfly.embedded.container.version>
<easymock.version>3.4</easymock.version>
<geckodriver.version>v0.19.0</geckodriver.version>
<graphene.webdrive.version>2.3.1</graphene.webdrive.version>
<hamcrest.version>2.0.0.0</hamcrest.version>
<jacoco.version>0.7.9</jacoco.version>
<junit.version>4.12</junit.version>
<mysql.connector.java.version>5.1.21</mysql.connector.java.version> <mysql.connector.java.version>5.1.21</mysql.connector.java.version>
<resteasy.version>3.0.19.Final</resteasy.version> <resteasy.version>3.0.24.Final</resteasy.version>
<graphene.webdrive.version>2.1.0.Final</graphene.webdrive.version> <slf4j.version>1.5.10</slf4j.version>
<geckodriver.version>v0.11.1</geckodriver.version>
<!-- Plugins versions --> <!-- Plugins versions -->
<wildfly.maven.plugin.version>1.1.0.Alpha11</wildfly.maven.plugin.version> <maven.antrun.plugin.version>1.8</maven.antrun.plugin.version>
<maven.compiler.plugin.version>3.5.1</maven.compiler.plugin.version> <maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
<maven.source.plugin.version>3.0.1</maven.source.plugin.version> <maven.ear.plugin.version>2.10.1</maven.ear.plugin.version>
<maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version> <maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
<maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
<maven.dependency.plugin.version>2.10</maven.dependency.plugin.version> <maven.dependency.plugin.version>2.10</maven.dependency.plugin.version>
<maven.surefire.plugin.version>2.19.1</maven.surefire.plugin.version> <maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
<maven.resources.plugin.version>3.0.1</maven.resources.plugin.version> <maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
<maven.ear.plugin.version>2.10.1</maven.ear.plugin.version> <maven.source.plugin.version>3.0.1</maven.source.plugin.version>
<maven.antrun.plugin.version>1.8</maven.antrun.plugin.version> <maven.surefire.plugin.version>2.20</maven.surefire.plugin.version>
<wildfly.maven.plugin.version>1.2.0.Final</wildfly.maven.plugin.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
...@@ -97,7 +98,7 @@ ...@@ -97,7 +98,7 @@
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<!-- Modules --> <!-- Modules -->
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
...@@ -133,9 +134,9 @@ ...@@ -133,9 +134,9 @@
<version>${commons.lang3.version}</version> <version>${commons.lang3.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.webjars</groupId> <groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId> <artifactId>bootstrap</artifactId>
<version>${bootstrap.version}</version> <version>${bootstrap.version}</version>
</dependency> </dependency>
<!-- Testing --> <!-- Testing -->
...@@ -207,18 +208,18 @@ ...@@ -207,18 +208,18 @@
<version>${wildfly.version}</version> <version>${wildfly.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly.core</groupId>
<artifactId>wildfly-embedded</artifactId> <artifactId>wildfly-embedded</artifactId>
<version>${wildfly.version}</version> <version>${arquillian.wildfly.embedded.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-embedded</artifactId> <artifactId>wildfly-arquillian-container-embedded</artifactId>
<version>${wildfly.version}</version> <version>${arquillian.wildfly.embedded.container.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
...@@ -253,6 +254,7 @@ ...@@ -253,6 +254,7 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
...@@ -304,8 +306,7 @@ ...@@ -304,8 +306,7 @@
<artifactId>wildfly-maven-plugin</artifactId> <artifactId>wildfly-maven-plugin</artifactId>
<version>${wildfly.maven.plugin.version}</version> <version>${wildfly.maven.plugin.version}</version>
<configuration> <configuration>
<!-- Avoids the execution of the wildfly:* goals in the subproject <!-- Avoids the execution of the wildfly:* goals in the subproject unless the plugin is activated in the subproject. -->
unless the plugin is activated in the subproject. -->
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>
</plugin> </plugin>
...@@ -351,8 +352,7 @@ ...@@ -351,8 +352,7 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
only. It has no influence on the Maven build itself. -->
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
...@@ -362,15 +362,9 @@ ...@@ -362,15 +362,9 @@
<pluginExecutions> <pluginExecutions>
<pluginExecution> <pluginExecution>
<pluginExecutionFilter> <pluginExecutionFilter>
<groupId> <groupId> org.apache.maven.plugins</groupId>
org.apache.maven.plugins <artifactId> maven-dependency-plugin</artifactId>
</groupId> <versionRange> [2.10,)</versionRange>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>
[2.10,)
</versionRange>
<goals> <goals>
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>
...@@ -381,15 +375,9 @@ ...@@ -381,15 +375,9 @@
</pluginExecution> </pluginExecution>
<pluginExecution> <pluginExecution>
<pluginExecutionFilter> <pluginExecutionFilter>
<groupId> <groupId>org.apache.maven.plugins</groupId>
org.apache.maven.plugins <artifactId>maven-antrun-plugin</artifactId>
</groupId> <versionRange>[1.8,)</versionRange>
<artifactId>
maven-antrun-plugin
</artifactId>
<versionRange>
[1.8,)
</versionRange>
<goals> <goals>
<goal>run</goal> <goal>run</goal>
</goals> </goals>
...@@ -414,13 +402,13 @@ ...@@ -414,13 +402,13 @@
</activation> </activation>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly.core</groupId>
<artifactId>wildfly-arquillian-container-embedded</artifactId> <artifactId>wildfly-embedded</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-embedded</artifactId> <artifactId>wildfly-arquillian-container-embedded</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -450,14 +438,18 @@ ...@@ -450,14 +438,18 @@
<configuration> <configuration>
<forkCount>1</forkCount> <forkCount>1</forkCount>
<systemPropertyVariables> <systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> <arquillian.launch>wildfly-embedded</arquillian.launch>
<wildfly.version>${wildfly.version}</wildfly.version> <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<arquillian.launch>wildfly-embedded</arquillian.launch> <jboss.socket.binding.port-offset>10000</jboss.socket.binding.port-offset>
<wildfly.version>${wildfly.version}</wildfly.version>
<wildfly.http.port>18080</wildfly.http.port>
<wildfly.management.port>19990</wildfly.management.port>
<wildfly.jbossHome>target/wildfly-${wildfly.version}</wildfly.jbossHome>
<wildfly.modulePath>target/wildfly-${wildfly.version}/modules</wildfly.modulePath>
</systemPropertyVariables> </systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile> <redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
...@@ -483,7 +475,6 @@ ...@@ -483,7 +475,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
...@@ -517,13 +508,13 @@ ...@@ -517,13 +508,13 @@
</activation> </activation>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly.core</groupId>
<artifactId>wildfly-arquillian-container-embedded</artifactId> <artifactId>wildfly-embedded</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wildfly</groupId> <groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-embedded</artifactId> <artifactId>wildfly-arquillian-container-embedded</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
...@@ -553,10 +544,15 @@ ...@@ -553,10 +544,15 @@
<configuration> <configuration>
<forkCount>1</forkCount> <forkCount>1</forkCount>
<systemPropertyVariables> <systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<mysql.version>${mysql.connector.java.version}</mysql.version> <mysql.version>${mysql.connector.java.version}</mysql.version>
<wildfly.version>${wildfly.version}</wildfly.version> <arquillian.launch>wildfly-embedded</arquillian.launch>
<arquillian.launch>wildfly-embedded</arquillian.launch> <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<jboss.socket.binding.port-offset>10000</jboss.socket.binding.port-offset>
<wildfly.version>${wildfly.version}</wildfly.version>
<wildfly.http.port>18080</wildfly.http.port>
<wildfly.management.port>19990</wildfly.management.port>
<wildfly.jbossHome>target/wildfly-${wildfly.version}</wildfly.jbossHome>
<wildfly.modulePath>target/wildfly-${wildfly.version}/modules</wildfly.modulePath>
</systemPropertyVariables> </systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile> <redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration> </configuration>
...@@ -624,7 +620,6 @@ ...@@ -624,7 +620,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
...@@ -653,50 +648,14 @@ ...@@ -653,50 +648,14 @@
<profile> <profile>
<id>wildfly-mysql-run</id> <id>wildfly-mysql-run</id>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-embedded</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-embedded</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build> <build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<directory>src/test/resources-wildfly-embedded-mysql</directory>
</testResource>
</testResources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<configuration> <configuration>
<forkCount>1</forkCount> <!-- Tests will not be run when launching the application -->
<systemPropertyVariables> <skipTests>true</skipTests>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<mysql.version>${mysql.connector.java.version}</mysql.version>
<wildfly.version>${wildfly.version}</wildfly.version>
<arquillian.launch>wildfly-embedded</arquillian.launch>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
...@@ -762,7 +721,6 @@ ...@@ -762,7 +721,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
...@@ -785,51 +743,56 @@ ...@@ -785,51 +743,56 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.wildfly.plugins</groupId> <groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId> <artifactId>wildfly-maven-plugin</artifactId>
<configuration> <configuration>
<before-deployment> <before-deployment>
<batch/> <batch />
<commands> <commands>
<command>deploy ${project.build.directory}/mysql-connector-java-${mysql.connector.java.version}.jar</command> <command>deploy ${project.build.directory}/mysql-connector-java-${mysql.connector.java.version}.jar</command>
<command>data-source add --jndi-name=java:jboss/datasources/xcs --name=xcs-sample --jta=true --use-ccm=true --connection-url=jdbc:mysql://localhost:3306/xcs --driver-name=mysql-connector-java-${mysql.connector.java.version}.jar --driver-class=com.mysql.jdbc.Driver --user-name=xcs --password=xcs</command> <command>data-source add --jndi-name=java:jboss/datasources/xcs --name=xcs-sample --jta=true --use-ccm=true
--connection-url=jdbc:mysql://localhost:3306/xcs --driver-name=mysql-connector-java-${mysql.connector.java.version}.jar
--driver-class=com.mysql.jdbc.Driver --user-name=xcs --password=xcs</command>
<command>/core-service=management/security-realm=RemotingRealm:add</command> <command>/core-service=management/security-realm=RemotingRealm:add</command>
<command>/core-service=management/security-realm=RemotingRealm/authentication=jaas:add(name="AppRealmLoopThrough")</command> <command>/core-service=management/security-realm=RemotingRealm/authentication=jaas:add(name="AppRealmLoopThrough")</command>
<command>/subsystem=remoting/http-connector=http-remoting-connector:write-attribute(name="security-realm", value="RemotingRealm")</command> <command>/subsystem=remoting/http-connector=http-remoting-connector:write-attribute(name="security-realm", value="RemotingRealm")</command>
<command>/subsystem=security/security-domain=AppRealmLoopThrough:add(cache-type=default)</command> <command>/subsystem=security/security-domain=AppRealmLoopThrough:add(cache-type=default)</command>
<command>/subsystem=security/security-domain=AppRealmLoopThrough/authentication=classic:add(login-modules=[{"code"=>"Client", "flag" => "required", "module-options" => [("multi-threaded" => "true")]}])</command> <command>/subsystem=security/security-domain=AppRealmLoopThrough/authentication=classic:add(login-modules=[{"code"=>"Client", "flag" =>
"required", "module-options" => [("multi-threaded" => "true")]}])</command>
<command>/subsystem=security/security-domain=xcs-sample-security-domain:add</command> <command>/subsystem=security/security-domain=xcs-sample-security-domain:add</command>
<command>/subsystem=security/security-domain=xcs-sample-security-domain/authentication=classic:add(login-modules=[{"code"=>"Database", "flag" => "required", "module-options" => [("dsJndiName" => "java:jboss/datasources/xcs"),("principalsQuery" => "SELECT password FROM User WHERE login=?"),("rolesQuery" => "SELECT role, 'Roles' FROM User WHERE login=?"),("hashAlgorithm" => "MD5"),("hashEncoding" => "hex"),("ignorePasswordCase" => "true")]}])</command> <command>/subsystem=security/security-domain=xcs-sample-security-domain/authentication=classic:add(login-modules=[{"code"=>"Database", "flag"
=> "required", "module-options" => [("dsJndiName" => "java:jboss/datasources/xcs"),("principalsQuery" => "SELECT password FROM User WHERE
login=?"),("rolesQuery" => "SELECT role, 'Roles' FROM User WHERE login=?"),("hashAlgorithm" => "MD5"),("hashEncoding" =>
"hex"),("ignorePasswordCase" => "true")]}])</command>
</commands> </commands>
</before-deployment> </before-deployment>
<after-deployment> <after-deployment>
<commands> <commands>
<command>:reload</command> <command>:reload</command>
</commands> </commands>
</after-deployment> </after-deployment>
<add-user> <add-user>
<users> <users>
<user> <user>
<username>wildfly-admin</username> <username>wildfly-admin</username>
<password>xcsadmin</password> <password>xcsadmin</password>
<applicationUser>false</applicationUser> <applicationUser>false</applicationUser>
</user> </user>
</users> </users>
</add-user> </add-user>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<id>start-wildfly</id> <id>start-wildfly</id>
<phase>install</phase> <phase>install</phase>
<goals> <goals>
<goal>start</goal> <goal>start</goal>
<goal>deploy-only</goal> <goal>deploy-only</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</profile> </profile>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1"> version="2.1">
<persistence-unit name="runtime"> <persistence-unit name="runtime">
<jta-data-source>java:jboss/datasources/xcs</jta-data-source> <jta-data-source>java:jboss/datasources/xcs</jta-data-source>
<class>es.uvigo.esei.xcs.domain.entities.Owner</class> <class>es.uvigo.esei.xcs.domain.entities.Owner</class>
<class>es.uvigo.esei.xcs.domain.entities.Pet</class> <class>es.uvigo.esei.xcs.domain.entities.Pet</class>
<class>es.uvigo.esei.xcs.domain.entities.Administrator</class> <class>es.uvigo.esei.xcs.domain.entities.Administrator</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes> <exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties> <properties>
<property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false"/> <property name="hibernate.show_sql" value="false" />
</properties> </properties>
</persistence-unit> </persistence-unit>
</persistence> </persistence>
\ No newline at end of file
...@@ -65,6 +65,8 @@ public class OwnerResourceRestTest { ...@@ -65,6 +65,8 @@ public class OwnerResourceRestTest {
.addAsResource("test-persistence.xml", "META-INF/persistence.xml") .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource("jboss-web.xml") .addAsWebInfResource("jboss-web.xml")
.addAsWebInfResource("web.xml") .addAsWebInfResource("web.xml")
.addAsResource("arquillian.extension.persistence.properties")
.addAsResource("arquillian.extension.persistence.dbunit.properties")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
} }
......
datatypeFactory = org.dbunit.ext.h2.H2DataTypeFactory
\ No newline at end of file
datatypeFactory = org.dbunit.ext.h2.H2DataTypeFactory
\ No newline at end of file
defaultDataSeedStrategy = CLEAN_INSERT
defaultCleanupPhase = BEFORE
defaultDataSource = java:jboss/datasources/xcs
...@@ -4,19 +4,25 @@ ...@@ -4,19 +4,25 @@
xsi:schemaLocation=" xsi:schemaLocation="
http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<extension qualifier="persistence">
<extension qualifier="persistence"> <property name="defaultDataSeedStrategy">CLEAN_INSERT</property>
<property name="defaultDataSeedStrategy">CLEAN_INSERT</property> <property name="defaultCleanupPhase">BEFORE</property>
</extension> <property name="defaultDataSource">java:jboss/datasources/xcs</property>
</extension>
<container qualifier="wildfly-embedded" default="true">
<configuration> <extension qualifier="webdriver">
<property name="jbossHome">target/wildfly-${wildfly.version}</property> <property name="browser">firefox</property>
<property name="modulePath">target/wildfly-${wildfly.version}/modules</property> </extension>
<property name="managementPort">19990</property>
</configuration> <container qualifier="wildfly-embedded" default="true">
<protocol type="Servlet 3.0"> <configuration>
<property name="port">18080</property> <property name="jbossHome">target/wildfly-${wildfly.version}</property>
</protocol> <property name="modulePath">target/wildfly-${wildfly.version}/modules</property>
</container> <property name="managementPort">${wildfly.management.port}</property>
</configuration>
<protocol type="Servlet 3.0">
<property name="port">${wildfly.http.port}</property>
</protocol>
</container>
</arquillian> </arquillian>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1"> version="2.1">
<persistence-unit name="test"> <persistence-unit name="test">
<jta-data-source>java:jboss/datasources/xcs</jta-data-source> <jta-data-source>java:jboss/datasources/xcs</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties> <class>es.uvigo.esei.xcs.domain.entities.Owner</class>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/> <class>es.uvigo.esei.xcs.domain.entities.Pet</class>
<property name="hibernate.show_sql" value="true"/> <class>es.uvigo.esei.xcs.domain.entities.Administrator</class>
</properties> <exclude-unlisted-classes>false</exclude-unlisted-classes>
</persistence-unit>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence> </persistence>
\ No newline at end of file
...@@ -46,6 +46,8 @@ public class OwnerServiceIllegalAccessIntegrationTest { ...@@ -46,6 +46,8 @@ public class OwnerServiceIllegalAccessIntegrationTest {
.addPackage(Owner.class.getPackage()) .addPackage(Owner.class.getPackage())
.addAsResource("test-persistence.xml", "META-INF/persistence.xml") .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource("jboss-web.xml") .addAsWebInfResource("jboss-web.xml")
.addAsResource("arquillian.extension.persistence.properties")
.addAsResource("arquillian.extension.persistence.dbunit.properties")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
return archive; return archive;
......
...@@ -64,6 +64,8 @@ public class OwnerServiceIntegrationTest { ...@@ -64,6 +64,8 @@ public class OwnerServiceIntegrationTest {
.addPackage(Owner.class.getPackage()) .addPackage(Owner.class.getPackage())
.addAsResource("test-persistence.xml", "META-INF/persistence.xml") .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource("jboss-web.xml") .addAsWebInfResource("jboss-web.xml")
.addAsResource("arquillian.extension.persistence.properties")
.addAsResource("arquillian.extension.persistence.dbunit.properties")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
} }
......
...@@ -54,6 +54,8 @@ public class PetServiceIllegalAccessIntegrationTest { ...@@ -54,6 +54,8 @@ public class PetServiceIllegalAccessIntegrationTest {
.addPackage(Pet.class.getPackage()) .addPackage(Pet.class.getPackage())
.addAsResource("test-persistence.xml", "META-INF/persistence.xml") .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource("jboss-web.xml") .addAsWebInfResource("jboss-web.xml")
.addAsResource("arquillian.extension.persistence.properties")
.addAsResource("arquillian.extension.persistence.dbunit.properties")
.addAsWebInfResource("beans.xml", "beans.xml"); .addAsWebInfResource("beans.xml", "beans.xml");
return archive; return archive;
......
...@@ -63,6 +63,8 @@ public class PetServiceIntegrationTest { ...@@ -63,6 +63,8 @@ public class PetServiceIntegrationTest {
.addPackage(Pet.class.getPackage()) .addPackage(Pet.class.getPackage())
.addAsResource("test-persistence.xml", "META-INF/persistence.xml") .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource("jboss-web.xml") .addAsWebInfResource("jboss-web.xml")
.addAsResource("arquillian.extension.persistence.properties")
.addAsResource("arquillian.extension.persistence.dbunit.properties")
.addAsWebInfResource("beans.xml", "beans.xml"); .addAsWebInfResource("beans.xml", "beans.xml");
} }
......
datatypeFactory = org.dbunit.ext.h2.H2DataTypeFactory
\ No newline at end of file
datatypeFactory = org.dbunit.ext.h2.H2DataTypeFactory
\ No newline at end of file
defaultDataSeedStrategy = CLEAN_INSERT
defaultCleanupPhase = BEFORE
defaultDataSource = java:jboss/datasources/xcs
...@@ -4,19 +4,21 @@ ...@@ -4,19 +4,21 @@
xsi:schemaLocation=" xsi:schemaLocation="
http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<extension qualifier="persistence">
<extension qualifier="persistence"> <property name="defaultDataSeedStrategy">CLEAN_INSERT</property>
<property name="defaultDataSeedStrategy">CLEAN_INSERT</property> <property name="defaultCleanupPhase">BEFORE</property>
</extension> <property name="defaultDataSource">java:jboss/datasources/xcs</property>
</extension>
<container qualifier="wildfly-embedded" default="true">
<configuration> <container qualifier="wildfly-embedded" default="true">
<property name="jbossHome">target/wildfly-${wildfly.version}</property> <configuration>
<property name="modulePath">target/wildfly-${wildfly.version}/modules</property> <property name="jbossHome">target/wildfly-${wildfly.version}</property>
<property name="managementPort">19990</property> <property name="modulePath">target/wildfly-${wildfly.version}/modules</property>
</configuration> <property name="managementPort">${wildfly.management.port}</property>
<protocol type="Servlet 3.0"> </configuration>
<property name="port">18080</property>
</protocol> <protocol type="Servlet 3.0">
</container> <property name="port">${wildfly.http.port}</property>
</protocol>
</container>
</arquillian> </arquillian>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1"> version="2.1">
<persistence-unit name="test"> <persistence-unit name="test">
<jta-data-source>java:jboss/datasources/xcs</jta-data-source> <jta-data-source>java:jboss/datasources/xcs</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes> <class>es.uvigo.esei.xcs.domain.entities.Owner</class>
<class>es.uvigo.esei.xcs.domain.entities.Pet</class>
<properties> <class>es.uvigo.esei.xcs.domain.entities.Administrator</class>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/> <exclude-unlisted-classes>false</exclude-unlisted-classes>
<property name="hibernate.show_sql" value="true"/>
</properties> <properties>
</persistence-unit> <property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence> </persistence>
\ No newline at end of file
#
# JBoss, Home of Professional Open Source.
# Copyright 2013, Red Hat, Inc., and individual contributors
# as indicated by the @author tags. See the copyright.txt file in the
# distribution for a full listing of individual contributors.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This software 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
#
# Additional loggers to configure (the root logger is always configured)
loggers=com.arjuna,jacorb,org.jboss.as.config,org.apache.tomcat.util.modeler,sun.rmi,jacorb.config
logger.level=INFO
logger.handlers=CONSOLE
logger.com.arjuna.level=WARN
logger.com.arjuna.useParentHandlers=true
logger.jacorb.level=WARN
logger.jacorb.useParentHandlers=true
logger.org.jboss.as.config.level=DEBUG
logger.org.jboss.as.config.useParentHandlers=true
logger.org.apache.tomcat.util.modeler.level=WARN
logger.org.apache.tomcat.util.modeler.useParentHandlers=true
logger.sun.rmi.level=WARN
logger.sun.rmi.useParentHandlers=true
logger.jacorb.config.level=ERROR
logger.jacorb.config.useParentHandlers=true
handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
handler.CONSOLE.level=INFO
handler.CONSOLE.formatter=COLOR-PATTERN
handler.CONSOLE.properties=autoFlush,target
handler.CONSOLE.autoFlush=true
handler.CONSOLE.target=SYSTEM_OUT
formatter.COLOR-PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.COLOR-PATTERN.properties=pattern
formatter.COLOR-PATTERN.pattern=%K{level}%d{HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%E%n
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment