Author: ptahchiev
Date: Mon Jun 30 06:09:47 2008
New Revision: 672758

URL: http://svn.apache.org/viewvc?rev=672758&view=rev
Log:
Added a EJB3 tests sample.

Added:
    jakarta/cactus/trunk/samples/ejb3/
    jakarta/cactus/trunk/samples/ejb3/build.xml   (with props)
    jakarta/cactus/trunk/samples/ejb3/ivy.xml   (with props)
    jakarta/cactus/trunk/samples/ejb3/pom.xml   (with props)
    jakarta/cactus/trunk/samples/ejb3/src/
    jakarta/cactus/trunk/samples/ejb3/src/main/
    jakarta/cactus/trunk/samples/ejb3/src/main/app/
    jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml   (with 
props)
    jakarta/cactus/trunk/samples/ejb3/src/main/java/
    jakarta/cactus/trunk/samples/ejb3/src/main/java/org/
    jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/
    jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/
    jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/
    
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/
    
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/ConverterBean.java
   (with props)
    
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/IConvertLocal.java
   (with props)
    
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java
   (with props)
    jakarta/cactus/trunk/samples/ejb3/src/main/resources/
    jakarta/cactus/trunk/samples/ejb3/src/main/webapp/
    jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/
    jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/cactus-web.xml   
(with props)
    jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/web.xml   (with 
props)

Added: jakarta/cactus/trunk/samples/ejb3/build.xml
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/build.xml?rev=672758&view=auto
==============================================================================
--- jakarta/cactus/trunk/samples/ejb3/build.xml (added)
+++ jakarta/cactus/trunk/samples/ejb3/build.xml Mon Jun 30 06:09:47 2008
@@ -0,0 +1,226 @@
+<?xml version="1.0"?>
+<!--
+   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.
+-->
+
+<!--
+  =============================================================================
+    Build file for the Cactus EJB Sample subproject.
+
+    The following Ant tasks need to be available in your ant installation (i.e.
+    the Ant task themselves and their dependent jars need to be put in
+    ANT_HOME/lib) :
+
+        junit                  [REQUIRED] JUnit Ant task
+
+    The mandatory and optional Ant properties are defined in
+    build.properties.sample. Please read and edit that file.
+
+    This script should be started with the following command line :
+
+        ant <target>
+
+    Run "ant -projecthelp" to get a list of available targets. The default
+    target is "dist"
+  =============================================================================
+-->
+
+<project name="Cactus EJB3 Sample"  xmlns:ivy="antlib:org.apache.ivy.ant" 
default="test"> 
+
+       <description>
+     Cactus Sample
+     ---------------------------------------------------------
+     Sample EAR application that demonstrates how Cactus can
+     be used using the Ant integration for unit testing EJBs v.3
+     classes.
+  </description>
+  
+ <!--
+     ========================================================================
+       Initialize properties.
+     ========================================================================
+  -->  
+       <target name="init" depends="">
+       
+       
+         <property name="cactus.sample.app.type" value="ejb"/>
+         <property name="cactus.sample.archive.type" value="ear"/>
+         
+         <property file="../build.properties"/>
+               
+               <path id="cactus.classpath">
+                       <fileset dir="${ivy.lib.dir}">
+        <include name="*.jar"/>
+      </fileset>
+               </path>
+               
+               <path id="jboss.client">
+                       <fileset dir="${jboss.home}/client/">
+        <include name="*.jar"/>
+      </fileset>
+    </path>
+       </target>
+
+ <!--
+     ========================================================================
+       Prepare the folder structure.
+     ========================================================================
+  -->
+       <target name="prepare" depends="init">
+               <mkdir dir="${build.dir}"/>
+               <mkdir dir="${cactus.build.dir}"/>
+               <mkdir dir="${logs.dir}"/>
+               <mkdir dir="${reports.dir}"/>
+       </target>
+
+ <!--
+     ========================================================================
+       Resolve Ivy dependencies.
+     ========================================================================
+  -->
+       <target name="resolve" description="Retrieve dependencies with ivy" 
depends="prepare">
+               <ivy:configure file="../ivysettings.xml" />
+               <ivy:retrieve file="./ivy.xml" sync="true"/>
+  </target>
+
+ <!--
+     ========================================================================
+       Load external ant tasks.
+     ========================================================================
+  -->
+       <target name="load.tasks" depends="resolve">
+               <taskdef resource="cactus.tasks"
+                        classpathref="cactus.classpath">
+               </taskdef>
+       </target>
+       
+ <!--
+     ========================================================================
+       Compile source classes as well as cactus classes.
+     ========================================================================
+  -->
+       <!--Note that if some dependency is missing in the classpath, instead 
of compilation errors,
+      Ivy reports to Maven 'No Compiler Found' error. -->
+       <target name="compile" depends="load.tasks" description="Compiles the 
needed classes.">
+
+               <javac srcdir="${src.dir}"
+                      destdir="${build.dir}"
+                      classpathref="cactus.classpath"/>
+               
+
+       </target>
+       
+       <!--
+     ========================================================================
+       Create the runtime ejb-jar file.
+     ========================================================================
+  -->
+  <target name="package-war" depends="compile"
+      description="Generate the runtime war file.">
+      
+    <war destfile="${target.dir}/${ejb3.project.name}.war"
+         webxml="${basedir}/src/main/webapp/WEB-INF/web.xml"/>
+         
+  </target>
+
+  <!--
+     ========================================================================
+       Create the runtime ejb-jar file.
+     ========================================================================
+  -->
+  <target name="ejb" depends="compile"
+      description="Generate the runtime ejb-jar">
+
+    <!-- ATM, only support containers which do not need an ejb compilation
+         step. For example: JBoss -->
+    <jar jarfile="${target.dir}/${ejb3.project.name}.ejb3">
+      <fileset dir="${build.dir}"/>
+      <metainf dir="${meta.inf.dir}"/>
+    </jar>
+
+  </target>
+
+  <!--
+     ========================================================================
+       Create the runtime ear file.
+     ========================================================================
+  -->
+  <target name="package-ear" depends="ejb"
+      description="Generate the runtime ear">
+
+    <ear earfile="${ejb3.archive.name}"
+        appxml="${src.application.dir}/application.xml">
+      <fileset file="${target.dir}/${ejb3.project.name}.ejb3"/>
+    </ear>
+  </target>
+  
+       <!--
+     ========================================================================
+       Cactify the ready-made ear file.
+     ========================================================================
+  -->
+       <target name="cactifyear" depends="package-ear, package-war">
+               <cactifyear srcfile="${ejb3.archive.name}" 
destfile="${cactified.ejb3.archive.name}">
+                 <cactuswar srcfile="${target.dir}/${ejb3.project.name}.war"
+        destfile="${target.dir}/${ejb3.project.name}-cactified.war"
+        mergewebxml="${src.webapp.dir}/WEB-INF/cactus-web.xml"
+        context="/">
+        <classes dir="${build.dir}">
+          <include name="org/apache/cactus/sample/ejb3/Test*.class"/>
+        </classes>
+      </cactuswar>
+               </cactifyear>
+               
+       </target>
+       
+       <!--
+     ========================================================================
+       Execute the tests.
+     ========================================================================
+  -->
+       <target name="test" depends="cactifyear">
+         <echo>Please take a deep breath while Cargo gets JBoss for running 
the sample ejb3 tests...</echo>
+               <cactus earfile="${cactified.ejb3.archive.name}"
+                       printsummary="yes">
+                       <classpath>
+                               <path refid="cactus.classpath"/>
+                               <pathelement location="${build.dir}"/>
+                               <pathelement location="${cactus.build.dir}"/>
+                               <pathelement location="${basedir}/cactus"/>
+                               <path refid="jboss.client"/>
+                       </classpath>
+                       <containerset>
+                               <cargo containerId="${jboss.container.id}" 
output="${logs.dir}/output.log" log="${logs.dir}/cargo.log" 
home="${jboss.home}">
+                                       <!--zipUrlInstaller
+            
installUrl="http://heanet.dl.sourceforge.net/sourceforge/jboss/jboss-4.0.2.zip";
+            installDir="target/${jboss.container.id}"/-->
+                                       <configuration>
+                                               <property 
name="cargo.servlet.port" value="${cargo.servlet.port}"/>
+                                               <property name="cargo.logging" 
value="${cargo.logging}"/>
+                                               <deployable 
type="${cactus.sample.archive.type}" file="${cactified.ejb3.archive.name}"/>
+                                       </configuration>
+                               </cargo>
+                       </containerset>
+                       
+                       <formatter type="${cactus.formatter.type}"/>
+                       <batchtest todir="${reports.dir}">
+                               <fileset dir="${src.dir}">
+                                       <include name="**/Test*.java"/>
+                               </fileset>
+                       </batchtest>
+               </cactus>
+       </target>
+</project>

Propchange: jakarta/cactus/trunk/samples/ejb3/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jakarta/cactus/trunk/samples/ejb3/ivy.xml
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/ivy.xml?rev=672758&view=auto
==============================================================================
--- jakarta/cactus/trunk/samples/ejb3/ivy.xml (added)
+++ jakarta/cactus/trunk/samples/ejb3/ivy.xml Mon Jun 30 06:09:47 2008
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+       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.   
+-->
+<ivy-module version="2.0">
+       <info organisation="apache" module="hello-ivy"/>
+
+       <dependencies>
+               <dependency org="org.apache.cactus" 
name="cactus.core.framework.uberjar.javaEE.14" rev="${cactus.version}"/>
+               <dependency org="org.apache.cactus" 
name="cactus.integration.ant" rev="${cactus.version}"/>
+               <dependency org="org.apache.cactus" 
name="cactus.integration.shared.api" rev="${cactus.version}"/>
+               
+               <dependency org="commons-httpclient" name="commons-httpclient" 
rev="3.1"/>
+               <dependency org="commons-logging" name="commons-logging" 
rev="1.1"/>
+               <dependency org="commons-codec" name="commons-codec" rev="1.3"/>
+               <dependency org="aspectj" name="aspectjrt" rev="1.5.3"/>
+               <dependency org="xerces" name="xercesImpl" rev="2.6.2"/>
+
+               <dependency org="org.codehaus.cargo" name="cargo-core-uberjar" 
rev="1.0-alpha-4"/>
+               <dependency org="org.codehaus.cargo" name="cargo-ant" 
rev="1.0-alpha-4"/>
+               
+               <dependency org="javax.servlet" name="jsp-api" rev="2.0"/>
+               <dependency org="javax.servlet" name="servlet-api" rev="2.5"/>
+               <dependency org="javax.servlet" name="jstl" rev="1.1.2"/>
+               <!--dependency org="geronimo-spec" name="geronimo-spec-ejb" 
rev="2.1-rc4"/>
+               <dependency org="org.apache.geronimo.specs" 
name="geronimo-jms_1.1_spec" rev="1.0"/>
+               <dependency org="org.apache.geronimo.specs" 
name="geronimo-ejb_2.1_spec" rev="1.0"/-->
+               
+               <dependency org="jdom" name="jdom" rev="1.0"/>
+         <dependency org="jaxen" name="jaxen" rev="1.1.1"/>
+         
+         
+       </dependencies>
+</ivy-module> 

Propchange: jakarta/cactus/trunk/samples/ejb3/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jakarta/cactus/trunk/samples/ejb3/pom.xml
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/pom.xml?rev=672758&view=auto
==============================================================================
--- jakarta/cactus/trunk/samples/ejb3/pom.xml (added)
+++ jakarta/cactus/trunk/samples/ejb3/pom.xml Mon Jun 30 06:09:47 2008
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+       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.   
+-->
+<project>
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.apache.cactus</groupId>
+               <artifactId>cactus.samples</artifactId>
+               <version>1.8.1-SNAPSHOT</version>
+       </parent>
+       <artifactId>cactus.samples.ejb3</artifactId>
+       <name>Cactus Ejb Samples - Parent Project</name>
+       <description>Cactus Ejb3 Samples - the parent project</description>
+       <packaging>jar</packaging>
+               <dependencies>
+               <dependency>
+                       <groupId>org.apache.cactus</groupId>
+                       
<artifactId>cactus.core.framework.uberjar.javaEE.14</artifactId>
+                       <version>${version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.cactus</groupId>
+                       <artifactId>cactus.integration.ant</artifactId>
+                       <version>${version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.cactus</groupId>
+                       <artifactId>cactus.integration.shared.api</artifactId>
+                       <version>${version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>commons-httpclient</groupId>
+                       <artifactId>commons-httpclient</artifactId>
+                       <version>3.1</version>
+               </dependency>
+               <dependency>
+                       <groupId>commons-logging</groupId>
+                       <artifactId>commons-logging</artifactId>
+                       <version>1.1</version>
+               </dependency>
+               <dependency>
+                       <groupId>commons-codec</groupId>
+                       <artifactId>commons-codec</artifactId>
+                       <version>1.3</version>
+               </dependency>
+               <dependency>
+                       <groupId>aspectj</groupId>
+                       <artifactId>aspectjrt</artifactId>
+                       <version>1.5.3</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.codehaus.cargo</groupId>
+                       <artifactId>cargo-core-uberjar</artifactId>
+                       <version>1.0-alpha-4</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.codehaus.cargo</groupId>
+                       <artifactId>cargo-ant</artifactId>
+                       <version>1.0-alpha-4</version>
+               </dependency>
+               <dependency>
+                       <groupId>xerces</groupId>
+                       <artifactId>xercesImpl</artifactId>
+                       <version>2.6.2</version>
+               </dependency>
+               <dependency>
+                       <groupId>javax.servlet</groupId>
+                       <artifactId>jsp-api</artifactId>
+                       <version>2.0</version>
+               </dependency>
+               <dependency>
+                       <groupId>javax.servlet</groupId>
+                       <artifactId>servlet-api</artifactId>
+                       <version>2.5</version>
+               </dependency>
+               <dependency>
+                       <groupId>javax.servlet</groupId>
+                       <artifactId>jstl</artifactId>
+                       <version>1.1.2</version>
+               </dependency>
+               <dependency>
+                       <groupId>taglibs</groupId>
+                       <artifactId>standard</artifactId>
+                       <version>1.1.2</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.ivy</groupId>
+                       <artifactId>ivy</artifactId>
+                       <version>2.0.0-beta1</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.geronimo.specs</groupId>
+                       <artifactId>geronimo-ejb_3.0_spec</artifactId>
+                       <version>1.0</version>
+               </dependency>
+       </dependencies>
+       <build>
+               <plugins>
+                 <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>
+               </plugins>
+       </build>
+</project> 

Propchange: jakarta/cactus/trunk/samples/ejb3/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=672758&view=auto
==============================================================================
--- jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml (added)
+++ jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml Mon Jun 30 
06:09:47 2008
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE application
+  PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN'
+  'http://java.sun.com/j2ee/dtds/application_1_3.dtd'>
+
+<!-- TODO: In the future you won't have to create a specific
+     application.xml in which you have to declare a Cactus test
+     war if you don't have a war in your EAR -->
+     
+<application>
+  <display-name>cactus-sample-ejb</display-name>
+  <description>Cactus EJB3 Sample</description>
+  <module>
+    <ejb>samples-ejb3-1.8.1-SNAPSHOT.ejb3</ejb>
+  </module>
+
+</application>

Propchange: jakarta/cactus/trunk/samples/ejb3/src/main/app/application.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/ConverterBean.java
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/ConverterBean.java?rev=672758&view=auto
==============================================================================
--- 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/ConverterBean.java
 (added)
+++ 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/ConverterBean.java
 Mon Jun 30 06:09:47 2008
@@ -0,0 +1,42 @@
+/* 
+ * ========================================================================
+ * 
+ * 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 javax.ejb.Stateless;
+
+import org.apache.cactus.sample.ejb3.IConvertLocal;
+
+/**
+ * Sample EJB3 bean.
+ *
+ * @version $Id: ConverterBean.java 238816 2008-06-31 16:36:46Z ptahchiev $
+ */
[EMAIL PROTECTED]
+public class ConverterBean implements IConvertLocal {
+
+    /* (non-Javadoc)
+     * @see org.apache.cactus.sample.ejb3.IConvertLocal#convert(double)
+     */
+    public double convert(double theYenAmount) {
+        return theYenAmount / 100.0;
+    }
+
+}

Propchange: 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/ConverterBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/IConvertLocal.java
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/IConvertLocal.java?rev=672758&view=auto
==============================================================================
--- 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/IConvertLocal.java
 (added)
+++ 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/IConvertLocal.java
 Mon Jun 30 06:09:47 2008
@@ -0,0 +1,43 @@
+/* 
+ * ========================================================================
+ * 
+ * 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.io.Serializable;
+
+import javax.ejb.Local;
+
+/**
+ * Sample EJB local interface
+ *
+ * @version $Id: IConverterLocal.java 238816 2008-06-31 16:36:46Z ptahchiev $
+ */
[EMAIL PROTECTED]
+public interface IConvertLocal extends Serializable
+{
+    /**
+     * A method declaration to convert yen to dollars.
+     * 
+     * @param theYenAmount
+     * @return
+     */
+    public double convert(double theYenAmount);
+
+}

Propchange: 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/IConvertLocal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java?rev=672758&view=auto
==============================================================================
--- 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java
 (added)
+++ 
jakarta/cactus/trunk/samples/ejb3/src/main/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java
 Mon Jun 30 06:09:47 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.Context;
+import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
+
+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("samples-ejb-1.8.1-SNAPSHOT-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/main/java/org/apache/cactus/sample/ejb3/TestConverterEJB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/cactus-web.xml
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/cactus-web.xml?rev=672758&view=auto
==============================================================================
--- jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/cactus-web.xml 
(added)
+++ jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/cactus-web.xml 
Mon Jun 30 06:09:47 2008
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd";>
+
+<web-app>
+
+    <!-- Put Cactus specific definitions here. Note that by default
+         the <cactifywar> Ant task automatically adds Servlet, Filter
+         and JSP redirector definitions and mappings. You only need
+         to edit this file if you want to change these defaults or 
+         add other definitions required for Cactus testing. -->
+
+</web-app>

Propchange: 
jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/cactus-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/web.xml?rev=672758&view=auto
==============================================================================
--- jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/web.xml (added)
+++ jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/web.xml Mon Jun 
30 06:09:47 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd";>
+
+<web-app>
+</web-app>

Propchange: jakarta/cactus/trunk/samples/ejb3/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to