chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfermig...@apache.org
Subject svn commit: r1096340 [6/7] - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/ chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/j...
Date Sun, 24 Apr 2011 16:12:31 GMT
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/EvalQueryTest.java Sun Apr 24 16:12:27 2011
@@ -42,12 +42,13 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class EvalQueryTest extends AbstractServiceTest {
-    
+
     private static final Log log = LogFactory.getLog(EvalQueryTest.class);
     private QueryTestDataCreator dataCreator;
-    
+
+    @Override
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
 
         // initialize query object with type manager
         super.setTypeCreatorClass(UnitTestTypeSystemCreator.class.getName());
@@ -57,8 +58,9 @@ public class EvalQueryTest extends Abstr
         dataCreator.createBasicTestData();
     }
 
+    @Override
     @After
-    public void tearDown() throws Exception {
+    public void tearDown() {
         super.tearDown();
     }
 
@@ -70,49 +72,49 @@ public class EvalQueryTest extends Abstr
         assertTrue(resultContains("alpha", res));
         assertFalse(resultContains("jens", res));
     }
-    
+
     //////////////////////////////////////////////////////////////////////
     // Boolean tests
-    
+
     @Test
     public void testBooleanEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_BOOLEAN + "= true";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("delta", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
     }
-    
+
     @Test
     public void testBooleanNotEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_BOOLEAN + "= false";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("epsilon", res));
     }
-    
+
     //////////////////////////////////////////////////////////////////////
     // Integer tests
-    
+
     @Test
     public void testIntegerEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + "= 100";
         ObjectList res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("epsilon", res));
     }
-    
+
     @Test
     public void testIntegerNotEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + "<> 100";
         ObjectList res = doQuery(statement);
         assertEquals(4, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("delta", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
     }
 
     @Test
@@ -120,8 +122,8 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + "< 0";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
     }
 
     @Test
@@ -129,18 +131,18 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + "<= 0";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("gamma", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
     }
-    
+
     @Test
     public void testIntegerGreater() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + "> 0";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("delta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     @Test
@@ -148,31 +150,31 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + ">= 0";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("delta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     //////////////////////////////////////////////////////////////////////
     // Decimal tests
-    
+
     @Test
     public void testDecimalEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DECIMAL + "= 1.23456E-6";
         ObjectList res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("delta", res));        
+        assertTrue(resultContains("delta", res));
     }
-    
+
     @Test
     public void testDecimalNotEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DECIMAL + "<> 1.23456E-6";
         ObjectList res = doQuery(statement);
         assertEquals(4, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     @Test
@@ -180,8 +182,8 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DECIMAL + "< 1.23456E-6";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
     }
 
     @Test
@@ -189,18 +191,18 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DECIMAL + "<= 1.23456E-6";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("delta", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("delta", res));
     }
-    
+
     @Test
     public void testDecimalGreater() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DECIMAL + "> 1.23456E-6";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     @Test
@@ -208,31 +210,31 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DECIMAL + ">= 1.23456E-6";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("delta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
     }
-    
+
     //////////////////////////////////////////////////////////////////////
     // DateTime tests
-    
+
     @Test
     public void testDateEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DATETIME + "= TIMESTAMP '2038-01-20T00:00:00.000Z'";
         ObjectList res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("delta", res));        
+        assertTrue(resultContains("delta", res));
     }
-    
+
     @Test
     public void testDateNotEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DATETIME + "<> TIMESTAMP '2038-01-20T00:00:00.000Z'";
         ObjectList res = doQuery(statement);
         assertEquals(4, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     @Test
@@ -240,9 +242,9 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DATETIME + "< TIMESTAMP '2038-01-20T00:00:00.000Z'";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("gamma", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
     }
 
     @Test
@@ -250,10 +252,10 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DATETIME + "<= TIMESTAMP '2038-01-20T00:00:00.000Z'";
         ObjectList res = doQuery(statement);
         assertEquals(4, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("delta", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
     }
 
     @Test
@@ -261,7 +263,7 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DATETIME + "> TIMESTAMP '2038-01-20T00:00:00.000Z'";
         ObjectList res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("epsilon", res));
     }
 
     //    @Test
@@ -269,10 +271,10 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_DATETIME + ">= TIMESTAMP '2038-01-20T00:00:00.000Z'";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("delta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
     }
-    
+
     ////////////////////////////////////////////////////////////////////
     // String tests
 
@@ -281,18 +283,18 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + "= 'Alpha'";
         ObjectList res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
+        assertTrue(resultContains("alpha", res));
     }
-    
+
     @Test
     public void testStringNotEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + "<> 'Gamma'";
         ObjectList res = doQuery(statement);
         assertEquals(4, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("delta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     @Test
@@ -300,8 +302,8 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + "< 'Delta'";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
     }
 
     @Test
@@ -309,39 +311,39 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + "<= 'Delta'";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("delta", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("delta", res));
     }
-    
+
     @Test
     public void testStringGreater() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + "> 'Delta'";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("epsilon", res));
     }
-    
+
     @Test
     public void testStringGreaterOrEquals() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + ">= 'Delta'";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("delta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     ////////////////////////////////////////////////////////////////////
     // Boolean condition tests
-    
+
     @Test
     public void testAnd() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + "= 50 AND " + PROP_ID_BOOLEAN + "= true";
         ObjectList res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("delta", res));        
+        assertTrue(resultContains("delta", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + "= 50 AND " + PROP_ID_BOOLEAN + "= false";
         res = doQuery(statement);
@@ -353,8 +355,8 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + "= -50 OR " + PROP_ID_BOOLEAN + "= false";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     @Test
@@ -362,10 +364,10 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE NOT " + PROP_ID_INT + "= 50";
         ObjectList res = doQuery(statement);
         assertEquals(4, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("epsilon", res));
     }
 
     @Test
@@ -479,22 +481,22 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + " IS NULL";
         ObjectList res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("nulldoc", res));        
+        assertTrue(resultContains("nulldoc", res));
     }
-    
+
     @Test
     public void testIsNotNull() {
         dataCreator.createNullTestDocument();
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + PROP_ID_INT + " IS NOT NULL";
         ObjectList res = doQuery(statement);
         assertEquals(5, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));        
-        assertTrue(resultContains("beta", res));        
-        assertTrue(resultContains("gamma", res));        
-        assertTrue(resultContains("delta", res));        
-        assertTrue(resultContains("epsilon", res));        
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
     }
-    
+
     @Test
     public void patternTest() {
         String res = InMemoryQueryProcessor.translatePattern("ABC%def");
@@ -511,7 +513,7 @@ public class EvalQueryTest extends Abstr
         assertEquals("abc.*def.*ghi", res);
         res = InMemoryQueryProcessor.translatePattern("abc%def\\%ghi%jkl");
         assertEquals("abc.*def\\%ghi.*jkl", res);
-        
+
         res = InMemoryQueryProcessor.translatePattern("ABC_def");
         assertEquals("ABC.def", res);
         res = InMemoryQueryProcessor.translatePattern("_abc");
@@ -527,32 +529,32 @@ public class EvalQueryTest extends Abstr
         res = InMemoryQueryProcessor.translatePattern("abc_def\\_ghi_jkl");
         assertEquals("abc.def\\_ghi.jkl", res);
     }
-    
+
     @Test
     public void testLike() {
         dataCreator.createLikeTestDocuments(fRootFolderId);
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " LIKE 'ABC%'";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("likedoc1", res));        
-        assertTrue(resultContains("likedoc2", res));        
-        
+        assertTrue(resultContains("likedoc1", res));
+        assertTrue(resultContains("likedoc2", res));
+
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " LIKE '%ABC'";
         res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("likedoc3", res));        
+        assertTrue(resultContains("likedoc3", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " LIKE '%ABC%'";
         res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("likedoc1", res));        
-        assertTrue(resultContains("likedoc2", res));        
+        assertTrue(resultContains("likedoc1", res));
+        assertTrue(resultContains("likedoc2", res));
         assertTrue(resultContains("likedoc3", res));
-        
+
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " LIKE 'AB_DEF'";
         res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("likedoc1", res));        
+        assertTrue(resultContains("likedoc1", res));
     }
 
     @Test
@@ -561,27 +563,27 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " NOT LIKE 'ABC%'";
         ObjectList res = doQuery(statement);
         assertEquals(6, res.getObjects().size());
-        assertTrue(resultContains("likedoc3", res));        
-        
+        assertTrue(resultContains("likedoc3", res));
+
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " NOT LIKE '%a'";
         res = doQuery(statement);
         assertEquals(4, res.getObjects().size());
-        assertTrue(resultContains("likedoc1", res));    
-        assertTrue(resultContains("likedoc1", res));    
-        assertTrue(resultContains("likedoc3", res));    
-        assertTrue(resultContains("epsilon", res));    
+        assertTrue(resultContains("likedoc1", res));
+        assertTrue(resultContains("likedoc1", res));
+        assertTrue(resultContains("likedoc3", res));
+        assertTrue(resultContains("epsilon", res));
     }
-    
+
     @Test
     public void testInFolder() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE IN_FOLDER('" + fRootFolderId + "')";
         ObjectList res = doQuery(statement);
         assertEquals(5, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));    
-        assertTrue(resultContains("beta", res));    
-        assertTrue(resultContains("gamma", res));    
-        assertTrue(resultContains("delta", res));    
-        assertTrue(resultContains("epsilon", res));    
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE IN_FOLDER('" + dataCreator.getFolder1() + "')";
         res = doQuery(statement);
@@ -590,11 +592,11 @@ public class EvalQueryTest extends Abstr
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE IN_FOLDER(" + COMPLEX_TYPE + ", '" + fRootFolderId + "')";
         res = doQuery(statement);
         assertEquals(5, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));    
-        assertTrue(resultContains("beta", res));    
-        assertTrue(resultContains("gamma", res));    
-        assertTrue(resultContains("delta", res));    
-        assertTrue(resultContains("epsilon", res));    
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE IN_FOLDER(UnknownType, '" + dataCreator.getFolder2() + "')";
         try {
@@ -613,10 +615,10 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE IN_TREE(" + COMPLEX_TYPE + ", '" + dataCreator.getFolder1() + "')";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("likedoc1", res));    
-        assertTrue(resultContains("likedoc2", res));    
+        assertTrue(resultContains("likedoc1", res));
+        assertTrue(resultContains("likedoc2", res));
         assertTrue(resultContains("likedoc3", res));
-        
+
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE IN_FOLDER('" + dataCreator.getFolder1() + "')";
         res = doQuery(statement);
         assertEquals(0, res.getObjects().size());
@@ -634,39 +636,39 @@ public class EvalQueryTest extends Abstr
             log.debug("expected Exception: " + e);
         }
     }
-    
+
     @Test
     public void testIn() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " IN ('Alpha', 'Beta', 'Gamma')";
         ObjectList res = doQuery(statement);
         assertEquals(3, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));    
-        assertTrue(resultContains("beta", res));    
-        assertTrue(resultContains("gamma", res));    
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " IN ('Theta', 'Pi', 'Rho')";
         res = doQuery(statement);
         assertEquals(0, res.getObjects().size());
     }
-    
+
     @Test
     public void testNotIn() {
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " NOT IN ('Alpha', 'Beta', 'Gamma')";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("delta", res));    
-        assertTrue(resultContains("epsilon", res));    
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE " + UnitTestTypeSystemCreator.PROP_ID_STRING + " NOT IN ('Theta', 'Pi', 'Rho')";
         res = doQuery(statement);
         assertEquals(5, res.getObjects().size());
-        assertTrue(resultContains("alpha", res));    
-        assertTrue(resultContains("beta", res));    
-        assertTrue(resultContains("gamma", res));    
-        assertTrue(resultContains("delta", res));    
-        assertTrue(resultContains("epsilon", res));    
+        assertTrue(resultContains("alpha", res));
+        assertTrue(resultContains("beta", res));
+        assertTrue(resultContains("gamma", res));
+        assertTrue(resultContains("delta", res));
+        assertTrue(resultContains("epsilon", res));
     }
-    
+
     @Test
     public void testMultiValueInAny() {
         dataCreator.createMultiValueDocuments();
@@ -674,19 +676,19 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE ANY " + UnitTestTypeSystemCreator.PROP_ID_STRING_MULTI_VALUE + " IN ('red', 'black', 'grey')";
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("mv-alpha", res));    
-        assertTrue(resultContains("mv-beta", res));    
+        assertTrue(resultContains("mv-alpha", res));
+        assertTrue(resultContains("mv-beta", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE ANY " + UnitTestTypeSystemCreator.PROP_ID_STRING_MULTI_VALUE + " IN ('green', 'black', 'grey')";
         res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("mv-alpha", res));    
+        assertTrue(resultContains("mv-alpha", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE ANY " + UnitTestTypeSystemCreator.PROP_ID_STRING_MULTI_VALUE + " IN ('white', 'black', 'grey')";
         res = doQuery(statement);
         assertEquals(0, res.getObjects().size());
     }
-    
+
     @Test
     public void testMultiValueNotInAny() {
         dataCreator.createMultiValueDocuments();
@@ -698,13 +700,13 @@ public class EvalQueryTest extends Abstr
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE ANY " + UnitTestTypeSystemCreator.PROP_ID_STRING_MULTI_VALUE + " NOT IN ('green', 'black', 'grey')";
         res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertTrue(resultContains("mv-beta", res));    
+        assertTrue(resultContains("mv-beta", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE ANY " + UnitTestTypeSystemCreator.PROP_ID_STRING_MULTI_VALUE + " NOT IN ('white', 'black', 'grey')";
         res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("mv-alpha", res));    
-        assertTrue(resultContains("mv-beta", res));    
+        assertTrue(resultContains("mv-alpha", res));
+        assertTrue(resultContains("mv-beta", res));
     }
 
     @Test
@@ -714,13 +716,13 @@ public class EvalQueryTest extends Abstr
         String statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE 'red' = ANY " + UnitTestTypeSystemCreator.PROP_ID_STRING_MULTI_VALUE ;
         ObjectList res = doQuery(statement);
         assertEquals(2, res.getObjects().size());
-        assertTrue(resultContains("mv-alpha", res));    
+        assertTrue(resultContains("mv-alpha", res));
         assertTrue(resultContains("mv-beta", res));
 
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE 'black' = ANY " + UnitTestTypeSystemCreator.PROP_ID_STRING_MULTI_VALUE ;
         res = doQuery(statement);
         assertEquals(0, res.getObjects().size());
-        
+
         statement = "SELECT * FROM " + COMPLEX_TYPE + " WHERE 'black' = ANY " + UnitTestTypeSystemCreator.PROP_ID_STRING;
         try {
             doQuery(statement);
@@ -730,8 +732,8 @@ public class EvalQueryTest extends Abstr
             log.debug("expected Exception: " + e);
         }
     }
-    
-    @Test 
+
+    @Test
     public void testVersionsWithQuery() {
         String id = dataCreator.createVersionedDocument();
         assertNotNull(id);
@@ -742,20 +744,21 @@ public class EvalQueryTest extends Abstr
         assertTrue(resultContains("ver456", UnitTestTypeSystemCreator.VERSION_PROPERTY_ID, res));
         assertTrue(resultContains("V 1.0", PropertyIds.VERSION_LABEL, res));
         assertTrue(resultContains("V 2.0", PropertyIds.VERSION_LABEL, res));
-        
+
         res = doQuery(statement);
         assertEquals(1, res.getObjects().size());
-        assertFalse(resultContains("V 1.0", PropertyIds.VERSION_LABEL, res));    
+        assertFalse(resultContains("V 1.0", PropertyIds.VERSION_LABEL, res));
         assertTrue(resultContains("V 2.0", PropertyIds.VERSION_LABEL, res));
     }
-    
+
     private ObjectList doQuery(String queryString) {
         log.debug("\nExecuting query: " + queryString);
         ObjectList res = fDiscSvc.query(fRepositoryId, queryString, false, false,
                 IncludeRelationships.NONE, null, null, null, null);
         log.debug("Query result, number of matching objects: " + res.getNumItems());
-        for (ObjectData od : res.getObjects())
+        for (ObjectData od : res.getObjects()) {
             log.debug("Found matching object: " + od.getProperties().getProperties().get(PropertyIds.NAME).getFirstValue());
+        }
         return res;
     }
 
@@ -764,25 +767,27 @@ public class EvalQueryTest extends Abstr
         ObjectList res = fDiscSvc.query(fRepositoryId, queryString, true, false,
                 IncludeRelationships.NONE, null, null, null, null);
         log.debug("Query result, number of matching objects: " + res.getNumItems());
-        for (ObjectData od : res.getObjects())
+        for (ObjectData od : res.getObjects()) {
             log.debug("Found matching object: " + od.getProperties().getProperties().get(PropertyIds.NAME).getFirstValue());
+        }
         return res;
     }
 
-    private boolean resultContains(String name, String propId, ObjectList results) {
+    private static boolean resultContains(String name, String propId, ObjectList results) {
         for (ObjectData od : results.getObjects()) {
             String nameProp = (String) od.getProperties().getProperties().get(propId).getFirstValue();
-            if (name.equals(nameProp))
+            if (name.equals(nameProp)) {
                 return true;
+            }
         }
         return false;
     }
 
-    private boolean resultContains(String name, ObjectList results) {
+    private static boolean resultContains(String name, ObjectList results) {
         return resultContains(name, PropertyIds.NAME, results);
     }
 
-    private boolean resultContainsAtPos(String name, int index, ObjectList results) {
+    private static boolean resultContainsAtPos(String name, int index, ObjectList results) {
         String nameProp = (String) results.getObjects().get(index).getProperties().getProperties().get(PropertyIds.NAME).getFirstValue();
         return name.equals(nameProp);
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/ProcessQueryTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/ProcessQueryTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/ProcessQueryTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/ProcessQueryTest.java Sun Apr 24 16:12:27 2011
@@ -36,7 +36,6 @@ import org.apache.chemistry.opencmis.ser
 import org.apache.chemistry.opencmis.server.support.query.QueryObject;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -109,26 +108,30 @@ public class ProcessQueryTest extends Ab
        }
 
 
-       public void onStartProcessing(Tree node) {
+       @Override
+    public void onStartProcessing(Tree node) {
             LOG.debug("TestQueryProcessor:onStartProcessing()");
             rulesTrackerMap.put(ON_START, counter++);
             assertEquals(CmisQlStrictLexer.WHERE, node.getParent().getType());
        }
 
-       public void onStopProcessing() {
+       @Override
+    public void onStopProcessing() {
            LOG.debug("TestQueryProcessor:onStopProcessing()");
            rulesTrackerMap.put(ON_STOP, counter++);
        }
 
 
-       public void onEquals(Tree eqNode, Tree leftNode, Tree rightNode) {
+       @Override
+    public void onEquals(Tree eqNode, Tree leftNode, Tree rightNode) {
            rulesTrackerMap.put(ON_EQUALS, counter++);
            assertEquals(CmisQlStrictLexer.EQ, eqNode.getType());
            assertTrue(CmisQlStrictLexer.COL==leftNode.getType() || CmisQlStrictLexer.SCORE==leftNode.getType());
            assertTrue(isLiteral(rightNode));
        }
 
-       public void onNotEquals(Tree neNode, Tree leftNode, Tree rightNode) {
+       @Override
+    public void onNotEquals(Tree neNode, Tree leftNode, Tree rightNode) {
            rulesTrackerMap.put(ON_NOT_EQUALS, counter++);
            assertEquals(CmisQlStrictLexer.NEQ, neNode.getType());
            assertEquals(CmisQlStrictLexer.COL, leftNode.getType());
@@ -137,7 +140,8 @@ public class ProcessQueryTest extends Ab
            assertEquals(100, value);
        }
 
-       public void onLessOrEquals(Tree leqNode, Tree leftNode, Tree rightNode) {
+       @Override
+    public void onLessOrEquals(Tree leqNode, Tree leftNode, Tree rightNode) {
            rulesTrackerMap.put(ON_LESS_OR_EQUALS, counter++);
            assertEquals(CmisQlStrictLexer.LTEQ, leqNode.getType());
            assertEquals(CmisQlStrictLexer.COL, leftNode.getType());
@@ -146,7 +150,8 @@ public class ProcessQueryTest extends Ab
            assertEquals(100, value);
        }
 
-       public void onLessThan(Tree ltNode, Tree leftNode, Tree rightNode) {
+       @Override
+    public void onLessThan(Tree ltNode, Tree leftNode, Tree rightNode) {
            rulesTrackerMap.put(ON_LESS_THAN, counter++);
            assertEquals(CmisQlStrictLexer.LT, ltNode.getType());
            assertEquals(CmisQlStrictLexer.COL, leftNode.getType());
@@ -155,7 +160,8 @@ public class ProcessQueryTest extends Ab
            assertEquals(100, value);
        }
 
-       public void onGreaterOrEquals(Tree geNode, Tree leftNode, Tree rightNode) {
+       @Override
+    public void onGreaterOrEquals(Tree geNode, Tree leftNode, Tree rightNode) {
            rulesTrackerMap.put(ON_GREATER_OR_EQUALS, counter++);
            assertEquals(CmisQlStrictLexer.GTEQ, geNode.getType());
            assertEquals(CmisQlStrictLexer.COL, leftNode.getType());
@@ -164,7 +170,8 @@ public class ProcessQueryTest extends Ab
            assertEquals(100, value);
        }
 
-       public void onGreaterThan(Tree gtNode, Tree leftNode, Tree rightNode) {
+       @Override
+    public void onGreaterThan(Tree gtNode, Tree leftNode, Tree rightNode) {
            rulesTrackerMap.put(ON_GREATER_THAN, counter++);
            assertEquals(CmisQlStrictLexer.GT, gtNode.getType());
            assertEquals(CmisQlStrictLexer.COL, leftNode.getType());
@@ -173,22 +180,26 @@ public class ProcessQueryTest extends Ab
            assertEquals(100, value);
        }
 
-       public void onNot(Tree opNode, Tree leftNode) {
+       @Override
+    public void onNot(Tree opNode, Tree leftNode) {
            rulesTrackerMap.put(ON_NOT, counter++);
            assertEquals(CmisQlStrictLexer.NOT, opNode.getType());
        }
 
-       public void onAnd(Tree opNode, Tree leftNode, Tree rightNode) {
+       @Override
+    public void onAnd(Tree opNode, Tree leftNode, Tree rightNode) {
            assertEquals(CmisQlStrictLexer.AND, opNode.getType());
            rulesTrackerMap.put(ON_AND, counter++);
        }
 
-       public void onOr(Tree opNode, Tree leftNode, Tree rightNode) {
+       @Override
+    public void onOr(Tree opNode, Tree leftNode, Tree rightNode) {
            assertEquals(CmisQlStrictLexer.OR, opNode.getType());
            rulesTrackerMap.put(ON_OR, counter++);
        }
 
-       public void onIn(Tree opNode, Tree colNode, Tree listNode) {
+       @Override
+    public void onIn(Tree opNode, Tree colNode, Tree listNode) {
            assertEquals(CmisQlStrictLexer.IN, opNode.getType());
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertEquals(CmisQlStrictLexer.IN_LIST, listNode.getType());
@@ -199,7 +210,8 @@ public class ProcessQueryTest extends Ab
            rulesTrackerMap.put(ON_IN, counter++);
        }
 
-       public void onNotIn(Tree node, Tree colNode, Tree listNode) {
+       @Override
+    public void onNotIn(Tree node, Tree colNode, Tree listNode) {
            assertEquals(CmisQlStrictLexer.NOT_IN, node.getType());
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertEquals(CmisQlStrictLexer.IN_LIST, listNode.getType());
@@ -210,7 +222,8 @@ public class ProcessQueryTest extends Ab
            rulesTrackerMap.put(ON_NOT_IN, counter++);
        }
 
-       public void onEqAny(Tree node, Tree literalNode, Tree colNode) {
+       @Override
+    public void onEqAny(Tree node, Tree literalNode, Tree colNode) {
            assertEquals(CmisQlStrictLexer.EQ_ANY, node.getType());
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertTrue(isLiteral(literalNode));
@@ -219,7 +232,8 @@ public class ProcessQueryTest extends Ab
            rulesTrackerMap.put(ON_EQ_ANY, counter++);
        }
 
-       public void onInAny(Tree node, Tree colNode, Tree listNode) {
+       @Override
+    public void onInAny(Tree node, Tree colNode, Tree listNode) {
            assertEquals(CmisQlStrictLexer.IN_ANY, node.getType());
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertEquals(CmisQlStrictLexer.IN_LIST, listNode.getType());
@@ -230,7 +244,8 @@ public class ProcessQueryTest extends Ab
            rulesTrackerMap.put(ON_IN_ANY, counter++);
        }
 
-       public void onNotInAny(Tree node, Tree colNode, Tree listNode) {
+       @Override
+    public void onNotInAny(Tree node, Tree colNode, Tree listNode) {
            assertEquals(CmisQlStrictLexer.NOT_IN_ANY, node.getType());
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertEquals(CmisQlStrictLexer.IN_LIST, listNode.getType());
@@ -241,19 +256,22 @@ public class ProcessQueryTest extends Ab
            rulesTrackerMap.put(ON_NOT_IN_ANY, counter++);
        }
 
-       public void onIsNull(Tree nullNode, Tree colNode) {
+       @Override
+    public void onIsNull(Tree nullNode, Tree colNode) {
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertEquals(CmisQlStrictLexer.IS_NULL, nullNode.getType());
            rulesTrackerMap.put(ON_IS_NULL, counter++);
        }
 
-       public void onIsNotNull(Tree notNullNode, Tree colNode) {
+       @Override
+    public void onIsNotNull(Tree notNullNode, Tree colNode) {
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertEquals(CmisQlStrictLexer.IS_NOT_NULL, notNullNode.getType());
            rulesTrackerMap.put(ON_IS_NOT_NULL, counter++);
        }
 
-       public void onIsLike(Tree node, Tree colNode, Tree stringNode) {
+       @Override
+    public void onIsLike(Tree node, Tree colNode, Tree stringNode) {
            assertEquals(CmisQlStrictLexer.LIKE, node.getType());
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertEquals(CmisQlStrictLexer.STRING_LIT, stringNode.getType());
@@ -262,7 +280,8 @@ public class ProcessQueryTest extends Ab
            rulesTrackerMap.put(ON_IS_LIKE, counter++);
        }
 
-       public void onIsNotLike(Tree node, Tree colNode, Tree stringNode) {
+       @Override
+    public void onIsNotLike(Tree node, Tree colNode, Tree stringNode) {
            assertEquals(CmisQlStrictLexer.NOT_LIKE, node.getType());
            assertEquals(CmisQlStrictLexer.COL, colNode.getType());
            assertEquals(CmisQlStrictLexer.STRING_LIT, stringNode.getType());
@@ -271,28 +290,32 @@ public class ProcessQueryTest extends Ab
            rulesTrackerMap.put(ON_IS_NOT_LIKE, counter++);
        }
 
-       public void onContains(Tree node, Tree colNode, Tree paramNode) {
+       @Override
+    public void onContains(Tree node, Tree colNode, Tree paramNode) {
            assertEquals(CmisQlStrictLexer.CONTAINS, node.getType());
            assertTrue(colNode==null || CmisQlStrictLexer.STRING_LIT == paramNode.getType());
            assertEquals(CmisQlStrictLexer.STRING_LIT, paramNode.getType());
            rulesTrackerMap.put(ON_CONTAINS, counter++);
        }
 
-       public void onInFolder(Tree node, Tree colNode, Tree paramNode) {
+       @Override
+    public void onInFolder(Tree node, Tree colNode, Tree paramNode) {
            assertEquals(CmisQlStrictLexer.IN_FOLDER, node.getType());
            assertTrue(colNode==null || CmisQlStrictLexer.STRING_LIT == paramNode.getType());
            assertEquals(CmisQlStrictLexer.STRING_LIT, paramNode.getType());
            rulesTrackerMap.put(ON_IN_FOLDER, counter++);
        }
 
-       public void onInTree(Tree node, Tree colNode, Tree paramNode) {
+       @Override
+    public void onInTree(Tree node, Tree colNode, Tree paramNode) {
            assertEquals(CmisQlStrictLexer.IN_TREE, node.getType());
            assertTrue(colNode==null || CmisQlStrictLexer.STRING_LIT == paramNode.getType());
            assertEquals(CmisQlStrictLexer.STRING_LIT, paramNode.getType());
            rulesTrackerMap.put(ON_IN_TREE, counter++);
        }
 
-       public void onScore(Tree node) {
+       @Override
+    public void onScore(Tree node) {
            assertEquals(CmisQlStrictLexer.SCORE, node.getType());
            rulesTrackerMap.put(ON_SCORE, counter++);
        }
@@ -300,29 +323,31 @@ public class ProcessQueryTest extends Ab
 
        // private helper functions:
 
-       private boolean isLiteral(Tree node) {
+       private static boolean isLiteral(Tree node) {
            int type = node.getType();
            return type==CmisQlStrictLexer.BOOL_LIT || type==CmisQlStrictLexer.NUM_LIT ||
            type==CmisQlStrictLexer.STRING_LIT || type==CmisQlStrictLexer.TIME_LIT;
        }
 
-       private Object onLiteral(Tree node, Class<?> clazz) {
+       private static Object onLiteral(Tree node, Class<?> clazz) {
            int type = node.getType();
            switch (type) {
            case CmisQlStrictLexer.BOOL_LIT:
                return clazz==Boolean.class ? Boolean.parseBoolean(node.getText()) : null;
            case CmisQlStrictLexer.NUM_LIT:
-               if (clazz == Integer.class)
-                   return Integer.parseInt(node.getText());
-               else if (clazz == Long.class)
-                   return Long.parseLong(node.getText());
-               else if (clazz == Short.class)
-                   return Short.parseShort(node.getText());
-               else if (clazz == Double.class)
-                   return Double.parseDouble(node.getText());
-               else if (clazz == Float.class)
-                   return Float.parseFloat(node.getText());
-               else return null;
+               if (clazz == Integer.class) {
+                return Integer.parseInt(node.getText());
+            } else if (clazz == Long.class) {
+                return Long.parseLong(node.getText());
+            } else if (clazz == Short.class) {
+                return Short.parseShort(node.getText());
+            } else if (clazz == Double.class) {
+                return Double.parseDouble(node.getText());
+            } else if (clazz == Float.class) {
+                return Float.parseFloat(node.getText());
+            } else {
+                return null;
+            }
            case CmisQlStrictLexer.STRING_LIT:
                return clazz==String.class ? node.getText() : null;
            case CmisQlStrictLexer.TIME_LIT:
@@ -339,14 +364,15 @@ public class ProcessQueryTest extends Ab
     private TestQueryProcessor queryProcessor;
 
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         tm = new TypeManagerImpl();
         tm.initTypeSystem(null); // create CMIS default types
 
         // create some types for testing
         List<TypeDefinition> typeDefs = super.createTypes();
-        for (TypeDefinition typeDef : typeDefs)
+        for (TypeDefinition typeDef : typeDefs) {
             tm.addTypeDefinition(typeDef);
+        }
 
         // initialize query object with type manager
         queryProcessor = new TestQueryProcessor();
@@ -538,9 +564,10 @@ public class ProcessQueryTest extends Ab
         for (Entry<String, Integer> e : queryProcessor.rulesTrackerMap.entrySet()) {
             if (!e.getKey().equals(ruleAssertion) && !e.getKey().equals("onPropertyValueWasCalled")
                     && !e.getKey().equals(TestQueryProcessor.ON_START) && !e.getKey().equals(TestQueryProcessor.ON_STOP)
-                    && !e.getKey().contains("Literal"))
+                    && !e.getKey().contains("Literal")) {
                 assertFalse("Rule " + e.getKey() + " was expected not to be executed, but was executed.",
                         queryProcessor.rulesTrackerMap.get(e.getKey()) > 0);
+            }
         }
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryParseTest.java Sun Apr 24 16:12:27 2011
@@ -42,7 +42,6 @@ import org.apache.chemistry.opencmis.ser
 import org.apache.chemistry.opencmis.server.support.query.QueryObject.SortSpec;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -51,7 +50,7 @@ public class QueryParseTest extends Abst
     private static final Log LOG = LogFactory.getLog(QueryParseTest.class);
 
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         // initialize query object, we do not need a type manager for just testing parsing
         super.setUp(new QueryObject(null), null);
     }
@@ -67,8 +66,8 @@ public class QueryParseTest extends Abst
             LOG.debug("Exception in simpleFailTest: " + e);
         }
     }
-    
-    public void simpleSelectTest1() throws Exception {
+
+    public void simpleSelectTest1() {
         String statement = "SELECT SCORE() FROM cmis:document";
 
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
@@ -83,7 +82,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleSelectTest2() throws Exception {
+    public void simpleSelectTest2() {
         String statement = "SELECT abc FROM cmis:document";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -99,7 +98,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleSelectTest3() throws Exception {
+    public void simpleSelectTest3() {
         String statement = "SELECT t1.abc FROM cmis:document";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -116,7 +115,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleSelectTest4() throws Exception {
+    public void simpleSelectTest4() {
         String statement = "SELECT * FROM cmis:document";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -133,7 +132,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleSelectTest5() throws Exception {
+    public void simpleSelectTest5() {
         String statement = "SELECT t1.* FROM cmis:document";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -150,7 +149,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleSelectTest6() throws Exception {
+    public void simpleSelectTest6() {
         String statement = "SELECT t2.aaa myalias FROM cmis:document";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -167,7 +166,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleSelectTest7() throws Exception {
+    public void simpleSelectTest7() {
         // error processing
         String statement = "SELECTXXX t2.aaa myalias FROM cmis:document WHERE a < t1";
         try {
@@ -179,7 +178,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleFromTest1() throws Exception {
+    public void simpleFromTest1() {
         String statement = "SELECT * FROM MyType MyAlias";
 
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
@@ -194,7 +193,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleFromTest2() throws Exception {
+    public void simpleFromTest2() {
         String statement = "SELECT * FROM MyType";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -208,7 +207,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleFromTest3() throws Exception {
+    public void simpleFromTest3() {
         String statement = "SELECT t2.aaa FROM MyType abc123";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -220,9 +219,9 @@ public class QueryParseTest extends Abst
         assertEquals("abc123", key);
         assertEquals("MyType", types.get(key));
     }
-    
+
     @Test
-    public void simpleFromTest4() throws Exception {
+    public void simpleFromTest4() {
         String statement = "SELECT X.aaa FROM MyType AS X WHERE 10 = ANY X.aaa ";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -236,7 +235,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleWhereTest() throws Exception {
+    public void simpleWhereTest() {
         String statement = "SELECT * FROM MyType WHERE MyProp1=123";
 
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
@@ -265,8 +264,9 @@ public class QueryParseTest extends Abst
     private boolean traverseTreeAndFindNodeInColumnMap(Tree node, Map<Object, CmisSelector> colRefs) {
         boolean found = false;
 //        System.out.println("cmp to: " + System.identityHashCode(node) + " is: " + node.toString());
-        if (null != colRefs.get(node))
+        if (null != colRefs.get(node)) {
             return true;
+        }
 
         int count = node.getChildCount();
         for (int i=0; i<count && !found; i++) {
@@ -279,8 +279,9 @@ public class QueryParseTest extends Abst
     private boolean traverseTreeAndFindNodeInColumnMap2(Tree node, Object colRef) {
         int count = node.getChildCount();
         LOG.debug("  checking with: " + node + " identity hash code: " + System.identityHashCode(node));
-        if (node==colRef)
+        if (node==colRef) {
             return true;
+        }
         boolean found = false;
         for (int i=0; i<count && !found; i++) {
             Tree child = node.getChild(i);
@@ -290,7 +291,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleSortTest1() throws Exception {
+    public void simpleSortTest1() {
         String statement = "SELECT * FROM MyType ORDER BY abc.def ASC";
 
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
@@ -309,7 +310,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void simpleSortTest2() throws Exception {
+    public void simpleSortTest2() {
         String statement = "SELECT * FROM MyType ORDER BY def DESC";
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
         assertNotNull(walker);
@@ -486,7 +487,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void doubleFromTest() throws Exception {
+    public void doubleFromTest() {
         String statement = "SELECT * FROM MyType JOIN YourType WHERE a='1'";
 
         CmisQueryWalker walker = traverseStatementAndCatchExc(statement);
@@ -498,7 +499,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void duplicatedAliasTestSelect() throws Exception {
+    public void duplicatedAliasTestSelect() {
         String statement = "SELECT p1.T1 MyAlias, p2.T1 AS MyAlias FROM T1";
         try {
             traverseStatement(statement);
@@ -508,7 +509,7 @@ public class QueryParseTest extends Abst
     }
 
     @Test
-    public void duplicatedAliasTestFrom() throws Exception {
+    public void duplicatedAliasTestFrom() {
         String statement = "SELECT * FROM T1 MyAlias JOIN T2 AS MyAlias";
         try {
             traverseStatement(statement);
@@ -571,7 +572,7 @@ public class QueryParseTest extends Abst
         --indent;
     }
 
-    private String printNode(Tree node) {
+    private static String printNode(Tree node) {
         switch (node.getType()) {
         case CmisQlStrictLexer.TABLE:
             return "#TABLE";
@@ -764,115 +765,115 @@ public class QueryParseTest extends Abst
     private void evalInAny(Tree node) {
     }
 
-    private void evalColumn(Tree node) {
+    private static void evalColumn(Tree node) {
         assertEquals(1, node.getChildCount());
         assertEquals(CmisQlStrictLexer.ID, node.getChild(0).getType());
     }
 
-    private void evalEquals(Tree node) {
+    private static void evalEquals(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
-    private void evalInFolder(Tree node) {
+    private static void evalInFolder(Tree node) {
         assertEquals(1, node.getChildCount());
     }
 
-    private void evalApproxNumLiteral(Tree node) {
+    private static void evalApproxNumLiteral(Tree node) {
     }
 
-    private void evalNull(Tree node) {
+    private static void evalNull(Tree node) {
         assertEquals(1, node.getChildCount());
     }
 
-    private void evalLike(Tree node) {
+    private static void evalLike(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
-    private void evalNumLiteral(Tree node) {
+    private static void evalNumLiteral(Tree node) {
         assertEquals(0, node.getChildCount());
     }
 
-    private void evalInList(Tree node) {
+    private static void evalInList(Tree node) {
     }
 
-    private void evalEqAny(Tree node) {
+    private static void evalEqAny(Tree node) {
     }
 
-    private void evalNotLike(Tree node) {
+    private static void evalNotLike(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
-    private void evalNotIn(Tree node) {
+    private static void evalNotIn(Tree node) {
     }
 
-    private void evalIsNull(Tree node) {
+    private static void evalIsNull(Tree node) {
         assertEquals(1, node.getChildCount());
     }
 
-    private void evalIsNotNull(Tree node) {
+    private static void evalIsNotNull(Tree node) {
         assertEquals(1, node.getChildCount());
     }
 
-    private void evalLessThan(Tree node) {
+    private static void evalLessThan(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
-    private void evalBooleanLiteral(Tree node) {
+    private static void evalBooleanLiteral(Tree node) {
         assertEquals(0, node.getChildCount());
     }
 
-    private void evalStringLiteral(Tree node) {
+    private static void evalStringLiteral(Tree node) {
         assertEquals(0, node.getChildCount());
     }
 
-    private void evalContains(Tree node) {
+    private static void evalContains(Tree node) {
         assertEquals(1, node.getChildCount());
     }
 
-    private void evalExactNumLiteral(Tree node) {
+    private static void evalExactNumLiteral(Tree node) {
         assertEquals(0, node.getChildCount());
     }
 
-    private void evalLessOrEqual(Tree node) {
+    private static void evalLessOrEqual(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
-    private void evalNot(Tree node) {
+    private static void evalNot(Tree node) {
         assertEquals(1, node.getChildCount());
     }
 
-    private void evalId(Tree node) {
+    private static void evalId(Tree node) {
         assertEquals(0, node.getChildCount());
     }
 
-    private void evalAnd(Tree node) {
+    private static void evalAnd(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
     private void evalIn(Tree node) {
     }
 
-    private void evalNotEquals(Tree node) {
+    private static void evalNotEquals(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
-    private void evalScore(Tree node) {
+    private static void evalScore(Tree node) {
         assertEquals(0, node.getChildCount());
     }
 
-    private void evalInTree(Tree node) {
+    private static void evalInTree(Tree node) {
         assertEquals(1, node.getChildCount());
     }
 
-    private void evalOr(Tree node) {
+    private static void evalOr(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
-    private void evalGreaterThan(Tree node) {
+    private static void evalGreaterThan(Tree node) {
         assertEquals(2, node.getChildCount());
     }
 
-    private void evalTimeLiteral(Tree node) {
+    private static void evalTimeLiteral(Tree node) {
         assertEquals(0, node.getChildCount());
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTestDataCreator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTestDataCreator.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTestDataCreator.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTestDataCreator.java Sun Apr 24 16:12:27 2011
@@ -51,14 +51,14 @@ import static org.apache.chemistry.openc
 /**
  * Utility class that fills the in-memory repository with some test objects that
  * can be used for query
- * 
+ *
  * @author Jens
  *
  * This class uses the following data for query testing. We have one document type
  * "ComplexType" and one folder type "FolderType" The document type has one property of
  * each of the types boolean, integer, decimal, string and datetime. id, uri and html are
- * treated like a string and do not make a difference. 
- * 
+ * treated like a string and do not make a difference.
+ *
  * String   Int         Double      DateTime  Boolean
  * ------------------------------------------------
  * Alpha    -100        -1.6E-5     23.05.1618  true
@@ -66,11 +66,11 @@ import static org.apache.chemistry.openc
  * Gamma    0           3.141592    (now)       true
  * Delta    50          1.23456E-6  20.01.2038  true
  * Epsilon  100         1.2345E12   14.07.2345  false
- * 
+ *
  * For folder and tree tests this series is put in each of the three test folders
  */
 public class QueryTestDataCreator {
-    
+
     private final BindingsObjectFactory fFactory = new BindingsObjectFactoryImpl();
     private final String rootFolderId;
     private final String repositoryId;
@@ -81,14 +81,14 @@ public class QueryTestDataCreator {
     private String folder2;
     private String folder11;
     private static final TimeZone TZ = TimeZone.getTimeZone("Zulu");
-    
+
     public QueryTestDataCreator(String repositoryId, String rootFolderId, ObjectService objSvc, VersioningService verSvc) {
         this.rootFolderId = rootFolderId;
         this.repositoryId = repositoryId;
         fObjSvc = objSvc;
         fVerSvc = verSvc;
     }
-    
+
     public String getFolder1() {
         return folder1;
     }
@@ -98,7 +98,7 @@ public class QueryTestDataCreator {
     public String getFolder11() {
         return folder11;
     }
-    
+
     public void createBasicTestData() {
         createTestFolders();
         createBasicTestDocuments();
@@ -110,187 +110,187 @@ public class QueryTestDataCreator {
         final GregorianCalendar gc1 = new GregorianCalendar(TZ);
         gc1.clear();
         gc1.set(1945, 4, 8);
-        
-        final Map<String, Object> propertyMap1 = 
+
+        final Map<String, Object> propertyMap1 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "Alpha");
                 put(PROP_ID_INT, Integer.valueOf(-100));
                 put(PROP_ID_DECIMAL, Double.valueOf(-4.0E24d));
                 put(PROP_ID_DATETIME, gc1);
                 put(PROP_ID_BOOLEAN, true);
-            }};           
+            }};
         doc1 = createDocument("alpha", rootFolderId, COMPLEX_TYPE, propertyMap1);
         assertNotNull(doc1);
-        
+
         final GregorianCalendar gc2 = new GregorianCalendar(TZ);
         gc2.clear();
         gc2.set(1618, 4, 23);
-        
-        final Map<String, Object> propertyMap2 = 
+
+        final Map<String, Object> propertyMap2 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "Beta");
                 put(PROP_ID_INT, Integer.valueOf(-50));
                 put(PROP_ID_DECIMAL, Double.valueOf(-1.6E-5d));
                 put(PROP_ID_DATETIME, gc2);
                 put(PROP_ID_BOOLEAN, false);
-            }};           
+            }};
         doc2 = createDocument("beta", rootFolderId, COMPLEX_TYPE, propertyMap2);
         assertNotNull(doc2);
 
-        final Map<String, Object> propertyMap3 = 
+        final Map<String, Object> propertyMap3 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "Gamma");
                 put(PROP_ID_INT, Integer.valueOf(0));
                 put(PROP_ID_DECIMAL, Double.valueOf(Math.PI));
                 put(PROP_ID_DATETIME, new GregorianCalendar(TZ));
                 put(PROP_ID_BOOLEAN, true);
-            }};           
+            }};
         doc3 = createDocument("gamma", rootFolderId, COMPLEX_TYPE, propertyMap3);
         assertNotNull(doc3);
 
         final GregorianCalendar gc4 = new GregorianCalendar(TZ);
         gc4.clear();
         gc4.set(2038, 0, 20);
-        
-        final Map<String, Object> propertyMap4 = 
+
+        final Map<String, Object> propertyMap4 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "Delta");
                 put(PROP_ID_INT, Integer.valueOf(50));
                 put(PROP_ID_DECIMAL, Double.valueOf(1.23456E-6));
                 put(PROP_ID_DATETIME, gc4);
                 put(PROP_ID_BOOLEAN, true);
-            }};           
+            }};
         doc4 = createDocument("delta", rootFolderId, COMPLEX_TYPE, propertyMap4);
         assertNotNull(doc4);
 
         final GregorianCalendar gc5 = new GregorianCalendar(TZ);
         gc5.clear();
         gc5.set(2345, 6, 14);
-        
-        final Map<String, Object> propertyMap5 = 
+
+        final Map<String, Object> propertyMap5 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "Epsilon");
                 put(PROP_ID_INT, Integer.valueOf(100));
                 put(PROP_ID_DECIMAL, Double.valueOf(1.2345E12));
                 put(PROP_ID_DATETIME, gc5);
                 put(PROP_ID_BOOLEAN, false);
-            }};           
+            }};
         doc5 = createDocument("epsilon", rootFolderId, COMPLEX_TYPE, propertyMap5);
         assertNotNull(doc5);
 
     }
-    
+
     @SuppressWarnings("serial")
     public void createMultiValueDocuments() {
-        final List<String> mvProps1 = 
+        final List<String> mvProps1 =
             new ArrayList<String>() {
-            { 
+            {
                 add("red");
                 add("green");
                 add("blue");
             }};
-        
-        final Map<String, Object> propertyMap1 = 
+
+        final Map<String, Object> propertyMap1 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING_MULTI_VALUE, mvProps1);
                 put(PROP_ID_INT, Integer.valueOf(100));
-            }};           
+            }};
         createDocument("mv-alpha", rootFolderId, COMPLEX_TYPE, propertyMap1);
 
-        final List<String> mvProps2 = 
+        final List<String> mvProps2 =
             new ArrayList<String>() {
-            { 
+            {
                 add("red");
                 add("pink");
                 add("violet");
             }};
-        
-        final Map<String, Object> propertyMap2 = 
+
+        final Map<String, Object> propertyMap2 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING_MULTI_VALUE, mvProps2);
                 put(PROP_ID_INT, Integer.valueOf(200));
-            }};           
+            }};
         createDocument("mv-beta", rootFolderId, COMPLEX_TYPE, propertyMap2);
     }
-    
+
     @SuppressWarnings("serial")
     public void createTestFolders() {
-        final Map<String, Object> propertyMap1 = 
+        final Map<String, Object> propertyMap1 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_INT, Integer.valueOf(1234));
                 put(PROP_ID_STRING, "ABCD");
-            }};           
+            }};
         folder1 = createFolder("Folder 1", rootFolderId, FOLDER_TYPE, propertyMap1);
-        
-        final Map<String, Object> propertyMap2 = 
+
+        final Map<String, Object> propertyMap2 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_INT, Integer.valueOf(-2345));
                 put(PROP_ID_STRING, "defg");
-            }};           
+            }};
         folder2 = createFolder("Folder 2", rootFolderId, FOLDER_TYPE, propertyMap2);
 
-        final Map<String, Object> propertyMap3 = 
+        final Map<String, Object> propertyMap3 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_INT, Integer.valueOf(123));
                 put(PROP_ID_STRING, "ZZZZ");
-            }};           
+            }};
         folder11 = createFolder("Folder 11", folder1, FOLDER_TYPE, propertyMap3);
     }
-    
+
     @SuppressWarnings("serial")
     public void createNullTestDocument() {
 
-        final Map<String, Object> propertyMap1 = 
+        final Map<String, Object> propertyMap1 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "DocumentWithNulls");
-            }};           
+            }};
         createDocument("nulldoc", rootFolderId, COMPLEX_TYPE, propertyMap1);
     }
-    
+
     @SuppressWarnings("serial")
     public void createLikeTestDocuments(String folderId) {
 
-        final Map<String, Object> propertyMap1 = 
+        final Map<String, Object> propertyMap1 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "ABCDEF");
-            }};           
+            }};
         createDocument("likedoc1", folderId, COMPLEX_TYPE, propertyMap1);
 
-        final Map<String, Object> propertyMap2 = 
+        final Map<String, Object> propertyMap2 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "ABC123");
-            }};           
+            }};
         createDocument("likedoc2", folderId, COMPLEX_TYPE, propertyMap2);
-        
-        final Map<String, Object> propertyMap3 = 
+
+        final Map<String, Object> propertyMap3 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(PROP_ID_STRING, "123ABC");
-            }};           
+            }};
         createDocument("likedoc3", folderId, COMPLEX_TYPE, propertyMap3);
     }
-    
+
     @SuppressWarnings("serial")
     public String createVersionedDocument() {
-        final Map<String, Object> propertyMap1 = 
+        final Map<String, Object> propertyMap1 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(VERSION_PROPERTY_ID, "ver123");
-            }};           
-        
+            }};
+
         String verIdV1 = createDocument("verdoc1", rootFolderId, UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID, propertyMap1, VersioningState.MAJOR);
         ObjectData version = fObjSvc.getObject(repositoryId, verIdV1, "*", false, IncludeRelationships.NONE, null,
                 false, false, null);
@@ -298,12 +298,12 @@ public class QueryTestDataCreator {
         // get version series id
         String verIdSer = (String) version.getProperties().getProperties().get(PropertyIds.VERSION_SERIES_ID).getFirstValue();
 
-        // create second version 
-        final Map<String, Object> propertyMap2 = 
+        // create second version
+        final Map<String, Object> propertyMap2 =
             new HashMap<String, Object>() {
-            { 
+            {
                 put(VERSION_PROPERTY_ID, "ver456");
-            }};           
+            }};
         Properties propsV2 = createDocumentProperties("dummy", UnitTestTypeSystemCreator.VERSION_DOCUMENT_TYPE_ID, propertyMap2);
 
         Holder<String> idHolder = new Holder<String>(verIdV1);
@@ -317,14 +317,15 @@ public class QueryTestDataCreator {
         // String verIdV2 = idHolder.getValue();
         return verIdSer;
     }
-    
+
     private String createFolder(String folderName, String parentFolderId, String typeId, Map<String, Object> properties) {
         Properties props = createFolderProperties(folderName, typeId, properties);
         String id = null;
         try {
             id = fObjSvc.createFolder(repositoryId, props, parentFolderId, null, null, null, null);
-            if (null == id)
+            if (null == id) {
                 fail("createFolder failed.");
+            }
         } catch (Exception e) {
             fail("createFolder() failed with exception: " + e);
         }
@@ -348,8 +349,9 @@ public class QueryTestDataCreator {
         try {
             id = fObjSvc.createDocument(repositoryId, props, folderId, contentStream, verState, policies,
                     addACEs, removeACEs, extension);
-            if (null == id)
+            if (null == id) {
                 fail("createDocument failed.");
+            }
         } catch (Exception e) {
             fail("createDocument() failed with exception: " + e);
         }
@@ -382,13 +384,13 @@ public class QueryTestDataCreator {
         Properties props = fFactory.createPropertiesData(properties);
         return props;
     }
-        
+
 
     /**
      * Simplified property creation method, create Property of Boolean, String, Integer,
      * Decimal, or DataTime depending on class of value (Boolean, String, Integer, Double,
      * or GregorianCalendar. Id, Html and URI are not supported
-     * 
+     *
      * @param propId
      * @param value
      * @return
@@ -418,10 +420,12 @@ public class QueryTestDataCreator {
                 return fFactory.createPropertyStringData(propId, (List<String>)value);
             } else if (clazz.equals(GregorianCalendar.class)) {
                 return fFactory.createPropertyDateTimeData(propId, (List<GregorianCalendar>)value);
-            } else
+            } else {
                 fail("unsupported type in propery value: " + clazz);
-        } else
+            }
+        } else {
             fail("unsupported type in propery value: " + clazz);
+        }
         return null;
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTypesTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTypesTest.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTypesTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/query/QueryTypesTest.java Sun Apr 24 16:12:27 2011
@@ -43,21 +43,22 @@ public class QueryTypesTest extends Abst
     private TypeManagerImpl tm;
 
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         tm = new TypeManagerImpl();
         tm.initTypeSystem(null); // create CMIS default types
 
         // create some types for testing
         List<TypeDefinition> typeDefs = super.createTypes();
-        for (TypeDefinition typeDef : typeDefs)
+        for (TypeDefinition typeDef : typeDefs) {
             tm.addTypeDefinition(typeDef);
+        }
 
         // initialize query object with type manager
         super.setUp(new QueryObject(tm), null);
     }
 
     @After
-    public void tearDown() throws Exception {
+    public void tearDown() {
     }
 
     @Test
@@ -91,7 +92,7 @@ public class QueryTypesTest extends Abst
     }
 
     @Test
-    public void resolveTypesTest6() throws Exception {
+    public void resolveTypesTest6() {
         String statement = "SELECT BookType.UnknownProperty FROM BookType WHERE ISBN = '100'";
         try {
             verifyResolveSelect(statement);
@@ -104,7 +105,7 @@ public class QueryTypesTest extends Abst
     }
 
     @Test
-    public void resolveTypesTest7() throws Exception {
+    public void resolveTypesTest7() {
         String statement = "SELECT UnknownProperty FROM BookType WHERE ISBN = '100'";
         try {
             verifyResolveSelect(statement);
@@ -189,7 +190,7 @@ public class QueryTypesTest extends Abst
     }
 
     @Test
-    public void resolveTypesWithTwoFromsNotUnique() throws Exception {
+    public void resolveTypesWithTwoFromsNotUnique() {
         String statement = "SELECT MyStringProp FROM MyDocTypeCopy JOIN MyDocType";
 
         try {
@@ -345,7 +346,7 @@ public class QueryTypesTest extends Abst
     }
 
     @Test
-    public void resolveTypesWhereWithTwoFromsNotUnique() throws Exception {
+    public void resolveTypesWhereWithTwoFromsNotUnique() {
         String statement = "SELECT * FROM MyDocTypeCopy JOIN MyDocType WHERE MyStringProp = '100'";
 
         try {
@@ -431,8 +432,9 @@ public class QueryTypesTest extends Abst
                 assertTrue(colRef.getPropertyQueryName().equals(STRING_PROP));
             } else if (bookType.equals(colRef.getTypeDefinition())) {
                 assertTrue(colRef.getPropertyQueryName().equals(TITLE_PROP));
-            } else
+            } else {
                 fail("Unexpected type in JOIN reference");
+            }
         }
     }
 
@@ -454,8 +456,9 @@ public class QueryTypesTest extends Abst
                 assertTrue(colRef.getPropertyQueryName().equals(STRING_PROP));
             } else if (bookType.equals(colRef.getTypeDefinition())) {
                 assertTrue(colRef.getPropertyQueryName().equals(TITLE_PROP));
-            } else
+            } else {
                 fail("Unexpected type in JOIN reference");
+            }
         }
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrDocument.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrDocument.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrDocument.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrDocument.java Sun Apr 24 16:12:27 2011
@@ -44,14 +44,14 @@ import java.math.BigInteger;
 import java.util.Set;
 
 /**
- * Instances of this class represent a cmis:document backed by an underlying JCR <code>Node</code>. 
+ * Instances of this class represent a cmis:document backed by an underlying JCR <code>Node</code>.
  */
 public abstract class JcrDocument extends JcrNode {
     private static final Log log = LogFactory.getLog(JcrDocument.class);
 
     public static final String MIME_UNKNOWN = "application/octet-stream";
 
-    public JcrDocument(Node node, JcrTypeManager typeManager, PathManager pathManager, JcrNodeFactory nodeFactory) {
+    protected JcrDocument(Node node, JcrTypeManager typeManager, PathManager pathManager, JcrNodeFactory nodeFactory) {
         super(node, typeManager, pathManager, nodeFactory);
     }
 
@@ -217,7 +217,7 @@ public abstract class JcrDocument extend
     protected boolean getIsImmutable() {
         return false;
     }
-    
+
     @Override
     protected void compileProperties(PropertiesImpl properties, Set<String> filter, ObjectInfoImpl objectInfo)
             throws RepositoryException {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNode.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNode.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNode.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNode.java Sun Apr 24 16:12:27 2011
@@ -70,9 +70,10 @@ import java.util.Set;
 
 /**
  * Common base class for all JCR <code>Node</code>s to be represented as CMIS objects. Instances of this class
- * are responsible for mapping from CMIS to JCR and vice versa. 
+ * are responsible for mapping from CMIS to JCR and vice versa.
  */
 public abstract class JcrNode {
+
     private static final Log log = LogFactory.getLog(JcrNode.class);
 
     /**
@@ -98,12 +99,13 @@ public abstract class JcrNode {
 
     /**
      * Create a new instance wrapping a JCR <code>node</code>.
+     *
      * @param node  the JCR <code>node</code> to represent
      * @param typeManager
      * @param pathManager
      * @param nodeFactory
      */
-    public JcrNode(Node node, JcrTypeManager typeManager, PathManager pathManager, JcrNodeFactory nodeFactory) {
+    protected JcrNode(Node node, JcrTypeManager typeManager, PathManager pathManager, JcrNodeFactory nodeFactory) {
         this.node = node;
         this.typeManager = typeManager;
         this.pathManager = pathManager;
@@ -172,7 +174,7 @@ public abstract class JcrNode {
     public boolean isFolder() {
         return BaseTypeId.CMIS_FOLDER == getBaseTypeId();
     }
-    
+
     /**
      * @return  <code>true</code> iff this instance represents a versionable CMIS object
      */
@@ -455,7 +457,7 @@ public abstract class JcrNode {
     protected abstract BaseTypeId getBaseTypeId();
 
     /**
-     * @return  the value of the <code>cmis:objectTypeId</code> property 
+     * @return  the value of the <code>cmis:objectTypeId</code> property
      */
     protected abstract String getTypeIdInternal();
 
@@ -608,7 +610,7 @@ public abstract class JcrNode {
 
     /**
      * Factory method for creating a new <code>JcrNode</code> instance from a JCR <code>Node</code>
-     * 
+     *
      * @param node  the JCR <code>Node</code>
      * @return  a new <code>JcrNode</code>
      */
@@ -821,7 +823,7 @@ public abstract class JcrNode {
      *
      * @param node  the node for which to retrieve the version history
      * @return  version history of <code>node</code>
-     * @throws RepositoryException  if <code>node</code> is not versionable 
+     * @throws RepositoryException  if <code>node</code> is not versionable
      */
     protected static VersionHistory getVersionHistory(Node node) throws RepositoryException {
         return getVersionManager(node).getVersionHistory(node.getPath());
@@ -829,7 +831,7 @@ public abstract class JcrNode {
 
     /**
      * Utility function for retrieving the version manager from a JCR <code>Node</code>.
-     * 
+     *
      * @param node
      * @return
      * @throws RepositoryException
@@ -864,7 +866,7 @@ public abstract class JcrNode {
     }
 
     /**
-     * Utility function for retrieving a string property from a JCR <code>Node</code> or a default 
+     * Utility function for retrieving a string property from a JCR <code>Node</code> or a default
      * value in case of an error.
      *
      * @param node
@@ -884,7 +886,7 @@ public abstract class JcrNode {
     /**
      * Utility function for retrieving a date property from a JCR <code>Node</code> or a default
      * value in case of an error.
-     * 
+     *
      * @param node
      * @param propertyName
      * @param defaultValue
@@ -905,7 +907,7 @@ public abstract class JcrNode {
 
     /**
      * Add <code>action</code> to <code>actions</code> iff <code>condition</code> is true.
-     * 
+     *
      * @param actions
      * @param action
      * @param condition

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java?rev=1096340&r1=1096339&r2=1096340&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrNodeFactory.java Sun Apr 24 16:12:27 2011
@@ -38,7 +38,7 @@ import java.util.Map;
 /**
  * Factory for creating instances of sub-classes of {@link JcrNode} from JCR <code>Node</code>s.
  */
-public class JcrNodeFactory {  
+public class JcrNodeFactory {
     private static final Log log = LogFactory.getLog(JcrNodeFactory.class);
 
     private JcrTypeManager typeManager;
@@ -126,11 +126,11 @@ public class JcrNodeFactory {  
             // xxx not supported: BASE_TYPE_ID, CHANGE_TOKEN
         }};
 
-        public IdentifierMapBase(String jcrTypeName) {
+        protected IdentifierMapBase(String jcrTypeName) {
             this.jcrTypeName = jcrTypeName;
         }
 
-        public IdentifierMapBase(String jcrTypeName, Map<String, String> cmis2Jcr) {
+        protected IdentifierMapBase(String jcrTypeName, Map<String, String> cmis2Jcr) {
             this(jcrTypeName);
             this.cmis2Jcr.putAll(cmis2Jcr);
         }
@@ -146,11 +146,11 @@ public class JcrNodeFactory {  
         }
 
         public String jcrTypeName() {
-            return jcrTypeName;   
+            return jcrTypeName;
         }
 
         public String jcrTypeCondition() {
-            return null; 
+            return null;
         }
     }
 



Mime
View raw message