Skip to content

Commit

Permalink
[HWKMETRICS-185] Create a separate module for JAX-RS 1.1 integration …
Browse files Browse the repository at this point in the history
…tests.
  • Loading branch information
Stefan Negrea committed Aug 13, 2015
1 parent 20c8978 commit ab91645
Show file tree
Hide file tree
Showing 9 changed files with 951 additions and 9 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@
<module>core/metrics-core-impl</module>
<module>api/metrics-api-common</module>
<module>api/metrics-api-jaxrs</module>
<module>api/metrics-api-jaxrs-1.1</module>
<module>rest-tests</module>
<module>api/metrics-api-jaxrs-1.1</module>
<module>tests/rest-integration-tests-jaxrs-1.1</module>
<module>clients</module>
<module>containers</module>
<module>load-tests</module>
Expand Down
21 changes: 13 additions & 8 deletions rest-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@
<type>war</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>hawkular-metrics-api-jaxrs-1.1</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down Expand Up @@ -108,6 +101,18 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down Expand Up @@ -208,7 +213,7 @@
</goals>
<configuration>
<groupId>${project.groupId}</groupId>
<artifactId>hawkular-metrics-api-jaxrs-1.1</artifactId>
<artifactId>hawkular-metrics-api-jaxrs</artifactId>
<name>hawkular-metric-rest.war</name>
</configuration>
</execution>
Expand Down
297 changes: 297 additions & 0 deletions tests/rest-integration-tests-jaxrs-1.1/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
and other contributors as indicated by the @author tags.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.hawkular.metrics</groupId>
<artifactId>hawkular-metrics-parent</artifactId>
<version>0.6.0-SNAPSHOT</version>
</parent>

<artifactId>hawkular-metrics-rest-integration-tests-jax-rs-1.1</artifactId>

<name>Hawkular Metrics - Rest Integration Tests for JAX-RS 1.1</name>

<properties>
<cassandra.keyspace>hawkular_metrics_rest_tests</cassandra.keyspace>
<scheduler.units>seconds</scheduler.units>
<enforcer.skip>true</enforcer.skip>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>hawkular-metrics-core-impl</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.3.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>hawkular-metrics-api-jaxrs-1.1</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>hawkular-metrics-rest-tests</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda.time.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<version>0.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
<version>1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<scope>test</scope>
</dependency>
<!-- commons-io required by resteasy-client -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<id>eap_6_early_access</id>
<url>https://maven.repository.redhat.com/earlyaccess/all/</url>
</repository>
</repositories>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>

</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>test.debug</id>
<activation>
<property>
<name>test.debug</name>
</property>
</activation>
<properties>
<!-- See: http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#debugForkedProcess -->
<maven.surefire.debug>-Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,address=8797,server=y,suspend=y</maven.surefire.debug>
</properties>
</profile>

<profile>
<id>rest-tests-integration-tests</id>
<activation>
<property>
<name>!skipTests</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<dependenciesToScan>
<dependency>${project.groupId}:hawkular-metrics-rest-tests</dependency>
</dependenciesToScan>
<excludes>
<exclude>**/*Influx*</exclude>
</excludes>
<includes>
<include>**/*ITest*</include>
</includes>
<systemPropertyVariables>
<keyspace>${cassandra.keyspace}</keyspace>
<hawkular-metrics.base-uri>${base-uri}</hawkular-metrics.base-uri>
<project.version>${project.version}</project.version>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.7.Final</version>
<configuration>
<version>7.5.0.Final-redhat-15</version>
</configuration>
<executions>
<execution>
<id>start-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<javaOpts>
<javaOpt>-Xms64m</javaOpt>
<javaOpt>-Xmx512m</javaOpt>
<javaOpt>-Xss256k</javaOpt>
<javaOpt>-Djava.net.preferIPv4Stack=true</javaOpt>
<javaOpt>-Dsun.rmi.dgc.client.gcInterval=3600000</javaOpt>
<javaOpt>-Dsun.rmi.dgc.server.gcInterval=3600000</javaOpt>
<javaOpt>-Djboss.socket.binding.port-offset=${wildfly.port.offset}</javaOpt>
<javaOpt>-Dcassandra.keyspace=${cassandra.keyspace}</javaOpt>
<javaOpt>-Dcassandra.resetdb</javaOpt>
<javaOpt>-Dhawkular.metrics.waitForService</javaOpt>
<javaOpt>-Dhawkular.scheduler.time-units=${scheduler.units}</javaOpt>
<javaOpt>-Xdebug</javaOpt>
<javaOpt>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787</javaOpt>
</javaOpts>
</configuration>
</execution>
<execution>
<id>deploy-webapp</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy-artifact</goal>
</goals>
<configuration>
<groupId>${project.groupId}</groupId>
<artifactId>hawkular-metrics-api-jaxrs-1.1</artifactId>
<name>hawkular-metric-rest.war</name>
</configuration>
</execution>
<execution>
<id>stop-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>wildfly.deployment</id>
<activation>
<property>
<name>!running.service</name>
</property>
</activation>
<properties>
<wildfly-maven-plugin.skip>false</wildfly-maven-plugin.skip>
<!-- IMPORTANT: The port must be the port offset + 8080. -->
<base-uri>127.0.0.1:8080/hawkular/metrics</base-uri>
<wildfly.port.offset>47897</wildfly.port.offset>
<!-- IMPORTANT: The management port must be the port offset + 9990. -->
<wildfly.management.port>57887</wildfly.management.port>
<wildfly.logging.console.level>ERROR</wildfly.logging.console.level>
<wildfly.logging.file.level>DEBUG</wildfly.logging.file.level>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-standalone-test</id>
<phase>process-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!--
We cannot specify an arbitrary path to standalone-test.xml, so we include the necessary
configuration files and override the default configuration directory. See
https://issues.jboss.org/browse/JBASMP-75 for details.
-->
<outputDirectory>${project.build.directory}/wildfly-configuration</outputDirectory>
<overwrite>true</overwrite>
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>@@@</delimiter>
</delimiters>
<resources>
<resource>
<directory>${project.basedir}/src/test/wildfly-configuration</directory>
<includes>
<include>*</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# Properties declaration of users roles for the realm 'ApplicationRealm' which is the default realm
# for application services on a new installation.
#
# This includes the following protocols: remote ejb, remote jndi, web, remote jms
#
# Users can be added to this properties file at any time, updates after the server has started
# will be automatically detected.
#
# The format of this file is as follows: -
# username=role1,role2,role3
#
# A utility script is provided which can be executed from the bin folder to add the users: -
# - Linux
# bin/add-user.sh
#
# - Windows
# bin\add-user.bat
#
# The following illustrates how an admin user could be defined.
#
#admin=PowerUser,BillingAdmin,
#guest=guest

0 comments on commit ab91645

Please sign in to comment.