[jboss-cvs] JBossAS SVN: r96160 - in branches/JBPAPP_5_0/testsuite: imports/sections and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Nov 9 04:12:28 EST 2009


Author: bstansberry at jboss.com
Date: 2009-11-09 04:12:28 -0500 (Mon, 09 Nov 2009)
New Revision: 96160

Added:
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/clusteredentity/
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity/
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/jpa/entity/
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/jpa/entityoptimisticlocking/
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/jpa/test/EntityOptimisticLockingUnitTestCase.java
   branches/JBPAPP_5_0/testsuite/src/resources/cluster/clusteredentity/
   branches/JBPAPP_5_0/testsuite/src/resources/jpa/entityoptimisticlocking/
Modified:
   branches/JBPAPP_5_0/testsuite/imports/config/tests-clustering.xml
   branches/JBPAPP_5_0/testsuite/imports/sections/cluster.xml
   branches/JBPAPP_5_0/testsuite/imports/sections/jpa.xml
Log:
[JBPAPP-3055] Move in clusteredentity and entityoptmisticlocking unit tests from ejb3

Modified: branches/JBPAPP_5_0/testsuite/imports/config/tests-clustering.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/imports/config/tests-clustering.xml	2009-11-09 08:07:19 UTC (rev 96159)
+++ branches/JBPAPP_5_0/testsuite/imports/config/tests-clustering.xml	2009-11-09 09:12:28 UTC (rev 96160)
@@ -19,6 +19,8 @@
    
     <!-- These are web tier tests that shouldn't be repeated with REPL_SYNC, etc -->
     <include name="org/jboss/test/cluster/defaultcfg/simpleweb/test/*TestCase.class"/>
+  	
+    <include name="org/jboss/test/cluster/defaultcfg/clusteredentity/test/*TestCase.class"/>
     
     <include name="org/jboss/test/cluster/multicfg/test/*TestCase.class"/>
     <include name="org/jboss/test/cluster/multicfg/ejb2/test/*TestCase.class"/>

Modified: branches/JBPAPP_5_0/testsuite/imports/sections/cluster.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/imports/sections/cluster.xml	2009-11-09 08:07:19 UTC (rev 96159)
+++ branches/JBPAPP_5_0/testsuite/imports/sections/cluster.xml	2009-11-09 09:12:28 UTC (rev 96160)
@@ -706,6 +706,139 @@
             <include name="org/jboss/test/cluster/web/persistent/PersistentStoreTableSetup.class"/>
          </fileset>
       </jar>    
+   	
+   	<!-- JPA Clustered Second Level Cache -->
+      <jar jarfile="${build.lib}/clusteredentity-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/cluster/clusteredentity/*.class"/>
+         </fileset>
+         <fileset dir="${build.resources}/cluster/clusteredentity">
+            <include name="META-INF/persistence.xml"/>
+         </fileset>
+      </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-optimistic-test.jar">
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/test/cluster/clusteredentity/*.class"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/optimistic">
+          <include name="META-INF/persistence.xml"/>
+       </fileset>
+    </jar>
+
+      <jar jarfile="${build.lib}/clusteredentity-classloader-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/cluster/clusteredentity/classloader/*.class"/>
+         </fileset>
+         <fileset dir="${build.resources}/cluster/clusteredentity/classloader">
+            <include name="META-INF/persistence.xml"/>
+         </fileset>
+      </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-classloader-optimistic-test.jar">
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/test/cluster/clusteredentity/classloader/*.class"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/classloader/optimistic">
+          <include name="META-INF/persistence.xml"/>
+          <!--include name="META-INF/jboss.xml"/-->
+       </fileset>
+    </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-classloader-test.ear">
+       <fileset dir="${build.lib}">
+          <include name="clusteredentity-classloader-test.jar"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/classloader">
+          <include name="META-INF/application.xml"/>
+          <include name="META-INF/jboss-app.xml"/>
+        <include name="clusteredentity-ds.xml"/>
+       </fileset>
+    </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-classloader-optimistic-test.ear">
+       <fileset dir="${build.lib}">
+          <include name="clusteredentity-classloader-optimistic-test.jar"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/classloader">
+          <include name="META-INF/jboss-app.xml"/>
+          <include name="clusteredentity-ds.xml"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/classloader/optimistic">
+          <include name="META-INF/application.xml"/>
+          <include name="META-INF/jboss-app.xml"/>
+          <include name="clusteredentity-ds.xml"/>
+       </fileset>
+    </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-providedprefix-test.jar">
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/test/cluster/clusteredentity/classloader/*.class"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/providedprefix">
+          <include name="META-INF/persistence.xml"/>
+       </fileset>
+    </jar>
+
+  <jar jarfile="${build.lib}/clusteredentity-providedprefix-test.ear">
+     <fileset dir="${build.lib}">
+        <include name="clusteredentity-providedprefix-test.jar"/>
+     </fileset>
+     <fileset dir="${build.resources}/cluster/clusteredentity/providedprefix">
+        <include name="META-INF/application.xml"/>
+        <include name="META-INF/jboss-app.xml"/>
+      <include name="clusteredentity-ds.xml"/>
+     </fileset>
+     <fileset dir="${build.resources}/cluster/clusteredentity/classloader">
+        <include name="clusteredentity-ds.xml"/>
+     </fileset>
+  </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-embeddedid-test.jar">
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/test/cluster/clusteredentity/embeddedid/*.class"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/classloader">
+          <include name="META-INF/persistence.xml"/>
+       </fileset>
+    </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-embeddedid-optimistic-test.jar">
+       <fileset dir="${build.classes}">
+          <include name="org/jboss/test/cluster/clusteredentity/embeddedid/*.class"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/classloader/optimistic">
+          <include name="META-INF/persistence.xml"/>
+          <!--include name="META-INF/jboss.xml"/-->
+       </fileset>
+    </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-embeddedid-test.ear">
+       <fileset dir="${build.lib}">
+          <include name="clusteredentity-embeddedid-test.jar"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/classloader">
+          <include name="META-INF/jboss-app.xml"/>
+          <include name="clusteredentity-ds.xml"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/embeddedid">
+         <include name="META-INF/application.xml"/>
+       </fileset>
+    </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-embeddedid-optimistic-test.ear">
+       <fileset dir="${build.lib}">
+          <include name="clusteredentity-embeddedid-optimistic-test.jar"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/classloader">
+          <include name="META-INF/jboss-app.xml"/>
+          <include name="clusteredentity-ds.xml"/>
+       </fileset>
+       <fileset dir="${build.resources}/cluster/clusteredentity/embeddedid/optimistic">
+         <include name="META-INF/application.xml"/>
+       </fileset>
+    </jar>
+
       
    </target>
  

Modified: branches/JBPAPP_5_0/testsuite/imports/sections/jpa.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/imports/sections/jpa.xml	2009-11-09 08:07:19 UTC (rev 96159)
+++ branches/JBPAPP_5_0/testsuite/imports/sections/jpa.xml	2009-11-09 09:12:28 UTC (rev 96160)
@@ -54,6 +54,16 @@
          </fileset>
       </jar>
 
+      <jar jarfile="${build.lib}/entityoptimisticlocking-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/jpa/entity/*.class"/>
+         </fileset>
+         <fileset dir="${build.resources}/jpa/entityoptimisticlocking">
+            <include name="META-INF/persistence.xml"/>
+         </fileset>
+      </jar>
+
+
    </target>
 
 </project>

Copied: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/clusteredentity (from rev 96159, trunk/testsuite/src/main/org/jboss/test/cluster/clusteredentity)

Copied: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity (from rev 96159, trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/clusteredentity)

Copied: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/jpa/entity (from rev 96159, trunk/testsuite/src/main/org/jboss/test/jpa/entity)

Copied: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/jpa/entityoptimisticlocking (from rev 96159, trunk/testsuite/src/main/org/jboss/test/jpa/entityoptimisticlocking)

Copied: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/jpa/test/EntityOptimisticLockingUnitTestCase.java (from rev 96159, branches/Branch_5_x/testsuite/src/main/org/jboss/test/jpa/test/EntityOptimisticLockingUnitTestCase.java)
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/jpa/test/EntityOptimisticLockingUnitTestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/jpa/test/EntityOptimisticLockingUnitTestCase.java	2009-11-09 09:12:28 UTC (rev 96160)
@@ -0,0 +1,213 @@
+/*
+ * 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.jpa.test;
+
+import java.util.Set;
+
+import org.jboss.test.jpa.entity.Address;
+import org.jboss.test.jpa.entity.Company;
+import org.jboss.test.jpa.entity.Customer;
+import org.jboss.test.jpa.entity.EntityTest;
+import org.jboss.test.jpa.entity.FieldAddress;
+import org.jboss.test.jpa.entity.FieldCompany;
+import org.jboss.test.jpa.entity.FieldCustomer;
+import org.jboss.test.jpa.entity.FieldFlight;
+import org.jboss.test.jpa.entity.FieldTicket;
+import org.jboss.test.jpa.entity.Flight;
+import org.jboss.test.jpa.entity.Ticket;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Sample client for the jboss container.
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Id: EntityUnitTestCase.java 57207 2006-09-26 12:06:13Z dimitris at jboss.org $
+ */
+
+public class EntityOptimisticLockingUnitTestCase
+extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(EntityOptimisticLockingUnitTestCase.class);
+
+   static boolean deployed = false;
+   static int test = 0;
+
+   public EntityOptimisticLockingUnitTestCase(String name)
+   {
+
+      super(name);
+
+   }
+
+   public void testOneToMany() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      Customer c = test.oneToManyCreate();
+      assertNotNull(c);
+      assertNotNull(c.getTickets());
+      Set<Ticket> tickets = c.getTickets();
+      assertTrue(tickets.size() > 0);
+
+      // test find
+      c = test.findCustomerById(c.getId());
+      assertNotNull(c);
+      assertNotNull(c.getTickets());
+      tickets = c.getTickets();
+      assertTrue(tickets.size() > 0);
+
+      // test 1-1
+      Address address = c.getAddress();
+      assertTrue(address != null);
+      assertTrue(address.getCity().equals("Boston"));
+   }
+
+   public void testManyToOne() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      Flight f = test.manyToOneCreate();
+      f = test.findFlightById(f.getId());
+      assertTrue(f.getName().equals("AF0101"));
+      assertTrue(f.getCompany().getName().equals("Air France"));
+
+      Company c = test.findCompanyById(f.getCompany().getId());
+      assertTrue(c != null);
+      assertTrue(c.getFlights().size() == 1);
+   }
+
+   public void testManyToMany() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      test.manyToManyCreate();
+
+      Flight one = test.findFlightById(new Long(1));
+      assertTrue(one.getCompany().getName().equals("Air France"));
+
+      Flight two = test.findFlightById(new Long(2));
+      assertTrue(two.getCompany().getName().equals("USAir"));
+
+      System.out.println("Air France customers");
+      for (Customer c : one.getCustomers())
+      {
+         System.out.println(c.getName());
+
+      }
+      System.out.println("USAir customers");
+
+      for (Customer c : two.getCustomers())
+      {
+         System.out.println(c.getName());
+      }
+
+   }
+
+   public void testFieldOneToMany() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      FieldCustomer c = test.fieldOneToManyCreate();
+      assertNotNull(c);
+      assertNotNull(c.getTickets());
+      Set<FieldTicket> tickets = c.getTickets();
+      assertTrue(tickets.size() > 0);
+
+      // test find
+      c = test.fieldFindCustomerById(c.getId());
+      assertNotNull(c);
+      assertNotNull(c.getTickets());
+      tickets = c.getTickets();
+      assertTrue(tickets.size() > 0);
+
+      // test 1-1
+      FieldAddress address = c.getAddress();
+      assertTrue(address != null);
+      assertTrue(address.getCity().equals("Boston"));
+   }
+
+   public void testFieldManyToOne() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      FieldFlight f = test.fieldManyToOneCreate();
+      f = test.fieldFindFlightById(f.getId());
+      assertTrue(f.getName().equals("AF0101"));
+      assertTrue(f.getCompany().getName().equals("Air France"));
+
+      FieldCompany c = test.fieldFindCompanyById(f.getCompany().getId());
+      assertTrue(c != null);
+      assertTrue(c.getFlights().size() == 1);
+   }
+
+   public void testFieldManyToMany() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      test.fieldManyToManyCreate();
+
+      FieldFlight one = test.fieldFindFlightById(new Long(1));
+      assertTrue(one.getCompany().getName().equals("Air France"));
+
+      FieldFlight two = test.fieldFindFlightById(new Long(2));
+      assertTrue(two.getCompany().getName().equals("USAir"));
+
+      System.out.println("Air France customers");
+      for (FieldCustomer c : one.getCustomers())
+      {
+         System.out.println(c.getName());
+
+      }
+      System.out.println("USAir customers");
+
+      for (FieldCustomer c : two.getCustomers())
+      {
+         System.out.println(c.getName());
+      }
+
+   }
+
+   public void testNamedQueries() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      test.testNamedQueries();      
+   }
+
+   public void testOutsideTx() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      test.testOutsideTransaction();      
+
+   }
+   
+   public void testFlush() throws Exception
+   {
+      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
+      Customer c = test.createCustomer("Emmanuel");
+	  test.changeCustomer(c.getId(), "Bill");
+	  Customer c2 = test.loadCustomer(c.getId());
+	  assertEquals("Bill", c2.getName());
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(EntityOptimisticLockingUnitTestCase.class, "entityoptimisticlocking-test.jar");
+   }
+
+}

Copied: branches/JBPAPP_5_0/testsuite/src/resources/cluster/clusteredentity (from rev 96159, trunk/testsuite/src/resources/cluster/clusteredentity)

Copied: branches/JBPAPP_5_0/testsuite/src/resources/jpa/entityoptimisticlocking (from rev 96159, trunk/testsuite/src/resources/jpa/entityoptimisticlocking)




More information about the jboss-cvs-commits mailing list