You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2006/09/23 16:01:04 UTC
svn commit: r449245 - in
/incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test:
stateful/ stateless/
Author: jlaskowski
Date: Sat Sep 23 07:01:03 2006
New Revision: 449245
URL: http://svn.apache.org/viewvc?view=rev&rev=449245
Log:
Added the remaining files from OPENEJB-172 - iTest: StatefulLocalJndiTests
Added:
incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalHome.java
incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalObject.java
incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalTestClient.java
incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/StatefulPojoLocalJndiTests.java
incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoHomeIntfcTests.java
incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoLocalHomeIntfcTests.java
Added: incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalHome.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalHome.java?view=auto&rev=449245
==============================================================================
--- incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalHome.java (added)
+++ incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalHome.java Sat Sep 23 07:01:03 2006
@@ -0,0 +1,34 @@
+/**
+ * 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.openejb.test.stateful;
+
+
+/**
+ * The local home interface for BasicStatefulPojoBean.
+ *
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
+ * @author <a href="mailto:nour.mohammad@gmail.com">Mohammad Nour El-Din</a>
+ *
+ * @version $Rev$ $Date$
+ */
+public interface BasicStatefulLocalHome extends javax.ejb.EJBLocalHome {
+
+ public BasicStatefulLocalObject create(String name) throws javax.ejb.CreateException;
+
+}
+
Added: incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalObject.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalObject.java?view=auto&rev=449245
==============================================================================
--- incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalObject.java (added)
+++ incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalObject.java Sat Sep 23 07:01:03 2006
@@ -0,0 +1,70 @@
+/**
+ * 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.openejb.test.stateful;
+
+import java.util.Properties;
+
+import org.openejb.test.ApplicationException;
+import org.openejb.test.object.OperationsPolicy;
+
+/**
+ * The local interface for BasicStatefulPojoBean.
+ *
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
+ * @author <a href="mailto:nour.mohammad@gmail.com">Mohammad Nour El-Din</a>
+ *
+ * @version $Rev$ $Date$
+ */
+public interface BasicStatefulLocalObject extends javax.ejb.EJBLocalObject {
+
+ /**
+ * Reverses the string passed in then returns it
+ *
+ */
+ public String businessMethod(String text);
+
+ /**
+ * Throws an ApplicationException when invoked
+ *
+ */
+ public void throwApplicationException() throws ApplicationException;
+
+ /**
+ * Throws a java.lang.NullPointerException when invoked
+ * This is a system exception and should result in the
+ * destruction of the instance and invalidation of the
+ * remote reference.
+ *
+ */
+ public void throwSystemException_NullPointer();
+
+ /**
+ * Returns a report of the bean's
+ * runtime permissions
+ *
+ */
+ public Properties getPermissionsReport();
+
+ /**
+ * Returns a report of the allowed opperations
+ * for one of the bean's methods.
+ *
+ * @param methodName The method for which to get the allowed opperations report
+ */
+ public OperationsPolicy getAllowedOperationsReport(String methodName);
+}
Added: incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalTestClient.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalTestClient.java?view=auto&rev=449245
==============================================================================
--- incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalTestClient.java (added)
+++ incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/BasicStatefulLocalTestClient.java Sat Sep 23 07:01:03 2006
@@ -0,0 +1,34 @@
+/**
+ * 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.openejb.test.stateful;
+
+/**
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class BasicStatefulLocalTestClient extends StatefulTestClient {
+
+ protected BasicStatefulLocalHome ejbLocalHome;
+ protected BasicStatefulLocalObject ejbLocalObject;
+
+ public BasicStatefulLocalTestClient(String name){
+ super(name);
+ }
+}
+
Added: incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/StatefulPojoLocalJndiTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/StatefulPojoLocalJndiTests.java?view=auto&rev=449245
==============================================================================
--- incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/StatefulPojoLocalJndiTests.java (added)
+++ incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateful/StatefulPojoLocalJndiTests.java Sat Sep 23 07:01:03 2006
@@ -0,0 +1,52 @@
+/**
+ * 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.openejb.test.stateful;
+
+
+/**
+ * [1] Should be run as the first test suite of the BasicStatefulTestClients
+ *
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
+ * @author <a href="mailto:nour.mohammad@gmail.com">Mohammad Nour El-Din</a>
+ *
+ * @version $Rev$ $Date$
+ */
+public class StatefulPojoLocalJndiTests extends BasicStatefulLocalTestClient {
+
+ public StatefulPojoLocalJndiTests(){
+ super("LocalJNDI.");
+ }
+
+ public void test01_Jndi_lookupHome(){
+ try{
+ // Here we use the Java casting as what is done while looking-up a local bean
+ ejbLocalHome = (BasicStatefulLocalHome) initialContext.lookup("client/tests/stateful/BasicStatefulPojoHomeLocal");
+ assertNotNull("The EJBLocalHome is null", ejbLocalHome);
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+
+ /* TO DO:
+ * public void test00_enterpriseBeanAccess()
+ * public void test00_jndiAccessToJavaCompEnv()
+ * public void test00_resourceManagerAccess()
+ */
+
+}
+
Added: incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoHomeIntfcTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoHomeIntfcTests.java?view=auto&rev=449245
==============================================================================
--- incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoHomeIntfcTests.java (added)
+++ incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoHomeIntfcTests.java Sat Sep 23 07:01:03 2006
@@ -0,0 +1,57 @@
+/**
+ * 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.openejb.test.stateless;
+
+
+/**
+ * [2] Should be run as the second test suite of the BasicStatelessTestClients
+ *
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
+ * @author <a href="mailto:nour.mohammad@gmail.com">Mohammad Nour El-Din</a>
+ *
+ * @version $Rev$ $Date$
+ */
+public class StatelessPojoHomeIntfcTests extends BasicStatelessTestClient {
+
+ public StatelessPojoHomeIntfcTests(){
+ super("HomeIntfc.");
+ }
+
+ protected void setUp() throws Exception{
+ super.setUp();
+ Object obj = initialContext.lookup("client/tests/stateless/BasicStatelessPojoHome");
+ ejbHome = (BasicStatelessHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatelessHome.class);
+ }
+
+ //===============================
+ // Test home interface methods
+ //
+ public void test01_create(){
+ try{
+ ejbObject = ejbHome.create();
+ assertNotNull( "The EJBObject is null", ejbObject );
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+ //
+ // Test home interface methods
+ //===============================
+
+}
+
Added: incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoLocalHomeIntfcTests.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoLocalHomeIntfcTests.java?view=auto&rev=449245
==============================================================================
--- incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoLocalHomeIntfcTests.java (added)
+++ incubator/openejb/trunk/openejb3/openejb-itests/src/main/java/org/openejb/test/stateless/StatelessPojoLocalHomeIntfcTests.java Sat Sep 23 07:01:03 2006
@@ -0,0 +1,56 @@
+/**
+ * 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.openejb.test.stateless;
+
+
+/**
+ * [2] Should be run as the second test suite of the BasicStatelessTestClients
+ *
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
+ * @author <a href="mailto:nour.mohammad@gmail.com">Mohammad Nour El-Din</a>
+ *
+ * @version $Rev$ $Date$
+ */
+public class StatelessPojoLocalHomeIntfcTests extends BasicStatelessLocalTestClient {
+
+ public StatelessPojoLocalHomeIntfcTests(){
+ super("PojoLocalHomeIntfc.");
+ }
+
+ protected void setUp() throws Exception{
+ super.setUp();
+ ejbLocalHome = (BasicStatelessLocalHome) initialContext.lookup("client/tests/stateless/BasicStatelessPojoHomeLocal");
+ }
+
+ //===============================
+ // Test home interface methods
+ //
+ public void test01_create(){
+ try{
+ ejbLocalObject = ejbLocalHome.create();
+ assertNotNull( "The EJBObject is null", ejbLocalObject );
+ } catch (Exception e){
+ fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
+ }
+ }
+ //
+ // Test home interface methods
+ //===============================
+
+}
+