[jboss-cvs] JBossAS SVN: r112114 - in branches/JBPAPP_5_1: testsuite and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 23 21:07:17 EDT 2011


Author: klape
Date: 2011-08-23 21:07:17 -0400 (Tue, 23 Aug 2011)
New Revision: 112114

Added:
   branches/JBPAPP_5_1/testsuite/imports/config/tests-jbpapp6469.xml
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloRemote.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloRemoteHome.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloSessionBean.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/test/Jbpapp6469TestCase.java
Modified:
   branches/JBPAPP_5_1/build/build.xml
   branches/JBPAPP_5_1/testsuite/build.xml
   branches/JBPAPP_5_1/testsuite/imports/config/configs.xml
   branches/JBPAPP_5_1/testsuite/imports/sections/iiop.xml
   branches/JBPAPP_5_1/testsuite/imports/server-config.xml
Log:
[JBPAPP-6469] Adding ejb3-iiop-deployers-jboss-beans.xml to standard profile. Added test case

Modified: branches/JBPAPP_5_1/build/build.xml
===================================================================
--- branches/JBPAPP_5_1/build/build.xml	2011-08-23 21:29:10 UTC (rev 112113)
+++ branches/JBPAPP_5_1/build/build.xml	2011-08-24 01:07:17 UTC (rev 112114)
@@ -1065,6 +1065,7 @@
         <include name="conf/jacorb.properties"/>
         <include name="deploy/juddi-service.sar/**"/>
         <include name="deploy/iiop-service.xml"/>
+        <include name="deployers/ejb3.deployer/META-INF/ejb3-iiop-deployers-jboss-beans.xml"/>        
         <include name="lib/jacorb.jar"/>
       </fileset>
     </copy>

Modified: branches/JBPAPP_5_1/testsuite/build.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/build.xml	2011-08-23 21:29:10 UTC (rev 112113)
+++ branches/JBPAPP_5_1/testsuite/build.xml	2011-08-24 01:07:17 UTC (rev 112114)
@@ -1718,6 +1718,7 @@
        -->
 
       <antcall target="tests-jbpapp6517"/>
+      <antcall target="tests-jbpapp6469"/>
 	
       <antcall target="tests-report"/>
       <!-- JBAS-5918 https://issues.apache.org/bugzilla/show_bug.cgi?id=41368 

Modified: branches/JBPAPP_5_1/testsuite/imports/config/configs.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/config/configs.xml	2011-08-23 21:29:10 UTC (rev 112113)
+++ branches/JBPAPP_5_1/testsuite/imports/config/configs.xml	2011-08-24 01:07:17 UTC (rev 112114)
@@ -16,4 +16,5 @@
 <import file="tests-crash-recovery.xml"/>
 <import file="tests-secured.xml"/>
 <import file="tests-jbpapp6517.xml"/>
+<import file="tests-jbpapp6469.xml"/>
 </project>

Added: branches/JBPAPP_5_1/testsuite/imports/config/tests-jbpapp6469.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/config/tests-jbpapp6469.xml	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/imports/config/tests-jbpapp6469.xml	2011-08-24 01:07:17 UTC (rev 112114)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!--
+   | Targets that run the jbpapp6469 - CheckSubDeploymentCompleteDeployer tests
+-->
+<project xmlns:server="http://jboss.org/ns/test/ant/server" name="jbpapp6469.tests">
+  <patternset id="jbpapp6469.includes">
+    <include name="org/jboss/test/iiop/test/Jbpapp6469TestCase.class"/>
+  </patternset>
+  <target name="tests-jbpapp6469" description="Tests JBPAPP-6469">
+    <create-config baseconf="standard" newconf="jbpapp6469">
+      <patternset>
+        <include name="**/*"/>
+      </patternset>
+    </create-config>
+    <!-- set jmx user/pass to admin=admin -->
+    <copy file="${source.resources}/org/jboss/test/deployment/jbpapp6517/jmx-console-users.properties" overwrite="true" todir="${jboss.dist}/server/jbpapp6517/conf/props/"/>
+    <!-- default case -->
+    <server:start name="jbpapp6469"/>
+    <run-junit junit.patternset="jbpapp6469.includes" junit.configuration="jbpapp6469"/>
+    <server:stop name="jbpapp6469"/>
+  </target>
+</project>

Modified: branches/JBPAPP_5_1/testsuite/imports/sections/iiop.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/sections/iiop.xml	2011-08-23 21:29:10 UTC (rev 112113)
+++ branches/JBPAPP_5_1/testsuite/imports/sections/iiop.xml	2011-08-24 01:07:17 UTC (rev 112114)
@@ -27,6 +27,13 @@
             <include name="org/jboss/test/iiop/ejb/**"/>
          </fileset>
       </jar>
+
+      <!-- jbpapp6469 -->
+      <jar destfile="${build.lib}/jbpapp6469.jar">
+        <fileset dir="${build.classes}">
+          <include name="org/jboss/test/iiop/jbpapp6469/**"/>
+        </fileset>
+      </jar>
    </target>
    
    <!-- iiop timing test -->

Modified: branches/JBPAPP_5_1/testsuite/imports/server-config.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/server-config.xml	2011-08-23 21:29:10 UTC (rev 112113)
+++ branches/JBPAPP_5_1/testsuite/imports/server-config.xml	2011-08-24 01:07:17 UTC (rev 112114)
@@ -1298,6 +1298,17 @@
          <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
          <sysproperty key="xb.builder.useUnorderedSequence" value="true" />
       </server>   	
+      <server name="jbpapp6469" host="${node0}">
+        <jvmarg value="-Xms128m"/>
+        <jvmarg value="-Xmx512m"/>
+        <jvmarg value="-XX:MaxPermSize=512m"/>
+        <jvmarg value="-XX:-UseGCOverheadLimit"/>
+        <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
+        <sysproperty key="java.net.preferIPv4Stack" value="true"/>
+        <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed"/>
+        <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}"/>
+        <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      </server>
       <!-- jbpapp6517 -->
       <server name="jbpapp6517" host="${node0}">
          <jvmarg value="-Xms128m" />

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloRemote.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloRemote.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloRemote.java	2011-08-24 01:07:17 UTC (rev 112114)
@@ -0,0 +1,12 @@
+package org.jboss.test.iiop.jbpapp6469;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+public interface HelloRemote extends EJBObject
+{
+   String whoAmI() throws RemoteException;
+   
+   String hello(String name) throws RemoteException;
+}

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloRemoteHome.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloRemoteHome.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloRemoteHome.java	2011-08-24 01:07:17 UTC (rev 112114)
@@ -0,0 +1,11 @@
+package org.jboss.test.iiop.jbpapp6469;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+public interface HelloRemoteHome extends EJBHome
+{
+   HelloRemote create() throws CreateException, RemoteException;
+}

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloSessionBean.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloSessionBean.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/jbpapp6469/HelloSessionBean.java	2011-08-24 01:07:17 UTC (rev 112114)
@@ -0,0 +1,31 @@
+package org.jboss.test.iiop.jbpapp6469;
+
+import javax.annotation.Resource;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.RemoteHome;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.IIOP;
+import org.jboss.ejb3.annotation.SecurityDomain;
+
+ at Stateless
+ at RemoteHome(HelloRemoteHome.class)
+ at IIOP(interfaceRepositorySupported=false)
+//@SecurityDomain("other")
+public class HelloSessionBean
+{
+   @Resource SessionContext ctx;
+   
+   //@RolesAllowed({"allowed"})
+   public String whoAmI()
+   {
+      return ctx.getCallerPrincipal().getName();
+   }
+   
+   public String hello(String name)
+   {
+			System.out.println("hello called for name: " + name);
+      return "Hello " + name;
+   }
+}

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/test/Jbpapp6469TestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/test/Jbpapp6469TestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/iiop/test/Jbpapp6469TestCase.java	2011-08-24 01:07:17 UTC (rev 112114)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.iiop.test;
+
+import java.util.Properties;
+
+import javax.management.JMX;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.iiop.CorbaNamingServiceMBean;
+import org.jboss.test.JBossTestCase;
+
+import junit.framework.Test;
+
+public class Jbpapp6469TestCase extends JBossTestCase
+{
+   public Jbpapp6469TestCase(String name) 
+   {
+      super(name);
+   }
+
+   public void testIiopWorksOnStandard() throws Exception
+   {
+      try
+      {
+         deployFailOnError("file:///home/klape/jboss/src/JBPAPP_5_1/testsuite/output/lib/jbpapp6469.jar");
+         String objectNameString = "jboss:service=CorbaNaming";
+         MBeanServerConnection mbeanServerConnection = getRMIServer(null);
+         ObjectName objectName = new ObjectName(objectNameString);
+         CorbaNamingServiceMBean mbean = JMX.newMBeanProxy(mbeanServerConnection, objectName, CorbaNamingServiceMBean.class);
+         String listing = mbean.list();
+         String[] deployments = listing.split("\n");
+         for(String deployment : deployments)
+         {
+            if(deployment.equals("HelloSessionBean/"))
+               return;
+         }
+         fail("Did not find IIOP EJB");
+      }
+      finally
+      {
+         undeployFailOnError("file:///home/klape/jboss/src/JBPAPP_5_1/testsuite/output/lib/jbpapp6469.jar");
+      }
+   }
+
+   private static MBeanServerConnection getRMIServer(String host) throws Exception
+   {
+      String connectorName = "jmx/rmi/RMIAdaptor";
+      RMIAdaptor server = (RMIAdaptor) getInitialContext(host).lookup(connectorName);
+      return server;
+   }
+
+   private static InitialContext getInitialContext(String host) throws Exception
+   {
+      if ( host == null )
+         return new InitialContext();
+      else
+      {
+         Properties props = new Properties();
+         props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+         props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
+         props.put(Context.PROVIDER_URL, "jnp://"+host+":1099");
+         return new InitialContext(props);
+      }
+   }
+
+   private void deployFailOnError(String file)
+   {
+      try
+      {
+         log.info("Deploying : " + file);
+         super.deploy(file);
+      }
+      catch ( Exception e )
+      {
+         e.printStackTrace();
+         fail("Failed to deploy: " + file);
+      }
+   }
+
+   private void undeployFailOnError(String file)
+   {
+      try
+      {
+         log.info("Undeploying : " + file);
+         super.undeploy(file);
+      }
+      catch ( Exception e )
+      {
+         fail("Failed to undeploy: " + file);
+      }
+   }
+}
+// vim: sw=3 ts=3



More information about the jboss-cvs-commits mailing list