chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r954577 - /incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjectGenerator.java
Date Mon, 14 Jun 2010 18:16:48 GMT
Author: jens
Date: Mon Jun 14 18:16:48 2010
New Revision: 954577

URL: http://svn.apache.org/viewvc?rev=954577&view=rev
Log:
make ObjectGenerator more unit test friendly and avoid static counters for setting property
values

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjectGenerator.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjectGenerator.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjectGenerator.java?rev=954577&r1=954576&r2=954577&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjectGenerator.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-util/src/main/java/org/apache/chemistry/opencmis/util/repository/ObjectGenerator.java
Mon Jun 14 18:16:48 2010
@@ -118,8 +118,8 @@ public class ObjectGenerator {
     private static final String NAMEPROPVALPREFIXFOLDER = "My_Folder-";
     private static final String STRINGPROPVALPREFIXDOC = "My Doc StringProperty ";
     private static final String STRINGPROPVALPREFIXFOLDER = "My Folder StringProperty ";
-    private static int PROPVALCOUNTER_DOC_STRING_PROP = 0;
-    private static int PROPVALCOUNTER_FOLDER_STRING_PROP = 0;
+    private int propValCounterDocString = 0;
+    private int propValCounterFolderString = 0;
     /**
      * use UUIDs to generate folder and document names
      */
@@ -496,12 +496,12 @@ public class ObjectGenerator {
         return props;
     }
 
-    private static synchronized int incrementPropCounterDocStringProp() {
-        return PROPVALCOUNTER_DOC_STRING_PROP++;
+    private synchronized int incrementPropCounterDocStringProp() {
+        return propValCounterDocString++;
     }
 
-    private static synchronized int incrementPropCounterFolderStringProp() {
-        return PROPVALCOUNTER_FOLDER_STRING_PROP++;
+    private synchronized int incrementPropCounterFolderStringProp() {
+        return propValCounterFolderString++;
     }
 
     private String generateDocNameValue(int no, int level) {
@@ -518,11 +518,11 @@ public class ObjectGenerator {
             return NAMEPROPVALPREFIXFOLDER + level + "-" + no;
     }
 
-    private static String generateStringPropValueDoc() {
+    private String generateStringPropValueDoc() {
         return STRINGPROPVALPREFIXDOC + incrementPropCounterDocStringProp();
     }
 
-    private static String generateStringPropValueFolder() {
+    private String generateStringPropValueFolder() {
         return STRINGPROPVALPREFIXFOLDER + incrementPropCounterFolderStringProp();
     }
 



Mime
View raw message