[jboss-cvs] JBossAS SVN: r112559 - in branches/JBPAPP_5_1/testsuite: src/main/org/jboss/test/ejb3 and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 9 00:16:21 EST 2012


Author: jiwils
Date: 2012-01-09 00:16:20 -0500 (Mon, 09 Jan 2012)
New Revision: 112559

Added:
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/JBPAPP7128UnitTestCase.java
Modified:
   branches/JBPAPP_5_1/testsuite/build.xml
Log:
Merging 5.1.3_interim changes: [JBPAPP-7128] adding testcase

Modified: branches/JBPAPP_5_1/testsuite/build.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/build.xml	2012-01-06 18:26:34 UTC (rev 112558)
+++ branches/JBPAPP_5_1/testsuite/build.xml	2012-01-09 05:16:20 UTC (rev 112559)
@@ -332,6 +332,9 @@
       <!-- path refid="jboss.jboss.ejb3.core.classpath" / -->
       <pathelement path="${jboss.dist.client}/jboss-ejb3-core-client.jar" />  
       <pathelement path="${jboss.dist.common.lib}/jboss-ejb3-core.jar" />
+      <!-- ejb3 deployer classpath -->
+      <pathelement path="${jboss.dist.server}/all/deployers/ejb3.deployer/jboss-ejb3-deployer.jar" />
+      <path refid="jboss.jboss.jpa.deployers.classpath" />
       <!-- path refid="jboss.jboss.ejb3.ext.api.classpath" / -->
       <pathelement path="${jboss.dist.client}/jboss-ejb3-ext-api.jar" />
       <!-- path refid="jboss.jboss.ejb3.proxy.impl.classpath" / -->
@@ -693,6 +696,7 @@
       <pathelement path="${project.tools}/lib/ant.jar"/>
       <pathelement path="${project.tools}/lib/ant-junit.jar"/>
       <path refid="jboss.ejb3.classpath"/>
+      <pathelement path="${jboss.dist.server}/all/deployers/ejb3.deployer/jboss-ejb3-deployer.jar" />
       <path refid="jboss.jmx.classpath"/>
       <path refid="jboss.jmx-remoting.classpath"/>
       <path refid="jboss.test.classpath"/>

Copied: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/JBPAPP7128UnitTestCase.java (from rev 112247, branches/JBPAPP_5_1_3_interim/testsuite/src/main/org/jboss/test/ejb3/JBPAPP7128UnitTestCase.java)
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/JBPAPP7128UnitTestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/JBPAPP7128UnitTestCase.java	2012-01-09 05:16:20 UTC (rev 112559)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.ejb3;
+
+import org.jboss.as.javaee.SimpleJavaEEModuleInformer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext;
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
+import org.jboss.metadata.ear.jboss.JBossAppMetaData;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * @author bmaxwell
+ *
+ */
+public class JBPAPP7128UnitTestCase extends JBossTestCase
+{
+   private DeploymentUnit topLevelDeploymentUnit;
+   private DeploymentUnit nonTopLevelDeploymentUnit;
+
+   public JBPAPP7128UnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {    
+      super.setUp();
+      
+      String name = "TopLevelDeploymentUnitName";
+      String simpleName = "TopLevelDeploymentUnitNameSimpleName";
+      String relativePath = "TopLevelDeploymentUnitNameRelativePath";
+           
+      nonTopLevelDeploymentUnit = new AbstractDeploymentUnit(new AbstractDeploymentContext("non"+name, "non"+simpleName, "non"+relativePath));
+      
+      topLevelDeploymentUnit = new AbstractDeploymentUnit(new AbstractDeploymentContext(name, simpleName, relativePath));
+      topLevelDeploymentUnit.addAttachment(JBossAppMetaData.class, new JBossAppMetaData());                     
+   }
+   
+   public void testGetModulePathTopLevelDeploymentUnit()
+   {               
+      String modulePath = new SimpleJavaEEModuleInformer().getModulePath(topLevelDeploymentUnit);
+            
+      if(!modulePath.equals(topLevelDeploymentUnit.getRelativePath()))
+         fail("SimpleJavaEEModuleInformer.getModulePath(DeploymentInfo) should return DeploymentInfo.getRelativePath()="+ topLevelDeploymentUnit.getRelativePath() + " for top level deployment not unit.getSimpleName(), modulePath="+ modulePath);
+   }
+   
+   public void testGetModulePathNonTopLevelDeploymentUnit()
+   {      
+      String modulePath = new SimpleJavaEEModuleInformer().getModulePath(nonTopLevelDeploymentUnit);
+      
+      if(!modulePath.equals(nonTopLevelDeploymentUnit.getSimpleName()))
+         fail("SimpleJavaEEModuleInformer.getModulePath(DeploymentInfo) should return DeploymentInfo.getSimpleName()="+ nonTopLevelDeploymentUnit.getSimpleName() +" not unit.getRelativePath(), modulePath=" + modulePath);            
+   }
+}



More information about the jboss-cvs-commits mailing list