[Jboss-cvs] JBossAS SVN: r56709 - trunk/testsuite/src/main/org/jboss/test/cmp2/lob

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 11 05:16:48 EDT 2006


Author: dimitris at jboss.org
Date: 2006-09-11 05:16:45 -0400 (Mon, 11 Sep 2006)
New Revision: 56709

Modified:
   trunk/testsuite/src/main/org/jboss/test/cmp2/lob/LOBUnitTestCase.java
Log:
JBAS-3497, the execution order of tests in this test case is important so it must be defined explicitly when running under some JVMs - also, synch with Branch_4_0

Modified: trunk/testsuite/src/main/org/jboss/test/cmp2/lob/LOBUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cmp2/lob/LOBUnitTestCase.java	2006-09-11 09:14:56 UTC (rev 56708)
+++ trunk/testsuite/src/main/org/jboss/test/cmp2/lob/LOBUnitTestCase.java	2006-09-11 09:16:45 UTC (rev 56709)
@@ -1,44 +1,44 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt 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.
-  */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.cmp2.lob;
 
-
 import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
 import java.io.StringWriter;
-import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.List;
 
+import javax.naming.InitialContext;
 import javax.rmi.PortableRemoteObject;
-import javax.naming.InitialContext;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
 import net.sourceforge.junitejb.EJBTestCase;
-import junit.framework.Test;
 
 import org.jboss.logging.Logger;
 import org.jboss.test.JBossTestCase;
 
-
 /**
  * A test suite to check JBoss data mapping to/from Large Binary Objects (LOBs).
  *
@@ -59,6 +59,7 @@
    private String BIG_TEXT_FILE_PATH = "data/page.html";
    private String SMALL_BINARY_FILE_PATH = "data/smallimage.png";
    private String BIG_BINARY_FILE_PATH = "data/image.png";
+   static final String PI = "3.14159265358979323846264338327950288419716939937510";
 
    // Attributes ----------------------------------------------------
    private LOBHome lobHome;
@@ -73,10 +74,32 @@
 
    private static final Logger log = Logger.getLogger(LOBUnitTestCase.class);
 
-   public static Test suite()
-      throws Exception
+   public static Test suite() throws Exception
    {
-      return JBossTestCase.getDeploySetup(LOBUnitTestCase.class, "cmp2-lob.jar");
+      // JBAS-3497, the execution order of tests in this test case is important
+      // so it must be defined explicitly when running under some JVMs
+      TestSuite suite = new TestSuite();
+      suite.addTest(new LOBUnitTestCase("testCreate0"));
+      suite.addTest(new LOBUnitTestCase("testNullLoad"));
+      suite.addTest(new LOBUnitTestCase("testCreate1"));
+      suite.addTest(new LOBUnitTestCase("testLoad1"));
+      suite.addTest(new LOBUnitTestCase("testCreate2"));
+      suite.addTest(new LOBUnitTestCase("testLoad2"));
+      suite.addTest(new LOBUnitTestCase("testCreate3"));
+      suite.addTest(new LOBUnitTestCase("testLoad3"));
+      suite.addTest(new LOBUnitTestCase("testCreate4"));
+      suite.addTest(new LOBUnitTestCase("testLoad4"));
+      suite.addTest(new LOBUnitTestCase("testTextLoad"));
+      suite.addTest(new LOBUnitTestCase("testBinaryLoad"));
+      suite.addTest(new LOBUnitTestCase("testMapCMPField"));
+      suite.addTest(new LOBUnitTestCase("testSetCMPField"));
+      suite.addTest(new LOBUnitTestCase("testListCMPField"));
+      suite.addTest(new LOBUnitTestCase("testBinaryDataField"));
+      suite.addTest(new LOBUnitTestCase("testValueHolder"));
+      suite.addTest(new LOBUnitTestCase("testCleanGetValueHolder"));
+      suite.addTest(new LOBUnitTestCase("testStateFactoryValueHolder"));
+      
+      return JBossTestCase.getDeploySetup(suite, "cmp2-lob.jar");
    }
 
    // Constructors --------------------------------------------------
@@ -99,6 +122,7 @@
       LOB aLob = lobHome.create(LOB_PK0);
       aLob.setBigString(null);
       aLob.setBinaryData(null);
+      aLob.setObjectField(null);
    }
 
    /**
@@ -112,6 +136,7 @@
       LOB aLob = lobHome.findByPrimaryKey(LOB_PK0);
       assertNull(aLob.getBigString());
       assertNull(aLob.getBinaryData());
+      assertNull(aLob.getObjectField());
    }
 
    /**
@@ -124,6 +149,10 @@
       LOB aLob = lobHome.create(LOB_PK1);
       aLob.setBigString(smallString);
       aLob.setBinaryData(smallBlob);
+      BlobInfo info = new BlobInfo();
+      info.setBytes(PI.getBytes());
+      info.setNumber(314);
+      aLob.setObjectField(info);
    }
 
    /**
@@ -136,6 +165,9 @@
       LOB aLob = lobHome.findByPrimaryKey(LOB_PK1);
       assertEquals(smallString, aLob.getBigString());
       assertEquals(smallBlob, aLob.getBinaryData());
+      BlobInfo info = (BlobInfo) aLob.getObjectField();
+      assertTrue(Arrays.equals(info.getBytes(), PI.getBytes()));
+      assertTrue(info.getNumber() == 314);
    }
 
    /**




More information about the jboss-cvs-commits mailing list