Author: dan.j.allen
Date: 2010-06-11 18:48:12 -0400 (Fri, 11 Jun 2010)
New Revision: 13127
Added:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Booking_.java
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Hotel_.java
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/User_.java
examples/trunk/booking-simplified/src/test/
examples/trunk/booking-simplified/src/test/java/
examples/trunk/booking-simplified/src/test/java/org/
examples/trunk/booking-simplified/src/test/java/org/jboss/
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/inventory/
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTestCase.java
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/MavenArtifactResolver.java
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/NoOpLogger.java
examples/trunk/booking-simplified/src/test/resources-glassfish/
examples/trunk/booking-simplified/src/test/resources-glassfish/sun-resources.xml
examples/trunk/booking-simplified/src/test/resources-jbossas/
examples/trunk/booking-simplified/src/test/resources-jbossas/jndi.properties
examples/trunk/booking-simplified/src/test/resources/
examples/trunk/booking-simplified/src/test/resources/arquillian.xml
Modified:
examples/trunk/booking-simplified/pom.xml
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearch.java
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Hotel.java
examples/trunk/booking-simplified/src/main/resources/META-INF/persistence.xml
examples/trunk/booking-simplified/src/main/webapp/WEB-INF/
Log:
add Arquillian infrastructure
add test for hotel search
add JPA 2 metamodel classes
use criteria query for hotel search
Modified: examples/trunk/booking-simplified/pom.xml
===================================================================
--- examples/trunk/booking-simplified/pom.xml 2010-06-11 16:54:52 UTC (rev 13126)
+++ examples/trunk/booking-simplified/pom.xml 2010-06-11 22:48:12 UTC (rev 13127)
@@ -14,7 +14,7 @@
<packaging>war</packaging>
<name>Seam Booking Example (Simplified packaging)</name>
<description>The Seam booking example packaged using the simplified Java EE
packaging</description>
- <
url>http://www.seamframework.org/Seam3</url>
+ <
url>http://seamframework.org/Seam3</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
@@ -24,23 +24,18 @@
</licenses>
<properties>
- <jetty.http.port>9090</jetty.http.port>
- <jetty.stop.port>9091</jetty.stop.port>
- <jetty.debug.port>9190</jetty.debug.port>
- <jetty.daemon>false</jetty.daemon>
- <tomcat.http.port>6060</tomcat.http.port>
- <embedded-tomcat.http.port>9090</embedded-tomcat.http.port>
- <embedded-tomcat.debug.port>9190</embedded-tomcat.debug.port>
<webapp.directory>src/main/webapp</webapp.directory>
+ <jboss.home>${env.JBOSS_HOME}</jboss.home>
+ <jboss.domain>default</jboss.domain>
+ <arquillian.version>1.0.0-SNAPSHOT</arquillian.version>
</properties>
<dependencies>
<dependency>
- <groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee-6.0</artifactId>
- <version>1.0.0.Beta4</version>
- <type>pom</type>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-jpamodelgen</artifactId>
+ <version>1.0.0.Final</version>
<scope>provided</scope>
</dependency>
@@ -67,19 +62,29 @@
<artifactId>slf4j-api</artifactId>
<version>1.5.10</version>
</dependency>
+
+ <!--
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.5.10</version>
</dependency>
+ -->
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
<scope>test</scope>
- <classifier>jdk15</classifier>
</dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-junit</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
@@ -88,21 +93,13 @@
<plugins>
<plugin>
- <artifactId>maven-clean-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <failOnError>false</failOnError>
- <filesets>
- <fileset>
- <!-- clean up files from war:inplace -->
- <directory>${webapp.directory}</directory>
- <includes>
- <include>META-INF/**</include>
- <include>WEB-INF/classes/**</include>
- <include>WEB-INF/lib/**</include>
- </includes>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
+ <source>1.6</source>
+ <target>1.6</target>
+ <!-- don't waste time on generation -->
+ <compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
@@ -134,58 +131,46 @@
</file>
</additionalConfig>
<additionalProjectFacets>
- <jst.jsf>1.2</jst.jsf> <!-- 2.0 is not yet supported
-->
+ <jst.jsf>2.0</jst.jsf>
</additionalProjectFacets>
<additionalProjectnatures>
<projectnature>org.eclipse.wst.jsdt.core.jsNature</projectnature>
<projectnature>org.jboss.tools.jsf.jsfnature</projectnature>
</additionalProjectnatures>
<workspace>${user.home}/.eclipse/workspace</workspace>
- <wtpdefaultserver>JBoss</wtpdefaultserver>
- <wtpversion>1.5</wtpversion>
+ <wtpdefaultserver>JBossAS</wtpdefaultserver>
+ <wtpversion>2.0</wtpversion>
+ <!--
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>true</downloadJavadocs>
+ -->
</configuration>
</plugin>
+ <!-- Configure the JBoss AS Maven deploy plugin -->
<plugin>
- <artifactId>maven-war-plugin</artifactId>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-maven-plugin</artifactId>
<configuration>
- <!--
- don't stage or package files added to
- ${webapp.directory} by war:inplace
- -->
-
<warSourceExcludes>WEB-INF/classes/**,WEB-INF/lib/**</warSourceExcludes>
+ <jbossHome>${jboss.home}</jbossHome>
+ <serverName>${jboss.domain}</serverName>
+ <fileNames>
+
<fileName>${project.build.directory}/${project.build.finalName}.war</fileName>
+ </fileNames>
</configuration>
</plugin>
+ <!-- Configure the Embedded GlassFish Maven plugin -->
<plugin>
- <groupId>org.twdata.maven</groupId>
- <artifactId>maven-cli-plugin</artifactId>
+ <groupId>org.glassfish</groupId>
+ <artifactId>maven-embedded-glassfish-plugin</artifactId>
+ <version>3.0</version>
<configuration>
- <prompt>${project.artifactId}</prompt>
- <!-- userAliases are for cli:execute-phase -->
- <userAliases>
- <runjetty>compile
- org.mortbay.jetty:maven-jetty-plugin:run -Pjetty</runjetty>
- <stopjetty>org.mortbay.jetty:maven-jetty-plugin:stop
- -Pjetty</stopjetty>
- <runtomcat>compile
- org.apache.maven.plugins:maven-war-plugin:inplace
- org.codehaus.mojo:tomcat-maven-plugin:run
-Ptomcat</runtomcat>
- <explode>compile -o</explode>
- <!-- tomcat requires use of war:inplace -->
- <tcexplode>compile
- org.apache.maven.plugins:maven-war-plugin:inplace
- -Ptomcat -o</tcexplode>
- <restart>org.apache.maven.plugins:maven-antrun-plugin:run
- -Prestart-embedded</restart>
-
<profiles>org.apache.maven.plugins:maven-help-plugin:active-profiles
- -o</profiles>
- <pom>org.apache.maven.plugins:maven-help-plugin:effective-pom
- -o</pom>
- </userAliases>
- <!-- commands are for cli:execute -->
- <commands>
- </commands>
+
<app>${project.build.directory}/${project.build.finalName}.war</app>
+ <port>7070</port>
+ <containerType>web</containerType>
+
<instanceRoot>${project.build.directory}/gfembed${maven.build.timestamp}</instanceRoot>
+ <autoDelete>true</autoDelete>
</configuration>
</plugin>
@@ -194,363 +179,119 @@
<profiles>
<profile>
- <id>tomcat</id>
-
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
<dependencies>
-
<dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <version>1.0.0.Beta4</version>
+ <type>pom</type>
+ <scope>provided</scope>
</dependency>
-
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>4.0.0.GA</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.weld.servlet</groupId>
- <artifactId>weld-servlet</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.web</groupId>
- <artifactId>el-impl</artifactId>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
</dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>src/log/resources</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <directory>src/main/webapp-tomcat</directory>
- <filtering>false</filtering>
- </resource>
- </webResources>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>tomcat-maven-plugin</artifactId>
- <configuration>
- <path>/${project.build.finalName}</path>
- <!--
- uncomment to use server configuration override;
- see readme.txt for details
- -->
- <!--<server>tomcatserver</server>-->
- <url>http://localhost:${tomcat.http.port}/manager</url>
- <port>${embedded-tomcat.http.port}</port>
- <!--
- port for embedded Tomcat only (putting this
- configuration in the execution for the run goal
- doesn't work)
- -->
- <!--
- this isn't useful to us because we also need an
- web.xml override
- -->
- <!--
-
<contextFile>src/main/webapp-tomcat/META-INF/context.xml</contextFile>
- -->
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
</profile>
<profile>
- <id>jetty</id>
-
+ <id>jbossas-remote-60</id>
<dependencies>
- <!-- (same dependencies as tomcat except for javax.servlet:jstl) -->
-
<dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-jbossas-remote-60</artifactId>
+ <version>${arquillian.version}</version>
+ <scope>test</scope>
</dependency>
-
<dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <version>1.0.0.Beta4</version>
+ <type>pom</type>
+ <scope>provided</scope>
</dependency>
-
+ <!-- need for org.jnp.interfaces.NamingContextFactory -->
<dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <scope>runtime</scope>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-client</artifactId>
+ <version>6.0.0.20100216-M2</version>
+ <type>pom</type>
+ <scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>4.0.0.GA</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-jdk14</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.weld.servlet</groupId>
- <artifactId>weld-servlet</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.glassfish.web</groupId>
- <artifactId>el-impl</artifactId>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
</dependencies>
-
<build>
- <resources>
- <resource>
- <directory>src/log/resources</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <configuration>
- <connectors>
- <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>${jetty.http.port}</port>
- <maxIdleTime>3600000</maxIdleTime>
- </connector>
- </connectors>
- <daemon>${jetty.daemon}</daemon>
- <stopPort>${jetty.stop.port}</stopPort>
- <stopKey>HASTA_LA_VISTA</stopKey>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <contextPath>/${project.build.finalName}</contextPath>
-
<overrideWebXml>src/main/webapp-jetty/WEB-INF/override-web.xml</overrideWebXml>
-
<jettyEnvXml>src/main/webapp-jetty/WEB-INF/jetty-env.xml</jettyEnvXml>
- </configuration>
- </plugin>
- </plugins>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources-jbossas</directory>
+ </testResource>
+ </testResources>
</build>
-
</profile>
- <profile>
- <id>ftest-jboss-remote-51</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <ftest.artifact>ftest-permalink</ftest.artifact>
- <ftest.version>0.1${ftest.version.discriminator}</ftest.version>
- </properties>
-
+ <profile>
+ <id>glassfish-embedded-30</id>
<dependencies>
<dependency>
- <groupId>org.jboss.weld.examples.ftest</groupId>
- <artifactId>${ftest.artifact}</artifactId>
- <version>${ftest.version}</version>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-glassfish-embedded-30</artifactId>
+ <version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.glassfish.extras</groupId>
+ <artifactId>glassfish-embedded-all</artifactId>
+ <version>3.0.1-b02</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
-
<build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>failsafe-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
- </plugins>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources-glassfish</directory>
+ </testResource>
+ </testResources>
</build>
</profile>
- <profile>
- <id>ftest-jboss-remote-60</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <ftest.artifact>ftest-permalink</ftest.artifact>
- <ftest.version>0.1${ftest.version.discriminator}</ftest.version>
- </properties>
-
+ <profile>
+ <id>glassfish-remote-jsr88</id>
<dependencies>
<dependency>
- <groupId>org.jboss.weld.examples.ftest</groupId>
- <artifactId>${ftest.artifact}</artifactId>
- <version>${ftest.version}</version>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-glassfish-remote-jsr88</artifactId>
+ <version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.glassfish.extras</groupId>
+ <artifactId>glassfish-embedded-all</artifactId>
+ <version>3.0.1-b02</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
-
<build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>failsafe-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
- </plugins>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources-glassfish</directory>
+ </testResource>
+ </testResources>
</build>
</profile>
-
- <profile>
- <id>restart-embedded</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <configuration>
- <tasks>
- <touch file="${webapp.directory}/WEB-INF/web.xml"
/>
- </tasks>
- </configuration>
- <!-- Hooking an execution to a phase is more correct, but slower
-->
- <!--
- <executions> <execution>
<id>touch-web-inf</id>
- <phase>validate</phase> <configuration>
<tasks>
- <touch file="${webapp.directory}/WEB-INF/web.xml" />
</tasks> </configuration> <goals>
- <goal>run</goal> </goals> </execution>
- </executions>
- -->
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
<scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/weld/examples/trunk/...
-
<
developerConnection>scm:svn:https://svn.jboss.org/repos/weld/examples/...
-
<
url>http://fisheye.jboss.org/browse/weld/examples/trunk/jsf/permalink&...
- </scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/seam/examples/trunk/...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/seam/examples/...
+
<
url>http://fisheye.jboss.org/browse/seam/examples/trunk/booking-simpli...
+ </scm>
</project>
Modified:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearch.java
===================================================================
---
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearch.java 2010-06-11
16:54:52 UTC (rev 13126)
+++
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearch.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -30,17 +30,15 @@
@Local
public interface HotelSearch
{
- public void find();
+ void find();
- public void previousPage();
+ void previousPage();
- public void nextPage();
+ void nextPage();
- public List<Hotel> getHotels();
+ List<Hotel> getHotels();
- public boolean isNextPageAvailable();
+ boolean isNextPageAvailable();
- public boolean isPreviousPageAvailable();
-
- public void destroy();
+ boolean isPreviousPageAvailable();
}
Modified:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java
===================================================================
---
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java 2010-06-11
16:54:52 UTC (rev 13126)
+++
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/HotelSearchBean.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -26,7 +26,6 @@
import java.util.ArrayList;
import java.util.List;
-import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
@@ -34,9 +33,16 @@
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Root;
import org.jboss.seam.examples.booking.model.Hotel;
+import org.jboss.seam.examples.booking.model.Hotel_;
+import org.jboss.seam.international.status.MessageFactory;
import org.slf4j.Logger;
+//import org.jboss.seam.international.status.MessageFactory;
+//import org.slf4j.Logger;
@Named("hotelSearch")
@Stateful
@@ -49,6 +55,8 @@
@Inject private SearchCriteria criteria;
+ @Inject private MessageFactory mf;
+
private boolean nextPageAvailable = false;
private List<Hotel> hotels = new ArrayList<Hotel>();
@@ -90,27 +98,36 @@
return criteria.getPage() > 0;
}
- @Remove
- public void destroy()
- {
- }
-
private void queryHotels(SearchCriteria criteria)
{
- List<Hotel> results = em.createQuery(
- "select h from Hotel h where lower(h.name) like :pattern or lower(h.city)
like :pattern or lower(h.zip) like :pattern or lower(h.address) like :pattern").
- setParameter("pattern",
criteria.getSearchPattern()).setMaxResults(criteria.getPageSize() +
1).setFirstResult(criteria.getPage() * criteria.getPageSize()).
- getResultList();
+ CriteriaBuilder builder = em.getCriteriaBuilder();
+ CriteriaQuery<Hotel> cquery = builder.createQuery(Hotel.class);
+ Root<Hotel> hotel = cquery.from(Hotel.class);
+ // QUESTION can like create the pattern for us?
+ cquery.select(hotel)
+ .where(builder.or(
+ builder.like(builder.lower(hotel.get(Hotel_.name)),
criteria.getSearchPattern()),
+ builder.like(builder.lower(hotel.get(Hotel_.city)),
criteria.getSearchPattern()),
+ builder.like(builder.lower(hotel.get(Hotel_.zip)),
criteria.getSearchPattern()),
+ builder.like(builder.lower(hotel.get(Hotel_.address)),
criteria.getSearchPattern())
+ ));
+ List<Hotel> results = em.createQuery(cquery)
+ .setMaxResults(criteria.getFetchSize())
+ .setFirstResult(criteria.getFetchOffset())
+ .getResultList();
+
nextPageAvailable = results.size() > criteria.getPageSize();
if (nextPageAvailable)
{
+ // NOTE create new ArrayList since subList creates unserializable list
hotels = new ArrayList<Hotel>(results.subList(0,
criteria.getPageSize()));
}
else
{
hotels = results;
}
- log.info("Found {0} hotel(s) matching search term ''{1}''
(limit {2})", new Object[] { hotels.size(), criteria.getQuery(),
criteria.getPageSize()});
+ log.info(mf.info("Found {0} hotel(s) matching search term
''{1}'' (limit {2})")
+ .textParams(hotels.size(), criteria.getQuery(),
criteria.getPageSize()).build().getText());
}
}
Modified:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java
===================================================================
---
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java 2010-06-11
16:54:52 UTC (rev 13126)
+++
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/inventory/SearchCriteria.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -80,7 +80,17 @@
{
this.pageSize = pageSize;
}
+
+ public int getFetchSize()
+ {
+ return pageSize + 1;
+ }
+ public int getFetchOffset()
+ {
+ return page * pageSize;
+ }
+
public String getQuery()
{
return query;
Added:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Booking_.java
===================================================================
---
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Booking_.java
(rev 0)
+++
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Booking_.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,24 @@
+package org.jboss.seam.examples.booking.model;
+
+import java.util.Date;
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.StaticMetamodel;
+
+(a)StaticMetamodel(Booking.class)
+public abstract class Booking_ {
+
+ public static volatile SingularAttribute<Booking, Long> id;
+ public static volatile SingularAttribute<Booking, Integer> beds;
+ public static volatile SingularAttribute<Booking, Boolean> smoking;
+ public static volatile SingularAttribute<Booking, String> creditCardName;
+ public static volatile SingularAttribute<Booking, String> creditCardNumber;
+ public static volatile SingularAttribute<Booking, Hotel> hotel;
+ public static volatile SingularAttribute<Booking, Date> checkinDate;
+ public static volatile SingularAttribute<Booking, Integer> creditCardExpiryYear;
+ public static volatile SingularAttribute<Booking, Integer> creditCardExpiryMonth;
+ public static volatile SingularAttribute<Booking, Date> checkoutDate;
+ public static volatile SingularAttribute<Booking, User> user;
+ public static volatile SingularAttribute<Booking, CreditCardType> creditCardType;
+
+}
+
Modified:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Hotel.java
===================================================================
---
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Hotel.java 2010-06-11
16:54:52 UTC (rev 13126)
+++
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Hotel.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -58,6 +58,18 @@
private Integer stars;
private BigDecimal price;
+ public Hotel() {}
+
+ public Hotel(String name, String address, String city, String state, String zip,
String country)
+ {
+ this.name = name;
+ this.address = address;
+ this.city = city;
+ this.state = state;
+ this.zip = zip;
+ this.country = country;
+ }
+
@Id
@GeneratedValue
public Long getId()
Added:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Hotel_.java
===================================================================
---
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Hotel_.java
(rev 0)
+++
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/Hotel_.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,21 @@
+package org.jboss.seam.examples.booking.model;
+
+import java.math.BigDecimal;
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.StaticMetamodel;
+
+(a)StaticMetamodel(Hotel.class)
+public abstract class Hotel_ {
+
+ public static volatile SingularAttribute<Hotel, Long> id;
+ public static volatile SingularAttribute<Hotel, String> zip;
+ public static volatile SingularAttribute<Hotel, BigDecimal> price;
+ public static volatile SingularAttribute<Hotel, String> address;
+ public static volatile SingularAttribute<Hotel, Integer> stars;
+ public static volatile SingularAttribute<Hotel, String> name;
+ public static volatile SingularAttribute<Hotel, String> state;
+ public static volatile SingularAttribute<Hotel, String> country;
+ public static volatile SingularAttribute<Hotel, String> city;
+
+}
+
Added:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/User_.java
===================================================================
---
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/User_.java
(rev 0)
+++
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/model/User_.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,14 @@
+package org.jboss.seam.examples.booking.model;
+
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.StaticMetamodel;
+
+(a)StaticMetamodel(User.class)
+public abstract class User_ {
+
+ public static volatile SingularAttribute<User, String> username;
+ public static volatile SingularAttribute<User, String> name;
+ public static volatile SingularAttribute<User, String> password;
+
+}
+
Modified: examples/trunk/booking-simplified/src/main/resources/META-INF/persistence.xml
===================================================================
---
examples/trunk/booking-simplified/src/main/resources/META-INF/persistence.xml 2010-06-11
16:54:52 UTC (rev 13126)
+++
examples/trunk/booking-simplified/src/main/resources/META-INF/persistence.xml 2010-06-11
22:48:12 UTC (rev 13127)
@@ -5,13 +5,23 @@
version="1.0">
<persistence-unit name="booking">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <!--
+ -->
+ <jta-data-source>jdbc/__default</jta-data-source>
+ <!--
<jta-data-source>java:/DefaultDS</jta-data-source>
+ <jta-data-source>jdbc/__arquillian</jta-data-source>
+ -->
<properties>
<property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<!-- These are the default for JBoss EJB 3, but not for Hibernate
EntityManager -->
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+
+ <!-- Properties for EclipseLink (default provider for GlassFish) -->
+ <property name="eclipselink.ddl-generation"
value="drop-and-create-tables"/>
+ <property name="eclipselink.logging.level"
value="FINE"/>
</properties>
</persistence-unit>
</persistence>
Property changes on: examples/trunk/booking-simplified/src/main/webapp/WEB-INF
___________________________________________________________________
Name: svn:ignore
+ sun-web.xml
Added:
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTestCase.java
===================================================================
---
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTestCase.java
(rev 0)
+++
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTestCase.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,82 @@
+package org.jboss.seam.examples.booking.inventory;
+
+import java.util.List;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.transaction.UserTransaction;
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.examples.booking.support.MavenArtifactResolver;
+import org.jboss.seam.examples.booking.model.Hotel;
+import org.jboss.seam.examples.booking.support.NoOpLogger;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class HotelSearchTestCase
+{
+ @Deployment
+ public static Archive<?> createTestArchive() {
+ // JavaArchive doesn't work on GlassFish (would work on JBoss AS, but it breaks
because of the EJBs)
+// JavaArchive jar = ShrinkWrap.create("test.jar", JavaArchive.class)
+// .addPackage(HotelSearch.class.getPackage())
+// .addPackage(Hotel.class.getPackage())
+// .addManifestResource("META-INF/persistence.xml",
"persistence.xml")
+// .addManifestResource(new ByteArrayAsset(new byte[0]),
"beans.xml");
+// return jar;
+ // WebArchive does work in all cases (except JBoss AS still breaks with EJBs)
+ WebArchive war = ShrinkWrap.create("test.war", WebArchive.class)
+ .addPackage(HotelSearch.class.getPackage())
+ .addPackage(Hotel.class.getPackage())
+ .addClasses(NoOpLogger.class)
+ .addLibraries(
+ MavenArtifactResolver.resolve("joda-time:joda-time:1.6"),
+
MavenArtifactResolver.resolve("org.jboss.seam.international:seam-international-api:3.0.0.Alpha1"),
+
MavenArtifactResolver.resolve("org.jboss.seam.international:seam-international:3.0.0.Alpha1")
+ )
+ .addWebResource("META-INF/persistence.xml",
"classes/META-INF/persistence.xml")
+ .addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
+ return war;
+ }
+
+ @Inject UserTransaction utx;
+ @PersistenceContext EntityManager em;
+ @Inject SearchCriteria criteria;
+ @Inject HotelSearch hotelSearch;
+ @Inject Instance<List<Hotel>> hotelsInstance;
+
+ public void prepareSeedData() throws Exception
+ {
+ utx.begin();
+ em.joinTransaction();
+ em.createQuery("delete from Hotel").executeUpdate();
+ em.persist(new Hotel("Doubletree Atlanta-Buckhead", "3342 Peachtree
Road NE", "Atlanta", "GA", "30326", "USA"));
+ utx.commit();
+ }
+
+ @Test
+ public void testSearch() throws Exception
+ {
+ prepareSeedData();
+
+ criteria.setQuery("atlanta");
+ hotelSearch.find();
+ List<Hotel> hotels = hotelsInstance.get();
+ Assert.assertEquals(1, hotels.size());
+ Assert.assertEquals(hotels.get(0).getName(), "Doubletree
Atlanta-Buckhead");
+
+ criteria.setQuery("boston");
+ hotelSearch.find();
+ hotels = hotelsInstance.get();
+ Assert.assertEquals(0, hotels.size());
+ }
+
+}
Added:
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/MavenArtifactResolver.java
===================================================================
---
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/MavenArtifactResolver.java
(rev 0)
+++
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/MavenArtifactResolver.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,25 @@
+package org.jboss.seam.examples.booking.support;
+
+import java.io.File;
+
+public class MavenArtifactResolver
+{
+ private static final String LOCAL_MAVEN_REPO =
+ System.getProperty("user.home") + File.separatorChar +
+ ".m2" + File.separatorChar + "repository";
+
+ public static File resolve(String groupId, String artifactId, String version)
+ {
+ return new File(LOCAL_MAVEN_REPO + File.separatorChar +
+ groupId.replace(".", File.separator) + File.separatorChar +
+ artifactId + File.separatorChar +
+ version + File.separatorChar +
+ artifactId + "-" + version + ".jar");
+ }
+
+ public static File resolve(String qualifiedArtifactId)
+ {
+ String[] segments = qualifiedArtifactId.split(":");
+ return resolve(segments[0], segments[1], segments[2]);
+ }
+}
Added:
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/NoOpLogger.java
===================================================================
---
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/NoOpLogger.java
(rev 0)
+++
examples/trunk/booking-simplified/src/test/java/org/jboss/seam/examples/booking/support/NoOpLogger.java 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,293 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt 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.
+ */
+package org.jboss.seam.examples.booking.support;
+
+import java.io.Serializable;
+import org.slf4j.Logger;
+import org.slf4j.Marker;
+
+/**
+ * Provide a completely empty logger implementation for Unit Tests. This entire
+ * class is a no-op; it does <i>nothing</i>.
+ *
+ * @author <a href="mailto:lincolnbaxter@gmail.com>Lincoln Baxter,
III</a>
+ *
+ */
+public class NoOpLogger implements Logger, Serializable
+{
+
+ public void debug(final String arg0)
+ {
+ }
+
+ public void debug(final String arg0, final Object arg1)
+ {
+ }
+
+ public void debug(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void debug(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void debug(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void debug(final Marker arg0, final String arg1, final Object arg2, final
Object arg3)
+ {
+ }
+
+ public void error(final String arg0)
+ {
+ }
+
+ public void error(final String arg0, final Object arg1)
+ {
+ }
+
+ public void error(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void error(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void error(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void error(final Marker arg0, final String arg1, final Object arg2, final
Object arg3)
+ {
+ }
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public void info(final String arg0)
+ {
+ }
+
+ public void info(final String arg0, final Object arg1)
+ {
+ }
+
+ public void info(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void info(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void info(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void info(final Marker arg0, final String arg1, final Object arg2, final Object
arg3)
+ {
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return false;
+ }
+
+ public boolean isDebugEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return false;
+ }
+
+ public boolean isErrorEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return false;
+ }
+
+ public boolean isInfoEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return false;
+ }
+
+ public boolean isTraceEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return false;
+ }
+
+ public boolean isWarnEnabled(final Marker arg0)
+ {
+ return false;
+ }
+
+ public void trace(final String arg0)
+ {
+ }
+
+ public void trace(final String arg0, final Object arg1)
+ {
+ }
+
+ public void trace(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void trace(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void trace(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void trace(final Marker arg0, final String arg1, final Object arg2, final
Object arg3)
+ {
+ }
+
+ public void warn(final String arg0)
+ {
+ }
+
+ public void warn(final String arg0, final Object arg1)
+ {
+ }
+
+ public void warn(final String arg0, final Object[] arg1)
+ {
+ }
+
+ public void warn(final String arg0, final Throwable arg1)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1)
+ {
+ }
+
+ public void warn(final String arg0, final Object arg1, final Object arg2)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1, final Object arg2)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1, final Object[] arg2)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1, final Throwable arg2)
+ {
+ }
+
+ public void warn(final Marker arg0, final String arg1, final Object arg2, final Object
arg3)
+ {
+ }
+
+}
Added: examples/trunk/booking-simplified/src/test/resources/arquillian.xml
===================================================================
--- examples/trunk/booking-simplified/src/test/resources/arquillian.xml
(rev 0)
+++ examples/trunk/booking-simplified/src/test/resources/arquillian.xml 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,22 @@
+<arquillian
xmlns="http://jboss.com/arquillian"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gfembed="urn:arq:org.jboss.arquillian.glassfish.embedded30"
+ xmlns:gfremote="urn:arq:org.jboss.arquillian.container.glassfish.jsr88">
+
+ <engine>
+ <deploymentExportPath>/tmp/</deploymentExportPath>
+ </engine>
+
+ <gfremote:container>
+ <gfremote:httpPort>7070</gfremote:httpPort>
+ </gfremote:container>
+
+ <gfembed:container>
+
<gfembed:resourcesXml>src/test/resources-glassfish/sun-resources.xml</gfembed:resourcesXml>
+ <!--
+ <gfembed:instanceRoot>src/test/gfembed</gfembed:instanceRoot>
+ <gfembed:autoDelete>false</gfembed:autoDelete>
+ -->
+ </gfembed:container>
+
+</arquillian>
Added: examples/trunk/booking-simplified/src/test/resources-glassfish/sun-resources.xml
===================================================================
--- examples/trunk/booking-simplified/src/test/resources-glassfish/sun-resources.xml
(rev 0)
+++
examples/trunk/booking-simplified/src/test/resources-glassfish/sun-resources.xml 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0
Resource Definitions //EN"
+ "http://www.sun.com/software/appserver/dtds/sun-resources_1_4.dtd">
+<resources>
+ <jdbc-resource pool-name="ArquillianEmbeddedDerbyPool"
+ jndi-name="jdbc/__arquillian"/>
+ <jdbc-connection-pool name="ArquillianEmbeddedDerbyPool"
+ res-type="javax.sql.DataSource"
+ datasource-classname="org.apache.derby.jdbc.EmbeddedDataSource"
+ is-isolation-level-guaranteed="false">
+ <property name="databaseName"
value="target/databases/derby"/>
+ <property name="createDatabase" value="create"/>
+ </jdbc-connection-pool>
+ <!--
+ <jdbc-resource pool-name="ArquillianEmbeddedH2Pool"
+ jndi-name="jdbc/__arquillian"/>
+ <jdbc-connection-pool name="ArquillianEmbeddedH2Pool"
+ res-type="javax.sql.DataSource"
+ datasource-classname="org.h2.jdbcx.JdbcDataSource">
+ <property name="user" value="sa"/>
+ <property name="password" value=""/>
+ <property name="url"
value="jdbc:h2:file:target/databases/h2/db"/>
+ </jdbc-connection-pool>
+ -->
+</resources>
Added: examples/trunk/booking-simplified/src/test/resources-jbossas/jndi.properties
===================================================================
--- examples/trunk/booking-simplified/src/test/resources-jbossas/jndi.properties
(rev 0)
+++
examples/trunk/booking-simplified/src/test/resources-jbossas/jndi.properties 2010-06-11
22:48:12 UTC (rev 13127)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://localhost:1099