Author: ptahchiev Date: Wed Oct 1 13:24:16 2008 New Revision: 700905 URL: http://svn.apache.org/viewvc?rev=700905&view=rev Log: changes on the ejb3 samples to make them run with maven2.
Added: jakarta/cactus/trunk/samples/ejb3/src/test/ jakarta/cactus/trunk/samples/ejb3/src/test/java/ jakarta/cactus/trunk/samples/ejb3/src/test/java/org/ jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/ jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/ jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/sample/ jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/sample/ejb3/ jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java (with props) Removed: jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java Modified: jakarta/cactus/trunk/samples/ejb3/pom.xml jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml Modified: jakarta/cactus/trunk/samples/ejb3/pom.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/pom.xml?rev=700905&r1=700904&r2=700905&view=diff ============================================================================== --- jakarta/cactus/trunk/samples/ejb3/pom.xml (original) +++ jakarta/cactus/trunk/samples/ejb3/pom.xml Wed Oct 1 13:24:16 2008 @@ -112,41 +112,162 @@ </dependencies> <build> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <dependencies> - <dependency> - <groupId>org.apache.ivy</groupId> - <artifactId>ivy</artifactId> - <version>2.0.0-beta1</version> - </dependency> - <dependency> - <groupId>ant</groupId> - <artifactId>ant-junit</artifactId> - <version>1.6.5</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.2</version> - </dependency> - </dependencies> - <executions> - <execution> - <phase>test</phase> - <configuration> - <tasks> - <ant antfile="build.xml"> - <property name="cactus.version" value="${pom.version}"/> - </ant> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.2-beta-3-SNAPSHOT</version> + <executions> + <execution> + <id>create-cactus-archive</id> + <phase>pre-integration-test</phase> + <configuration> + <descriptors> + <descriptor>src/main/app/main.xml</descriptor> + </descriptors> + <archiverConfig> + <appxml>src/main/app/application.xml</appxml> + </archiverConfig> + </configuration> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.cactus</groupId> + <artifactId>cactus.integration.maven2</artifactId> + <version>1.8.1-SNAPSHOT</version> + <configuration> + <srcFile>target/${pom.artifactId}-${pom.version}-bin.ear</srcFile> + <destFile>${project.build.directory}/${pom.artifactId}-cactified.ear</destFile> + <!--mergeWebXml>src/main/webapp/WEB-INF/cactus-web.xml</mergeWebXml--> + <cactusWar> + <context>/</context> + <redirectors> + <servletRedirector> + <name>ServletRedirectorSecure</name> + <mapping>/ServletRedirectorSecure</mapping> + <roles>test</roles> + </servletRedirector> + <servletRedirector/> + <filterRedirector> + <name>FilterRedirector</name> + <mapping>/test/filterRedirector</mapping> + </filterRedirector> + </redirectors> + <libDependencies> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </dependency> + <dependency> + <groupId>httpunit</groupId> + <artifactId>httpunit</artifactId> + </dependency> + </libDependencies> + <testClasses> + <directory>target/test-classes</directory> + <includes> + <include>**/*Test*.*</include> + </includes> + </testClasses> + <version>2.3</version> + </cactusWar> + </configuration> + <executions> + <execution> + <id>cactus-cactifyear</id> + <phase>pre-integration-test</phase> + <goals> + <goal>cactifyear</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-maven2-plugin</artifactId> + <version>1.0-alpha-4</version> + <executions> + <execution> + <id>start-container</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + </execution> + <execution> + <id>stop-container</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + <configuration> + <wait>false</wait> + <timeout>20000</timeout> + <container> + <containerId>jboss42x</containerId> + <log>target/cargo.log</log> + <output>target/output.log</output> + <zipUrlInstaller> + <url>http://heanet.dl.sourceforge.net/sourceforge/jboss/jboss-4.2.2.GA.zip</url> + <installDir>${basedir}/install</installDir> + </zipUrlInstaller> + </container> + <configuration> + <deployables> + <deployable> + <location>${project.build.directory}/${pom.artifactId}-cactified.ear</location> + <type>ear</type> + <pingURL>http://localhost:8080/</pingURL> + </deployable> + </deployables> + </configuration> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + <executions> + <execution> + <id>surefire-it</id> + <phase>integration-test</phase> + <goals> + <goal>test</goal> + </goals> + <configuration> + <skip>false</skip> + <!--The next line is because we need the tests in src/main/java to ensure + that the classes are included in the archive.--> + <!--testSourceDirectory>src/main/java</testSourceDirectory> + <testClassesDirectory>target/classes</testClassesDirectory--> + <systemProperties> + <property> + <name>cactus.contextURL</name> + <value>http://localhost:8080/</value> + </property> + <property> + <name>cactus.filterRedirectorName</name> + <value>test/filterRedirector</value> + </property> + </systemProperties> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> </project> Modified: jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml?rev=700905&r1=700904&r2=700905&view=diff ============================================================================== --- jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml (original) +++ jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml Wed Oct 1 13:24:16 2008 @@ -12,7 +12,7 @@ <display-name>cactus-sample-ejb</display-name> <description>Cactus EJB3 Sample</description> <module> - <ejb>samples-ejb3-1.8.1-SNAPSHOT.ejb3</ejb> + <ejb>cactus.samples.ejb3-1.8.1-SNAPSHOT.jar</ejb> </module> </application> Added: jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java?rev=700905&view=auto ============================================================================== --- jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java (added) +++ jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java Wed Oct 1 13:24:16 2008 @@ -0,0 +1,74 @@ +/* + * ======================================================================== + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + * + * ======================================================================== + */ +package org.apache.cactus.sample.ejb3; + +import java.util.Properties; + +import javax.naming.InitialContext; + +import junit.framework.TestCase; + +import org.apache.cactus.ServletTestCase; + +/** + * Sample Cactus test for a session bean. + * + * @version $Id: TestConverterEJB.java 238816 2004-02-29 16:36:46Z vmassol $ + */ +public class TestConverterEJB extends ServletTestCase +{ + /** + * Class under test + */ + //private Converter converter; + private IConvertLocal converter; + + /** + * @see TestCase#setUp() + */ + public void setUp() throws Exception + { + Properties properties = new Properties(); + properties.put("java.naming.factory.initial", + "org.jnp.interfaces.NamingContextFactory"); + properties.put("java.naming.factory.url.pkgs", + "org.jboss.naming rg.jnp.interfaces"); + //properties.put("java.naming.provider.url", "jnp://localhost:1099"); + InitialContext ctx = new InitialContext(properties); + + + converter = (IConvertLocal) ctx.lookup("cactus.samples.ejb3-cactified/"+ConverterBean.class.getSimpleName()+"/local"); + + //ConverterHome home = (ConverterHome) PortableRemoteObject.narrow( + // ctx.lookup("Converter"), ConverterHome.class); + //this.converter = home.create(); + } + + /** + * Verify yen to dollars conversion works. + * @throws Exception on error + */ + public void testConvert() throws Exception + { + double dollar = this.converter.convert(100.0); + assertEquals("dollar", 1.0, dollar, 0.01); + } +} Propchange: jakarta/cactus/trunk/samples/ejb3/src/test/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java ------------------------------------------------------------------------------ svn:eol-style = native --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]