You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by pt...@apache.org on 2008/05/27 15:30:03 UTC

svn commit: r660505 - in /jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus: AbstractEJBTestCase.java EJBTestCase.java

Author: ptahchiev
Date: Tue May 27 06:30:00 2008
New Revision: 660505

URL: http://svn.apache.org/viewvc?rev=660505&view=rev
Log:
Added the cactus EJB test-case 

Added:
    jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/AbstractEJBTestCase.java   (with props)
    jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/EJBTestCase.java   (with props)

Added: jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/AbstractEJBTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/AbstractEJBTestCase.java?rev=660505&view=auto
==============================================================================
--- jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/AbstractEJBTestCase.java (added)
+++ jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/AbstractEJBTestCase.java Tue May 27 06:30:00 2008
@@ -0,0 +1,60 @@
+/* 
+ * ========================================================================
+ * 
+ * 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;
+
+import org.apache.cactus.internal.AbstractCactusTestCase;
+import org.apache.cactus.internal.HttpServiceDefinition;
+import org.apache.cactus.internal.client.AbstractEJBClient;
+import org.apache.cactus.internal.util.JUnitVersionHelper;
+
+/**
+ * Prototype of EJBRedirector for Cactus.
+ * @author Siddhartha P. Chandurkar (siddhartha@visioncodified.com)
+ */
+public abstract class AbstractEJBTestCase extends AbstractCactusTestCase 
+{
+    /**
+     * Constructor with the test-case name as a parameter.
+     * @param theName
+     */
+    public AbstractEJBTestCase(String theName) 
+    {
+        super(theName);
+    }
+
+    /**
+     * The client method to execute the tests.
+     * @param theClient
+     * @throws Throwable
+     */
+    protected void runGenericTest(AbstractEJBClient theClient)
+        throws Throwable 
+    {
+        EJBRequest request = new EJBRequest();
+        request.setClassName(
+            HttpServiceDefinition.CLASS_NAME_PARAM,
+            this.getClass().getName());
+        request.setMethodName(
+            HttpServiceDefinition.METHOD_NAME_PARAM,
+            JUnitVersionHelper.getTestCaseName(this));
+       theClient.doTest(request);
+    }
+}

Propchange: jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/AbstractEJBTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/EJBTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/EJBTestCase.java?rev=660505&view=auto
==============================================================================
--- jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/EJBTestCase.java (added)
+++ jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/EJBTestCase.java Tue May 27 06:30:00 2008
@@ -0,0 +1,64 @@
+/* 
+ * ========================================================================
+ * 
+ * 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;
+
+import org.apache.cactus.internal.client.EJBClient;
+import org.apache.cactus.internal.client.connector.http.HttpProtocolHandler;
+import org.apache.cactus.internal.configuration.DefaultServletConfiguration;
+import org.apache.cactus.spi.client.connector.ProtocolHandler;
+
+/**
+ * Cactus test case to unit test EJBs. Test classes that need access to 
+ * valid EJB implicit objects (such as the EJB request, the EJB response,
+ * the servlet config, ...) must subclass this class.
+ *
+ * @version $Id: EJBTestCase.java 238991 2004-05-22 11:34:50Z$
+ * @author Siddhartha P. Chandurkar (siddhartha@visioncodified.com)
+ */
+public class EJBTestCase extends AbstractEJBTestCase 
+{
+    /**
+     * Constructor with the name of the test case as a parameter.
+     * @param theName
+     */
+    public EJBTestCase(String theName) 
+    {
+        super(theName);
+    }
+
+    /**
+     * The initial method to start the test process.
+     * @throws Throwable
+     */
+    protected void runTest() throws Throwable 
+    {
+        runGenericTest(new EJBClient());
+    }
+
+    /**
+     * The obligatory createProtocolHandler.
+     * @return the ready-created protocol handler.
+     */
+    protected ProtocolHandler createProtocolHandler() 
+    {
+        return new HttpProtocolHandler(new DefaultServletConfiguration());
+    }
+}

Propchange: jakarta/cactus/trunk/framework/framework-12-13-14/src/main/java/org/apache/cactus/EJBTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org