Skip to content

Commit

Permalink
BVTCK-23 Removing todos in docboc sources. Updating runner examples t…
Browse files Browse the repository at this point in the history
…o use Glassfish. Adding new readme in setup-example directory
  • Loading branch information
hferentschik committed Apr 10, 2013
1 parent 354beaf commit 1bb6b96
Show file tree
Hide file tree
Showing 16 changed files with 103 additions and 173 deletions.
6 changes: 3 additions & 3 deletions documentation/src/main/docbook/en-US/configuration.xml
Expand Up @@ -23,7 +23,7 @@
for running the TCK. If you followed the instructions in <xref
linkend="installation"/> you find the directory under
<filename>jsr349/tck/setup-examples</filename>. Both setups are using
Hibernate Validator as Bean Validation Provider and JBoss AS 7 as EE
Hibernate Validator as Bean Validation Provider and Glassfish 4 as EE
constainer. However, one is using <ulink
url="http://maven.apache.org/">Maven</ulink> as build tool to run the TCK,
the other <ulink url="http://ant.apache.org/">Ant</ulink>. Depending which
Expand All @@ -32,8 +32,8 @@

<para>Each example comes with a <filename>readme.md</filename> containing
the prerequisites for using this setup, how to run the TCK against
Hibernate Validator and JBoss AS and what needs to be changed to use a
different Bean Validation provider and EE container.</para>
Hibernate Validator and Glassfish. The read and what needs to be changed
to use a different Bean Validation provider and EE container.</para>

<para>The following chapters contain some more information about the
general structure of the TCK which will give you a deeper understanding
Expand Down
11 changes: 6 additions & 5 deletions documentation/src/main/docbook/en-US/installation.xml
Expand Up @@ -21,16 +21,17 @@
is distributed as a ZIP file, which contains the TCK artifacts (the test
suite binary and source, the test suite descriptor, the audit source and
report), the TCK library dependencies in <code>/lib</code> and
documentation in <code>/doc</code>. The contents should look like (todo -
verify against final dist bundle):</para>
documentation in <code>/doc</code>. The contents should look like:</para>

<para><programlisting>artifacts/
changelog.txt
docs/
lib/
license.txt
src/</programlisting>You can also download the source code from GitHub -
<ulink
setup-examples/
src/
readme.md
</programlisting>You can also download the source code from GitHub - <ulink
url="https://github.com/beanvalidation/beanvalidation-tck">https://github.com/beanvalidation/beanvalidation-tck</ulink>.</para>

<para>The &jsrVersion; reference implementation (RI) project is named
Expand Down Expand Up @@ -58,7 +59,7 @@ src/</programlisting>You can also download the source code from GitHub -
</listitem>

<listitem>
<para>Java EE 7 or better (e.g., JBoss AS 7.x)</para>
<para>Java EE 7 or better (e.g. Glassfish 4)</para>
</listitem>
</itemizedlist>

Expand Down
8 changes: 4 additions & 4 deletions documentation/src/main/docbook/en-US/introduction.xml
Expand Up @@ -111,7 +111,8 @@
developer productivity. However, an implementation is only valid if all
tests pass using the in-container execution mode. The standalone mode is
merely a developer convenience.<note>
<para>TODO - explain the reason for this - BV part of EE</para>
<para>The reason the Bean Validation TCK must pass running in a EE
container is that Bean Validation is part of Java EE 7 itself.</para>
</note></para>

<section>
Expand Down Expand Up @@ -145,9 +146,8 @@
<para><emphasis role="bold">Reference runtime</emphasis> - The
designated reference runtimes for compatibility testing of the Bean
Validation specification is the Sun Java Platform, Enterprise
Edition (Java EE) 7 reference implementation (RI). See details at
<ulink url="http://java.sun.com/javaee/7/docs/api/">Java EE
7</ulink> (todo - check link)</para>
Edition (Java EE) 7 reference implementation (RI), aka Glassfish
4.</para>
</listitem>
</itemizedlist>
</section>
Expand Down
6 changes: 3 additions & 3 deletions documentation/src/main/docbook/en-US/tck.ent
Expand Up @@ -3,7 +3,7 @@
<!ENTITY copyrightYear "2009 - 2013">
<!ENTITY copyrightHolder "Red Hat, Inc.">
<!ENTITY jsrVersion "JSR 349">
<!ENTITY validationApi "1.1.0.CR3">
<!ENTITY referenceImplVersion "5.0.0.CR4">
<!ENTITY tckVersion "1.1.0.CR4">
<!ENTITY validationApi "1.1.0.Final">
<!ENTITY referenceImplVersion "5.0.0.Final">
<!ENTITY tckVersion "1.1.0.Final">

1 change: 0 additions & 1 deletion setup-examples/ant/.gitignore
@@ -1,4 +1,3 @@
.ivy
.lib
user-build.properties

7 changes: 3 additions & 4 deletions setup-examples/ant/build.properties
@@ -1,5 +1,5 @@
# location of container to run tests in
container.home=/opt/java/jboss-as-7.1.1.Final
container.home=/opt/java/glassfish4

# fully qualified class name of the Bean Validation provider under test
validation.provider=org.hibernate.validator.HibernateValidator
Expand All @@ -10,6 +10,5 @@ tck.suite.file=beanvalidation-tck-tests-suite.xml
# define versions of used dependencies
version.arquillian=1.0.2.Final
version.testng=6.8
version.jbossas=7.1.1.Final
version.hv=5.0.0.CR4
version.tck=1.1.0.CR4
version.hv=5.0.0.Final
version.tck=1.1.0.Final
32 changes: 15 additions & 17 deletions setup-examples/ant/build.xml
Expand Up @@ -5,9 +5,6 @@
<!-- Build environment properties -->
<!-- ====================================================================== -->

<!-- Allow the user to override values in build.properties. Ignored via .gitignore -->
<property file="user-build.properties"/>

<!-- Defines build specific properties -->
<property file="build.properties"/>

Expand Down Expand Up @@ -92,8 +89,7 @@
<copy todir="${project.testResource.outputDirectory}">
<fileset dir="${project.testResource.directory}"/>
<filterset>
<filter token="JBOSS.HOME" value="${container.home}"/>
<filter token="VALIDATION.PROVIDER" value="${validation.provider}"/>
<filter token="CONTAINER.HOME" value="${container.home}"/>
</filterset>
</copy>
</target>
Expand All @@ -109,23 +105,25 @@
</path>
<testng classpathref="test.path"
outputDir="${project.test.reportsOutputDirectory}"
haltOnfailure="true">
haltOnfailure="false">
<xmlfileset dir="${project.build.directory}" includes="${tck.suite.file}"/>
<jvmarg value="-Xmx1024m"/>
<jvmarg value="-Xmx1024m"/>

<!-- Uncomment for remote debugging -->
<!--
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=NONE"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>
-->

<!-- Container qualifier used in arquillian.xml -->
<sysproperty key="arquillian.launch" value="incontainer"/>
<!-- Specify the Bean Validation provider under test -->
<sysproperty key="validation.provider" value="${validation.provider}"/>
</testng>
</target>

<!-- ====================================================================== -->
<!-- Dependency reports -->
<!-- ====================================================================== -->

<target name="dependency-report" depends="init">
<ivy:resolve conf="test-incontainer"/>
<ivy:report todir="${project.build.directory}/dependency-reports/test-jbossas7"
conf="test-incontainer"/>
<!-- Uncomment to skip integration tests -->
<!-- <sysproperty key="excludeIntegrationTests" value="true"/> -->
</testng>
</target>
</project>
3 changes: 2 additions & 1 deletion setup-examples/ant/ivy.xml
Expand Up @@ -22,6 +22,7 @@

<!-- The Arquillian container adapter for the container under test. Specific to the container in which to run the tests -->
<dependency org="org.hibernate" name="hibernate-validator" rev="${version.hv}" conf="test->default(*)"/>
<dependency org="org.jboss.as" name="jboss-as-arquillian-container-managed" rev="${version.jbossas}" conf="test-incontainer->default(*)"/>
<dependency org="org.jboss.spec" name="jboss-javaee-6.0" rev="1.0.0.Final" conf="test->default(*)"/>
<dependency org="org.jboss.arquillian.container" name="arquillian-glassfish-managed-3.1" rev="1.0.0.Final-SNAPSHOT" conf="test-incontainer->default(*)"/>
</dependencies>
</ivy-module>
41 changes: 12 additions & 29 deletions setup-examples/ant/readme.md
@@ -1,26 +1,26 @@
# Ant + Ivy setup example to run the JSR-349 TCK

This is an example setup to run the Bean Validation TCK 1.1 against JBoss AS 7 using
[Ant](https://ant.apache.org) + [Ivy](http://ant.apache.org/ivy/) as build environment.
This is an example setup to run the Bean Validation TCK 1.1 against Glassfish 4 (the Java EE 7 reference implementation)
using [Ant](https://ant.apache.org) + [Ivy](http://ant.apache.org/ivy/) as build environment.

## Prerequisites

* [Git](http://git-scm.com/)
* [Ant](https://ant.apache.org) >= 1.8
* A EE container to run the tests in. The container must provide all Bean Validation dependencies, namely the BeanValidation API
as well as the Bean Validation provider. The latter is the so called Bean Validation provider under test.
This setup uses JBoss AS 7 as EE container, but can be easily modified to run against another container.
* [JDK 7](http://jdk7.java.net)
* [Glassfish 4](http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted/)

## How to run

1. Get the code:
1. Extract Glassfish into a directory (this directory is referenced subsequently as <container.home>)
1. Add the JVM option _validation.provider_ to _domain.xml_ under <container.home>/glassfish/domains/domain1/config in
the <java-config> section (this is used by the test harness to look up the Bean Validation provider under test):

git clone git://github.com/beanvalidation/beanvalidation-tck.git
1. Change into the ant example directory:

cd setup-examples/ant
1. Make sure that _container.home_ in _build.properties_ points to your container home directory. You can create a _user-build.properties_ file
and override the variable _container.home_ in there. _user-build.properties_ is ignored via _.gitignore_
<java-config>
...
<jvm-options>-Dvalidation.provider=org.hibernate.validator.HibernateValidator</jvm-options>
</java-config>
1. Make sure that _container.home_ in _build.properties_ points to your <container.home> directory
1. Run once:

ant install-testng-jar
Expand All @@ -42,26 +42,9 @@ Ivy is used to download all the required dependencies. The following files are i

* _build.xml_ - The main Ant build file. Bootstraps Ivy, downloads dependencies, copy resources and runs the tests
* _build.properties_ - Defines properties for the build. Location of the app server, dependency versions, etc
* _user-build.properties_ - Allows to override properties in _build.properties_

### Arquillian

* _arquillian.xml_ - Arquillian configuration file. Defines container protocol and settings
* _log4j.xml_ - Configure the logging framework

## How to adjust for other containers

To adjust the build script to another container, for example Glassfish, you would have to

* Change the Arquillian container adapter in _ivy.xml_ to use the adapter suitable for your container
(see [container adapters](https://docs.jboss.org/author/display/ARQ/Container+adapters)). If there is no such adapter
you have to write your own. You can look at the [standalone container adapter](https://github.com/beanvalidation/beanvalidation-tck/tree/master/standalone-container-adapter)
provided by this TCK in order to run test in the current JVM. It is a simple version of a container adapter, but still
contains all the required pieces.
* Change the _container.home_ property in _build.properties_ to point to your container
* Change _validation.provider_ in _build.properties_ to the fully qualified class name of your Bean Validation provider
* Update the container information in _arquillian.xml_ to contain the required settings for your container




8 changes: 4 additions & 4 deletions setup-examples/ant/src/test/resources/arquillian.xml
Expand Up @@ -32,11 +32,11 @@
</engine>

<container qualifier="incontainer" default="true">
<protocol type="Servlet 3.0"/>
<configuration>
<property name="jbossHome">@JBOSS.HOME@</property>
<property name="javaVmArguments">-Xmx1024m -XX:MaxPermSize=512m -Dvalidation.provider=@VALIDATION.PROVIDER@</property>
<property name="allowConnectingToRunningServer">true</property>
<property name="glassFishHome">@CONTAINER.HOME@</property>
<property name="adminHost">localhost</property>
<property name="adminPort">4848</property>
<property name="debug">true</property>
</configuration>
</container>

Expand Down
23 changes: 0 additions & 23 deletions setup-examples/ant/src/test/resources/log4j.xml

This file was deleted.

15 changes: 7 additions & 8 deletions setup-examples/maven/pom.xml
Expand Up @@ -12,14 +12,13 @@
<description>Aggregates dependencies and runs the JSR-303 TCK</description>

<properties>
<tck.version>1.1.0.CR4</tck.version>
<tck.version>1.1.0.Final</tck.version>
<tck.suite.file>${project.build.directory}/dependency/beanvalidation-tck-tests-suite.xml</tck.suite.file>
<arquillian.version>1.0.0.Final</arquillian.version>

<jbossas.version>7.1.1.Final</jbossas.version>
<container.home>/opt/java/jboss-as</container.home>
<container.home>/opt/java/glassfish4</container.home>

<hv.version>5.0.0.CR4</hv.version>
<hv.version>5.0.0.Final</hv.version>
<validation.provider>org.hibernate.validator.HibernateValidator</validation.provider>
</properties>

Expand Down Expand Up @@ -52,9 +51,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<version>${jbossas.version}</version>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-managed-3.1</artifactId>
<version>1.0.0.Final-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -105,7 +104,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<argLine>-Xmx1024m -Djava.util.logging.manager=org.jboss.logmanager.LogManager</argLine>
<argLine>-Xmx1024m</argLine>
<forkMode>once</forkMode>
<suiteXmlFiles>
<suiteXmlFile>${tck.suite.file}</suiteXmlFile>
Expand Down
41 changes: 12 additions & 29 deletions setup-examples/maven/readme.md
@@ -1,44 +1,27 @@
# Maven setup example to run the JSR-349 TCK

This is an example setup to run the Bean Validation TCK 1.1 against JBoss AS 7 using [Maven](https://maven.apache.org).
This is an example setup to run the Bean Validation TCK 1.1 against Glassfish 4 using [Maven](https://maven.apache.org).

## Prerequisites

* [Git](http://git-scm.com/)
* [Git](http://git-scm.com)
* [Maven](https://maven.apache.org) >= 3.0.4
* A EE container to run the tests in. The container must provide all Bean Validation dependencies, namely the BeanValidation API
as well as the Bean Validation provider. The latter is the so called Bean Validation provider under test.
This setup uses JBoss AS 7 as EE container, but can be easily modified to run against another container.
* [JDK 7](http://jdk7.java.net)
* [Glassfish 4](http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted) installation

## How to run

1. Get the code:
1. Extract Glassfish into a directory (this directory is referenced subsequently as <container.home>)
1. Add the JVM option _validation.provider_ to _domain.xml_ under <container.home>/glassfish/domains/domain1/config in
the <java-config> section (this is used by the test harness to look up the Bean Validation provider under test):

git clone git://github.com/beanvalidation/beanvalidation-tck.git
1. Change into the maven example directory:

cd setup-examples/maven
1. Make sure that _container.home_ in _pom.xml_ points to your container home directory. You can also specify this property on
the command line via _-Dcontainer.home=\<path to container\>_
<java-config>
...
<jvm-options>-Dvalidation.provider=org.hibernate.validator.HibernateValidator</jvm-options>
</java-config>
1. Make sure that _container.home_ in _pom.xml_ points to your <container.home> directory
1. Run the TCK tests:

mvn test
1. Test results can be found in _target/surefire-reports/index.html_

## How to adjust for other containers

To adjust the build script to another container, for example Glassfish, you would have to

* Change the Arquillian container adapter dependency (_org.jboss.as:jboss-as-arquillian-container-managed_) to use
the adapter suitable for your container (see [container adapters](https://docs.jboss.org/author/display/ARQ/Container+adapters)).
If there is no such adapter you have to write your own. You can look at the
[standalone container adapter](https://github.com/beanvalidation/beanvalidation-tck/tree/master/standalone-container-adapter) provided
by this TCK in order to run test in the current JVM. It is a simple version of a container adapter, but still contains all
the required pieces.
* Change the _container.home_ property in _pom.xml_ to point to your container
* Change _validation.provider_ in _build.properties_ to the fully qualified classname of your Bean Validation provider
* Update the container information in _arquillian.xml_ to contain the required settings for your container




11 changes: 5 additions & 6 deletions setup-examples/maven/src/test/resources/arquillian.xml
Expand Up @@ -26,19 +26,18 @@
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<!-- Need to set the default protocol and use resource filtering, because of https://issues.jboss.org/browse/ARQ-579 -->
<defaultProtocol type="Servlet 3.0"/>

<engine>
<property name="deploymentExportPath">target/artifacts</property>
</engine>

<container qualifier="incontainer">
<protocol type="Servlet 3.0"/> <!-- Takes no effect - ARQ-579 -->
<container qualifier="incontainer" default="true">
<configuration>
<property name="jbossHome">${container.home}</property>
<property name="javaVmArguments">-Xmx1024m -XX:MaxPermSize=512m -Dvalidation.provider=${validation.provider}</property>
<property name="allowConnectingToRunningServer">true</property>
<property name="glassFishHome">${container.home}</property>
<property name="adminHost">localhost</property>
<property name="adminPort">4848</property>
<property name="debug">true</property>
</configuration>
</container>

Expand Down

0 comments on commit 1bb6b96

Please sign in to comment.