You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by st...@apache.org on 2015/06/02 20:04:27 UTC

svn commit: r1683154 - in /openjpa/trunk: ./ openjpa-jdbc/ openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/ openjpa-persistence-jdbc/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/ openjpa-project/ openjpa-slice/ ...

Author: struberg
Date: Tue Jun  2 18:04:26 2015
New Revision: 1683154

URL: http://svn.apache.org/r1683154
Log:
OPENJPA-2595 upgrade our test suite to junit-4

Added:
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/SampleEntity.java
      - copied, changed from r1683098, openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/TestEntity.java
Removed:
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/TestEntity.java
Modified:
    openjpa/trunk/openjpa-jdbc/pom.xml
    openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDB2Dictionary.java
    openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDBDictionaryGeneratedSQL.java
    openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java
    openjpa/trunk/openjpa-persistence-jdbc/pom.xml
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/DynamicEnhancementSuite.java
    openjpa/trunk/openjpa-project/BUILDING.txt
    openjpa/trunk/openjpa-project/README.txt
    openjpa/trunk/openjpa-slice/pom.xml
    openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestTransaction.java
    openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/pom.xml
    openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/resources/META-INF/persistence.xml
    openjpa/trunk/pom.xml

Modified: openjpa/trunk/openjpa-jdbc/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/pom.xml?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/pom.xml (original)
+++ openjpa/trunk/openjpa-jdbc/pom.xml Tue Jun  2 18:04:26 2015
@@ -81,7 +81,7 @@
         </dependency>
         <dependency>
             <groupId>org.jmock</groupId>
-            <artifactId>jmock-junit3</artifactId>
+            <artifactId>jmock-junit4</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>

Modified: openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDB2Dictionary.java?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDB2Dictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDB2Dictionary.java Tue Jun  2 18:04:26 2015
@@ -28,15 +28,23 @@ import javax.sql.DataSource;
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.kernel.StoreContext;
 import org.jmock.Expectations;
-import org.jmock.integration.junit3.MockObjectTestCase;
-
-public class TestDB2Dictionary extends MockObjectTestCase {
-    final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
-    final Statement mockStatement = mock(Statement.class);
-    final Connection mockConnection = mock(Connection.class);
-    final ResultSet mockRS = mock(ResultSet.class);
-    final DataSource mockDS = mock(DataSource.class);
-    final DatabaseMetaData mockMetaData = mock(DatabaseMetaData.class);
+import org.jmock.integration.junit4.JUnitRuleMockery;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+
+public class TestDB2Dictionary {
+    @Rule
+    public JUnitRuleMockery context = new JUnitRuleMockery();
+    
+    final JDBCConfiguration mockConfiguration = context.mock(JDBCConfiguration.class);
+    final Statement mockStatement = context.mock(Statement.class);
+    final Connection mockConnection = context.mock(Connection.class);
+    final ResultSet mockRS = context.mock(ResultSet.class);
+    final DataSource mockDS = context.mock(DataSource.class);
+    final DatabaseMetaData mockMetaData = context.mock(DatabaseMetaData.class);
 
     final StoreContext sc = null;
     final String schema = "abcd";
@@ -44,11 +52,13 @@ public class TestDB2Dictionary extends M
     /*
      * When DS1 is non null we should get a connection and use it to obtain the schema name.
      */
+    @Test
     public void testGetDefaultSchemaNameDS1() throws Exception {
         // Expected method calls on the mock objects above. If any of these are
         // do not occur, or if any other methods are invoked on the mock objects
         // an exception will be thrown and the test will fail.
-        checking(new Expectations() {
+        context.checking(new Expectations()
+        {
             {
                 // Wiring, make sure the appropriate mocks are created.
                 oneOf(mockConfiguration).getDataSource(with(equal(sc)));
@@ -89,11 +99,13 @@ public class TestDB2Dictionary extends M
     /*
      * When ds1 is null, fallback to ds2
      */
+    @Test
     public void testGetDefaultSchemaNameDS2() throws Exception {
         // Expected method calls on the mock objects above. If any of these are
         // do not occur, or if any other methods are invoked on the mock objects
         // an exception will be thrown and the test will fail.
-        checking(new Expectations() {
+        context.checking(new Expectations()
+        {
             {
                 // Wiring, make sure the appropriate mocks are created.
                 oneOf(mockConfiguration).getDataSource(with(equal(sc)));
@@ -137,11 +149,13 @@ public class TestDB2Dictionary extends M
     /*
      * When ds1 is null, fallback to ds2
      */
+    @Test
     public void testGetDefaultSchemaNameNoDS() throws Exception {
         // Expected method calls on the mock objects above. If any of these are
         // do not occur, or if any other methods are invoked on the mock objects
         // an exception will be thrown and the test will fail.
-        checking(new Expectations() {
+        context.checking(new Expectations()
+        {
             {
                 // both datasources are null for this test.
                 oneOf(mockConfiguration).getDataSource(with(equal(sc)));
@@ -163,12 +177,14 @@ public class TestDB2Dictionary extends M
     /*
      * TestWhitespace trim
      */
+    @Test
     public void testGetDefaultSchemaNameTrimmed() throws Exception {
         final String schema2 = "abcd     ";
         // Expected method calls on the mock objects above. If any of these are
         // do not occur, or if any other methods are invoked on the mock objects
         // an exception will be thrown and the test will fail.
-        checking(new Expectations() {
+        context.checking(new Expectations()
+        {
             {
                 // Wiring, make sure the appropriate mocks are created.
                 oneOf(mockConfiguration).getDataSource(with(equal(sc)));
@@ -209,15 +225,17 @@ public class TestDB2Dictionary extends M
     /*
      * Verifies that the ConnectedConfiguration method only uses the DBMetaData to determine the correct behavior.
      */
+    @Test
     public void testConnectedConfigurationOnlyUsesMetaData() throws Exception {
-        checking(new Expectations() {
+        context.checking(new Expectations()
+        {
             {
                 // No activity on the connection other than getting the metadata. 
                 allowing(mockConnection).getMetaData();
                 will(returnValue(mockMetaData));
 
                 // anything on the configuration or DBMetaData is fair game. 
-                allowing(mockMetaData); 
+                allowing(mockMetaData);
                 allowing(mockConfiguration);
             }
         });

Modified: openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDBDictionaryGeneratedSQL.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDBDictionaryGeneratedSQL.java?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDBDictionaryGeneratedSQL.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestDBDictionaryGeneratedSQL.java Tue Jun  2 18:04:26 2015
@@ -24,18 +24,27 @@ import org.apache.openjpa.jdbc.identifie
 import org.apache.openjpa.jdbc.schema.Table;
 import org.apache.openjpa.util.UserException;
 import org.jmock.Expectations;
-import org.jmock.integration.junit3.MockObjectTestCase;
+import org.jmock.integration.junit4.JUnitRuleMockery;
+import org.junit.Rule;
+import org.junit.Test;
 
-public class TestDBDictionaryGeneratedSQL extends MockObjectTestCase {
+import static org.junit.Assert.*;
 
+public class TestDBDictionaryGeneratedSQL {
+
+    @Rule
+    public JUnitRuleMockery context = new JUnitRuleMockery();
+
+    @Test
     public void testCreateTableLongNameException() {
-        final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
+        final JDBCConfiguration mockConfiguration = context.mock(JDBCConfiguration.class);
         final DBIdentifierUtilImpl idImpl = new DBIdentifierUtilImpl();
-        
-        checking(new Expectations() {
+
+        context.checking(new Expectations()
+        {
             {
                 allowing(mockConfiguration).getIdentifierUtilInstance();
-                will(returnValue(idImpl)); 
+                will(returnValue(idImpl));
 
                 allowing(mockConfiguration);
             }
@@ -56,16 +65,18 @@ public class TestDBDictionaryGeneratedSQ
             assertTrue(ue.getMessage().contains("Table name \"NameIsTooLong\""));
         }
     }
-    
-    
+
+
+    @Test
     public void testThrowsExceptionWithSchemaSet() {
-        final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
+        final JDBCConfiguration mockConfiguration = context.mock(JDBCConfiguration.class);
         final DBIdentifierUtilImpl idImpl = new DBIdentifierUtilImpl();
-        
-        checking(new Expectations() {
+
+        context.checking(new Expectations()
+        {
             {
                 allowing(mockConfiguration).getIdentifierUtilInstance();
-                will(returnValue(idImpl)); 
+                will(returnValue(idImpl));
 
                 allowing(mockConfiguration);
             }
@@ -87,15 +98,17 @@ public class TestDBDictionaryGeneratedSQ
             assertTrue(ue.getMessage().contains("Table name \"IAmASchema.NameIsTooLong\""));
         } 
     }
-    
+
+    @Test
     public void testSchemaNameIsNotConsidered() {
-        final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
+        final JDBCConfiguration mockConfiguration = context.mock(JDBCConfiguration.class);
         final DBIdentifierUtilImpl idImpl = new DBIdentifierUtilImpl();
-        
-        checking(new Expectations() {
+
+        context.checking(new Expectations()
+        {
             {
                 allowing(mockConfiguration).getIdentifierUtilInstance();
-                will(returnValue(idImpl)); 
+                will(returnValue(idImpl));
 
                 allowing(mockConfiguration);
             }
@@ -114,15 +127,17 @@ public class TestDBDictionaryGeneratedSQ
         assertTrue(sqls[0].contains("NameIsRight"));
         assertTrue(sqls[0].contains("IAmASchema"));
     }
-    
+
+    @Test
     public void testOverrideProperty() {
-        final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
+        final JDBCConfiguration mockConfiguration = context.mock(JDBCConfiguration.class);
         final DBIdentifierUtilImpl idImpl = new DBIdentifierUtilImpl();
-        
-        checking(new Expectations() {
+
+        context.checking(new Expectations()
+        {
             {
                 allowing(mockConfiguration).getIdentifierUtilInstance();
-                will(returnValue(idImpl)); 
+                will(returnValue(idImpl));
 
                 allowing(mockConfiguration);
             }
@@ -145,15 +160,17 @@ public class TestDBDictionaryGeneratedSQ
             assertTrue(ue.getMessage().contains("Table name \"IAmASchema.NameIsTooLong\""));
         } 
     }
-    
+
+    @Test
     public void testOverridePropertyShortName() {
-        final JDBCConfiguration mockConfiguration = mock(JDBCConfiguration.class);
+        final JDBCConfiguration mockConfiguration = context.mock(JDBCConfiguration.class);
         final DBIdentifierUtilImpl idImpl = new DBIdentifierUtilImpl();
-        
-        checking(new Expectations() {
+
+        context.checking(new Expectations()
+        {
             {
                 allowing(mockConfiguration).getIdentifierUtilInstance();
-                will(returnValue(idImpl)); 
+                will(returnValue(idImpl));
 
                 allowing(mockConfiguration);
             }

Modified: openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/TestMySQLDictionary.java Tue Jun  2 18:04:26 2015
@@ -26,9 +26,17 @@ import java.sql.ResultSet;
 import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.kernel.JDBCFetchConfigurationImpl;
 import org.jmock.Expectations;
-import org.jmock.integration.junit3.MockObjectTestCase;
+import org.jmock.integration.junit4.JUnitRuleMockery;
+import org.junit.Rule;
+import org.junit.Test;
+import static org.junit.Assert.*;
 
-public class TestMySQLDictionary extends MockObjectTestCase {
+public class TestMySQLDictionary {
+
+    @Rule
+    public JUnitRuleMockery context = new JUnitRuleMockery();
+
+    @Test
     public void testDBDictionaryGetBatchFetchSize() throws Exception {
         DBDictionary db = new MySQLDictionary();
         assertEquals(Integer.MIN_VALUE, db.getBatchFetchSize(1));
@@ -46,17 +54,19 @@ public class TestMySQLDictionary extends
      *             If any of the expectations are not met or any unexpected
      *             method calls are made
      */
+    @Test
     public void testPreparedStatementGetFetchBatchSize() throws Exception {
         DBDictionary db = new MySQLDictionary();
         SQLBuffer sql = new SQLBuffer(db);
         
-        final PreparedStatement mockStatement = mock(PreparedStatement.class);
-        final Connection mockConnection = mock(Connection.class);
+        final PreparedStatement mockStatement = context.mock(PreparedStatement.class);
+        final Connection mockConnection = context.mock(Connection.class);
 
         // Expected method calls on the mock objects above. If any of these are 
         // do not occur, or if any other methods are invoked on the mock objects
         // an exception will be thrown and the test will fail. 
-        checking(new Expectations() {
+        context.checking(new Expectations()
+        {
             {
                 oneOf(mockConnection).prepareStatement(with(any(String.class)));
                 will(returnValue(mockStatement));
@@ -81,17 +91,18 @@ public class TestMySQLDictionary extends
      *             If any of the expectations are not met or any unexpected
      *             method calls are made
      */
+    @Test
     public void testPreparedCallGetFetchBatchSize() throws Exception {
         DBDictionary db = new MySQLDictionary();
         SQLBuffer sql = new SQLBuffer(db);
         
-        final CallableStatement mockStatement = mock(CallableStatement.class);
-        final Connection mockConnection = mock(Connection.class);
+        final CallableStatement mockStatement = context.mock(CallableStatement.class);
+        final Connection mockConnection = context.mock(Connection.class);
 
         // Expected method calls on the mock objects above. If any of these are 
         // do not occur, or if any other methods are invoked on the mock objects
         // an exception will be thrown and the test will fail. 
-        checking(new Expectations() {
+        context.checking(new Expectations() {
             {
                 oneOf(mockConnection).prepareCall(with(any(String.class)));
                 will(returnValue(mockStatement));

Modified: openjpa/trunk/openjpa-persistence-jdbc/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/pom.xml?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/pom.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/pom.xml Tue Jun  2 18:04:26 2015
@@ -915,7 +915,7 @@
                     <excludes>
                         <!-- exclude classes that end with 'Test'; these
                              are not test cases per OpenJPA standards -->
-                        <exclude>org/apache/openjpa/**/*Test.java</exclude>
+                        <exclude>org/apache/openjpa/**/*Testq.java</exclude>
 
                         <!-- exclude classes that include a $; inner classes
                              are not test cases per OpenJPA standards -->

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/DynamicEnhancementSuite.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/DynamicEnhancementSuite.java?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/DynamicEnhancementSuite.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/DynamicEnhancementSuite.java Tue Jun  2 18:04:26 2015
@@ -113,6 +113,9 @@ import org.apache.openjpa.persistence.sp
 import org.apache.openjpa.persistence.xml.TestSimpleXmlEntity;
 import org.apache.openjpa.persistence.xml.TestXmlOverrideEntity;
 
+/**
+ * TODO: this should be refactored to a @RunWith or similar...
+ */
 public class DynamicEnhancementSuite extends TestCase {
     static {
         Persistence.createEntityManagerFactory("test", System.getProperties());
@@ -125,7 +128,7 @@ public class DynamicEnhancementSuite ext
         // with the dynamic enhaner.
         String test = System.getProperty("dynamicTest");
         if (test != null) {
-            suite.addTestSuite(Class.forName(test));
+            suite.addTestSuite((Class<? extends TestCase>) Class.forName(test));
         } else {
 
             // Subclassing failing tests

Modified: openjpa/trunk/openjpa-project/BUILDING.txt
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/BUILDING.txt?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/BUILDING.txt (original)
+++ openjpa/trunk/openjpa-project/BUILDING.txt Tue Jun  2 18:04:26 2015
@@ -180,3 +180,11 @@ Building and deploying the Site
 ===============================
 
 $ mvn site site:deploy -Pjavadoc-profile,docbook-profile
+
+
+Running unit tests in the Debugger
+==================================
+TODO: finish!
+-Dopenjpa.ConnectionURL=jdbc:derby:target/database/openjpa-derby-database;create=true -Dopenjpa.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver \
+
+

Modified: openjpa/trunk/openjpa-project/README.txt
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/README.txt?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/README.txt (original)
+++ openjpa/trunk/openjpa-project/README.txt Tue Jun  2 18:04:26 2015
@@ -12,3 +12,5 @@ Please refer to the following files for
 For documentation and project information, please visit our project site:
     http://openjpa.apache.org/
 
+
+

Modified: openjpa/trunk/openjpa-slice/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/pom.xml?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/pom.xml (original)
+++ openjpa/trunk/openjpa-slice/pom.xml Tue Jun  2 18:04:26 2015
@@ -133,6 +133,12 @@
                     <argLine>${test.jvm.arguments}</argLine>
                     <excludes>
                         <exclude>**/TestQueryMultiThreaded.java</exclude>
+
+                        <!-- exclude classes that include a $; inner classes
+                             are not test cases per OpenJPA standards -->
+                        <exclude>org/apache/openjpa/**/*$*.class</exclude>
+                        <exclude>org/apache/openjpa/**/*.*.class</exclude>
+
                     </excludes>
                     <systemProperties>
                         <property>

Modified: openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestTransaction.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestTransaction.java?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestTransaction.java (original)
+++ openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestTransaction.java Tue Jun  2 18:04:26 2015
@@ -24,6 +24,8 @@ import java.util.Random;
 import javax.persistence.EntityManager;
 import javax.persistence.RollbackException;
 
+import org.junit.Ignore;
+
 /**
  * Tests that if any of the slices fail then none of the slices are committed.
  * 
@@ -139,6 +141,7 @@ public class TestTransaction extends Sli
      * @author Pinaki Poddar
      *
      */
+    @Ignore
     public static class CarDistributorPolicy implements DistributionPolicy {
         public String distribute(Object pc, List<String> slices, Object context) {
             if (pc instanceof Manufacturer) {

Modified: openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/pom.xml?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/pom.xml (original)
+++ openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/pom.xml Tue Jun  2 18:04:26 2015
@@ -57,8 +57,6 @@
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
-			<scope>test</scope>
-			<version>3.8.1</version>
 		</dependency>
 	</dependencies>
   

Copied: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/SampleEntity.java (from r1683098, openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/TestEntity.java)
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/SampleEntity.java?p2=openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/SampleEntity.java&p1=openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/TestEntity.java&r1=1683098&r2=1683154&rev=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/TestEntity.java (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/java/org/apache/openjpa/tools/maven/testentity/SampleEntity.java Tue Jun  2 18:04:26 2015
@@ -22,17 +22,18 @@ import javax.persistence.Entity;
 import javax.persistence.Id;
 
 @Entity
-public class TestEntity {
+public class SampleEntity
+{
 
   @Id
   private int xint1;
 
   private String string1;
 
-  public TestEntity() {
+  public SampleEntity() {
   }
 
-  public TestEntity(int int1, String string1) {
+  public SampleEntity(int int1, String string1) {
     this.xint1 = int1;
     this.string1 = string1;
   }

Modified: openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/resources/META-INF/persistence.xml?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/resources/META-INF/persistence.xml (original)
+++ openjpa/trunk/openjpa-tools/openjpa-maven-plugin/src/test/resources/META-INF/persistence.xml Tue Jun  2 18:04:26 2015
@@ -23,7 +23,7 @@
 
     <!-- simply all annotated persistent entities will be part of this unit -->
     <persistence-unit name="TestUnit">
-        <class>org.apache.openjpa.tools.maven.testentity.TestEntity</class>
+        <class>org.apache.openjpa.tools.maven.testentity.SampleEntity</class>
 
         <properties>
             <property name="openjpa.jdbc.DBDictionary" value="hsql" />

Modified: openjpa/trunk/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/pom.xml?rev=1683154&r1=1683153&r2=1683154&view=diff
==============================================================================
--- openjpa/trunk/pom.xml (original)
+++ openjpa/trunk/pom.xml Tue Jun  2 18:04:26 2015
@@ -90,6 +90,7 @@
         <compile.testclass.target>${java.testclass.version}</compile.testclass.target>
 
         <maven.javadoc.version>2.9.1</maven.javadoc.version>
+        <maven.surefire.version>2.5</maven.surefire.version>
     </properties>
 
     <licenses>
@@ -373,6 +374,7 @@
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
+                       <version>${maven.surefire.version}</version>
                        <configuration>
                            <argLine>${surefire.jvm.args}</argLine>
                            <includes>
@@ -603,17 +605,24 @@
             <dependency>
                 <groupId>org.jmock</groupId>
                 <artifactId>jmock</artifactId>
-                <version>2.5.1</version>
+                <version>2.8.1</version>
             </dependency>
             <dependency>
                 <groupId>org.jmock</groupId>
-                <artifactId>jmock-junit3</artifactId>
-                <version>2.5.1</version>
+                <artifactId>jmock-junit4</artifactId>
+                <version>2.8.1</version>
             </dependency>
             <dependency>
                 <groupId>junit</groupId>
                 <artifactId>junit</artifactId>
-                <version>3.8.1</version>
+                <version>4.9</version>
+                <exclusions>
+                    <exclusion>
+                        <!-- as this clashes with the hamcrest version used in jmock -->
+                        <groupId>org.hamcrest</groupId>
+                        <artifactId>hamcrest-core</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
             <dependency>
                 <groupId>net.sourceforge.findbugs</groupId>
@@ -667,12 +676,18 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
-                    <version>2.5</version>
+                    <version>${maven.surefire.version}</version>
                     <configuration>
                         <argLine>${surefire.jvm.args}</argLine>
                         <useFile>false</useFile>
                         <trimStackTrace>false</trimStackTrace>
                         <useSystemClassLoader>true</useSystemClassLoader>
+                        <excludes>
+                            <!-- exclude classes that include a $; inner classes
+                                 are not test cases per OpenJPA standards -->
+                            <exclude>org/apache/openjpa/**/*$*.class</exclude>
+                            <exclude>org/apache/openjpa/**/*.*.class</exclude>
+                        </excludes>
                     <systemProperties>
                         <property>
                             <name>openjpa.Log</name>
@@ -728,7 +743,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-report-plugin</artifactId>
-                    <version>2.6</version>
+                    <version>${maven.surefire.version}</version>
                 </plugin>
                 <plugin>
                     <groupId>org.codehaus.mojo</groupId>