You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2016/01/24 11:23:19 UTC

cayenne git commit: cleaning up QualifierTranslatorIT

Repository: cayenne
Updated Branches:
  refs/heads/master b0be7f779 -> 45b0ee105


cleaning up QualifierTranslatorIT


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/45b0ee10
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/45b0ee10
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/45b0ee10

Branch: refs/heads/master
Commit: 45b0ee105c044f0c56ee2418550f13ff0c9652fb
Parents: b0be7f7
Author: aadamchik <aa...@apache.org>
Authored: Sun Jan 24 12:58:42 2016 +0300
Committer: aadamchik <aa...@apache.org>
Committed: Sun Jan 24 13:21:35 2016 +0300

----------------------------------------------------------------------
 .../translator/select/OrderingTranslatorIT.java |   8 +-
 .../select/QualifierTranslatorIT.java           |  90 +++++-----
 .../apache/cayenne/exp/TstBinaryExpSuite.java   | 164 -------------------
 .../apache/cayenne/exp/TstExpressionCase.java   |  79 ---------
 .../apache/cayenne/exp/TstExpressionSuite.java  |  37 -----
 .../apache/cayenne/exp/TstTernaryExpSuite.java  |  45 -----
 .../apache/cayenne/exp/TstUnaryExpSuite.java    |  71 --------
 7 files changed, 54 insertions(+), 440 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/45b0ee10/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/OrderingTranslatorIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/OrderingTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/OrderingTranslatorIT.java
index 4e92d02..ba21af7 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/OrderingTranslatorIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/OrderingTranslatorIT.java
@@ -20,7 +20,6 @@
 package org.apache.cayenne.access.translator.select;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 
 import java.util.Arrays;
 
@@ -105,11 +104,8 @@ public class OrderingTranslatorIT extends ServerCase {
 
 		TstQueryAssembler assembler = new TstQueryAssembler(q, node.getAdapter(), node.getEntityResolver());
 		StringBuilder out = new StringBuilder();
-		new OrderingTranslator(assembler).appendPart(out);
+		String translated = new OrderingTranslator(assembler).appendPart(out).toString();
 
-		String translated = out.toString();
-
-		assertNotNull(translated);
-		assertEquals("Unexpected translation: " + translated + "....", expectedSQL, translated);
+		assertEquals(expectedSQL, translated);
 	}
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/45b0ee10/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QualifierTranslatorIT.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QualifierTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QualifierTranslatorIT.java
index 6475873..5671830 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QualifierTranslatorIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QualifierTranslatorIT.java
@@ -20,24 +20,20 @@
 package org.apache.cayenne.access.translator.select;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
-import org.apache.cayenne.CayenneRuntimeException;
+import java.util.Arrays;
+
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;
-import org.apache.cayenne.exp.TstBinaryExpSuite;
-import org.apache.cayenne.exp.TstExpressionCase;
-import org.apache.cayenne.exp.TstExpressionSuite;
-import org.apache.cayenne.exp.TstTernaryExpSuite;
-import org.apache.cayenne.exp.TstUnaryExpSuite;
-import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.query.MockQuery;
 import org.apache.cayenne.query.SelectQuery;
+import org.apache.cayenne.testdo.testmap.Exhibit;
 import org.apache.cayenne.testdo.testmap.Gallery;
+import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.ServerCaseDataSourceFactory;
@@ -53,6 +49,7 @@ public class QualifierTranslatorIT extends ServerCase {
 	@Inject
 	private ServerCaseDataSourceFactory dataSourceFactory;
 
+	// TODO: not an integration test; extract into *Test
 	@Test
 	public void testNonQualifiedQuery() throws Exception {
 		TstQueryAssembler qa = new TstQueryAssembler(new MockQuery(), node.getAdapter(), node.getEntityResolver());
@@ -65,6 +62,7 @@ public class QualifierTranslatorIT extends ServerCase {
 		}
 	}
 
+	// TODO: not an integration test; extract into *Test
 	@Test
 	public void testNullQualifier() throws Exception {
 		TstQueryAssembler qa = new TstQueryAssembler(new SelectQuery<Object>(), node.getAdapter(),
@@ -76,18 +74,47 @@ public class QualifierTranslatorIT extends ServerCase {
 	}
 
 	@Test
-	public void testUnary() throws Exception {
-		doExpressionTest(new TstUnaryExpSuite());
+	public void testBinary_In1() throws Exception {
+		doExpressionTest(Exhibit.class, "toGallery.galleryName in ('g1', 'g2', 'g3')", "ta.GALLERY_NAME IN (?, ?, ?)");
+	}
+
+	@Test
+	public void testBinary_In2() throws Exception {
+		Expression exp = ExpressionFactory.inExp("toGallery.galleryName",
+				Arrays.asList(new Object[] { "g1", "g2", "g3" }));
+		doExpressionTest(Exhibit.class, exp, "ta.GALLERY_NAME IN (?, ?, ?)");
+	}
+
+	@Test
+	public void testBinary_In3() throws Exception {
+		Expression exp = ExpressionFactory.inExp("toGallery.galleryName", new Object[] { "g1", "g2", "g3" });
+		doExpressionTest(Exhibit.class, exp, "ta.GALLERY_NAME IN (?, ?, ?)");
+	}
+
+	@Test
+	public void testBinary_Like() throws Exception {
+		doExpressionTest(Exhibit.class, "toGallery.galleryName like 'a%'", "ta.GALLERY_NAME LIKE ?");
 	}
 
 	@Test
-	public void testBinary() throws Exception {
-		doExpressionTest(new TstBinaryExpSuite());
+	public void testBinary_LikeIgnoreCase() throws Exception {
+		doExpressionTest(Exhibit.class, "toGallery.galleryName likeIgnoreCase 'a%'",
+				"UPPER(ta.GALLERY_NAME) LIKE UPPER(?)");
 	}
 
 	@Test
-	public void testTernary() throws Exception {
-		doExpressionTest(new TstTernaryExpSuite());
+	public void testBinary_IsNull() throws Exception {
+		doExpressionTest(Exhibit.class, "toGallery.galleryName = null", "ta.GALLERY_NAME IS NULL");
+	}
+
+	@Test
+	public void testBinary_IsNotNull() throws Exception {
+		doExpressionTest(Exhibit.class, "toGallery.galleryName != null", "ta.GALLERY_NAME IS NOT NULL");
+	}
+
+	@Test
+	public void testTernary_Between() throws Exception {
+		doExpressionTest(Painting.class, "estimatedPrice between 3000 and 15000", "ta.ESTIMATED_PRICE BETWEEN ? AND ?");
 	}
 
 	@Test
@@ -102,36 +129,23 @@ public class QualifierTranslatorIT extends ServerCase {
 		Expression e1 = ExpressionFactory.matchExp("toGallery", g1);
 		Expression e2 = e1.orExp(ExpressionFactory.matchExp("toGallery", g2));
 
-		TstExpressionCase extraCase = new TstExpressionCase("Exhibit", e2,
-				"(ta.GALLERY_ID = ?) OR (ta.GALLERY_ID = ?)", 4, 4);
-
-		TstExpressionSuite suite = new TstExpressionSuite() {
-		};
-		suite.addCase(extraCase);
-		doExpressionTest(suite);
+		doExpressionTest(Exhibit.class, e2, "(ta.GALLERY_ID = ?) OR (ta.GALLERY_ID = ?)");
 	}
 
-	private void doExpressionTest(TstExpressionSuite suite) throws Exception {
+	private void doExpressionTest(Class<?> queryType, String qualifier, String expectedSQL) throws Exception {
+		doExpressionTest(queryType, ExpressionFactory.exp(qualifier), expectedSQL);
+	}
 
-		TstExpressionCase[] cases = suite.cases();
+	private void doExpressionTest(Class<?> queryType, Expression qualifier, String expectedSQL) throws Exception {
 
-		int len = cases.length;
-		for (int i = 0; i < len; i++) {
-			try {
+		SelectQuery<?> q = new SelectQuery<>(queryType);
+		q.setQualifier(qualifier);
 
-				ObjEntity entity = node.getEntityResolver().getObjEntity(cases[i].getRootEntity());
-				assertNotNull(entity);
-				SelectQuery q = new SelectQuery(entity);
-				q.setQualifier(cases[i].getCayenneExp());
+		TstQueryAssembler qa = new TstQueryAssembler(q, node.getAdapter(), node.getEntityResolver());
 
-				TstQueryAssembler qa = new TstQueryAssembler(q, node.getAdapter(), node.getEntityResolver());
+		StringBuilder out = new StringBuilder();
+		String translated = new QualifierTranslator(qa).appendPart(out).toString();
+		assertEquals(expectedSQL, translated);
 
-				StringBuilder out = new StringBuilder();
-				new QualifierTranslator(qa).appendPart(out);
-				cases[i].assertTranslatedWell(out.toString());
-			} catch (Exception ex) {
-				throw new CayenneRuntimeException("Failed case: [" + i + "]: " + cases[i], ex);
-			}
-		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/45b0ee10/cayenne-server/src/test/java/org/apache/cayenne/exp/TstBinaryExpSuite.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstBinaryExpSuite.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/TstBinaryExpSuite.java
deleted file mode 100644
index 974dd9c..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstBinaryExpSuite.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.exp;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A suite of binary expression tests.
- * 
- */
-public class TstBinaryExpSuite extends TstExpressionSuite {
-
-    private static final TstExpressionCase like1 = buildLike1();
-    private static final TstExpressionCase likeic1 = buildLikeIgnoreCase1();
-    private static final TstExpressionCase in1 = buildIn1();
-    private static final TstExpressionCase in2 = buildIn2();
-    private static final TstExpressionCase isNull = buildIsNull();
-    private static final TstExpressionCase isNotNull = buildIsNotNull();
-
-    /** Cayenne syntax: "toGallery.galleryName in ('g1', 'g2', g3')" */
-    private static TstExpressionCase buildIn1() {
-        List in = new ArrayList();
-        in.add("g1");
-        in.add("g2");
-        in.add("g3");
-
-        Expression e1 = ExpressionFactory.expressionOfType(Expression.IN);
-
-        Expression e10 =
-            ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "toGallery.galleryName");
-        e1.setOperand(0, e10);
-
-        Expression e11 = ExpressionFactory.expressionOfType(Expression.LIST);
-        e11.setOperand(0, in);
-        e1.setOperand(1, e11);
-
-        return new TstExpressionCase(
-            "Exhibit",
-            e1,
-            "ta.GALLERY_NAME IN (?, ?, ?)",
-            3,
-            2);
-    }
-
-    private static TstExpressionCase buildIsNull() {
-        Expression e1 = ExpressionFactory.expressionOfType(Expression.EQUAL_TO);
-
-        Expression e10 =
-            ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "toGallery.galleryName");
-        e1.setOperand(0, e10);
-        e1.setOperand(1, null);
-
-        return new TstExpressionCase(
-            "Exhibit",
-            e1,
-            "ta.GALLERY_NAME IS NULL",
-            2,
-            2);
-    }
-
-    private static TstExpressionCase buildIsNotNull() {
-        Expression e1 =
-            ExpressionFactory.expressionOfType(Expression.NOT_EQUAL_TO);
-
-        Expression e10 =
-            ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "toGallery.galleryName");
-        e1.setOperand(0, e10);
-        e1.setOperand(1, null);
-
-        return new TstExpressionCase(
-            "Exhibit",
-            e1,
-            "ta.GALLERY_NAME IS NOT NULL",
-            2,
-            2);
-    }
-
-    /** Cayenne syntax: "toGallery.galleryName in ('g1', 'g2', g3')" */
-    private static TstExpressionCase buildIn2() {
-        // test Object[]
-        Object[] in = new Object[] { "g1", "g2", "g3" };
-
-        Expression e1 = ExpressionFactory.expressionOfType(Expression.IN);
-
-        Expression e10 =
-            ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "toGallery.galleryName");
-        e1.setOperand(0, e10);
-
-        Expression e11 = ExpressionFactory.expressionOfType(Expression.LIST);
-        e11.setOperand(0, in);
-        e1.setOperand(1, e11);
-
-        return new TstExpressionCase(
-            "Exhibit",
-            e1,
-            "ta.GALLERY_NAME IN (?, ?, ?)",
-            3,
-            2);
-    }
-
-    /** Cayenne syntax: "toGallery.galleryName like 'a%'" */
-    private static TstExpressionCase buildLike1() {
-        Expression e1 = ExpressionFactory.expressionOfType(Expression.LIKE);
-        Expression e10 =
-            ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "toGallery.galleryName");
-        e1.setOperand(0, e10);
-        e1.setOperand(1, "a%");
-        return new TstExpressionCase(
-            "Exhibit",
-            e1,
-            "ta.GALLERY_NAME LIKE ?",
-            2,
-            2);
-    }
-
-    /** Cayenne syntax: "toGallery.galleryName likeIgnoreCase 'a%'" */
-    private static TstExpressionCase buildLikeIgnoreCase1() {
-        Expression e1 =
-            ExpressionFactory.expressionOfType(Expression.LIKE_IGNORE_CASE);
-        Expression e10 =
-            ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "toGallery.galleryName");
-        e1.setOperand(0, e10);
-        e1.setOperand(1, "a%");
-        return new TstExpressionCase(
-            "Exhibit",
-            e1,
-            "UPPER(ta.GALLERY_NAME) LIKE UPPER(?)",
-            2,
-            2);
-    }
-
-    public TstBinaryExpSuite() {
-        addCase(like1);
-        addCase(likeic1);
-        addCase(in1);
-        addCase(in2);
-        addCase(isNull);
-        addCase(isNotNull);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/45b0ee10/cayenne-server/src/test/java/org/apache/cayenne/exp/TstExpressionCase.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstExpressionCase.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/TstExpressionCase.java
deleted file mode 100644
index b3bcd92..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstExpressionCase.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.exp;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-public class TstExpressionCase {
-
-	protected int totalNodes;
-	protected int totalLeaves;
-	protected Expression cayenneExp;
-	protected String sqlExp;
-	protected String rootEntity;
-
-	public TstExpressionCase(String rootEntity, Expression cayenneExp, String sqlExp, int totalNodes, int totalLeaves) {
-		this.cayenneExp = cayenneExp;
-		this.rootEntity = rootEntity;
-		this.sqlExp = sqlExp;
-		this.totalNodes = totalNodes;
-		this.totalLeaves = totalLeaves;
-	}
-
-	public int getTotalNodes() {
-		return totalNodes;
-	}
-
-	public int getTotalLeaves() {
-		return totalLeaves;
-	}
-
-	public Expression getCayenneExp() {
-		return cayenneExp;
-	}
-
-	@Override
-	public String toString() {
-		StringBuffer buf = new StringBuffer();
-		buf.append(this.getClass().getName()).append(cayenneExp);
-		return buf.toString();
-	}
-
-	public void assertTranslatedWell(String translated) {
-		if (sqlExp == null) {
-			assertNull(translated);
-			return;
-		}
-
-		assertNotNull(translated);
-		assertEquals("Unexpected translation: " + translated + "....", sqlExp, translated);
-	}
-
-	public String getRootEntity() {
-		return rootEntity;
-	}
-
-	public String getSqlExp() {
-		return sqlExp;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/45b0ee10/cayenne-server/src/test/java/org/apache/cayenne/exp/TstExpressionSuite.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstExpressionSuite.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/TstExpressionSuite.java
deleted file mode 100644
index 359e3c6..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstExpressionSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.exp;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class TstExpressionSuite {
-    private List cases = new ArrayList();
-    
-    public TstExpressionCase[] cases() {
-        TstExpressionCase[] exps = new TstExpressionCase[cases.size()];
-        cases.toArray(exps);
-        return exps;
-    }
-    
-    public void addCase(TstExpressionCase expCase) {
-        cases.add(expCase);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/45b0ee10/cayenne-server/src/test/java/org/apache/cayenne/exp/TstTernaryExpSuite.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstTernaryExpSuite.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/TstTernaryExpSuite.java
deleted file mode 100644
index a419381..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstTernaryExpSuite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.exp;
-
-public class TstTernaryExpSuite extends TstExpressionSuite {
-    
-    private static final TstExpressionCase between1 = buildBetween1();
-    
-    
-    /** Cayenne syntax: "toGallery.paintingArray.estimatedPrice between 3000 and 15000" */
-    private static TstExpressionCase buildBetween1() {           
-        Expression e1 = ExpressionFactory.expressionOfType(Expression.BETWEEN);
-        Expression e10 = ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "toGallery.paintingArray.estimatedPrice");
-        e1.setOperand(0, e10);
-        e1.setOperand(1, new Integer(3000));
-        e1.setOperand(2, new Integer(15000));
-        return new TstExpressionCase("Exhibit",
-        e1, 
-        "ta.ESTIMATED_PRICE BETWEEN ? AND ?",
-        2, 3);
-    }
-    
-    
-    public TstTernaryExpSuite() {
-        addCase(between1);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/45b0ee10/cayenne-server/src/test/java/org/apache/cayenne/exp/TstUnaryExpSuite.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstUnaryExpSuite.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/TstUnaryExpSuite.java
deleted file mode 100644
index b94ed22..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/exp/TstUnaryExpSuite.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-
-package org.apache.cayenne.exp;
-
-public class TstUnaryExpSuite extends TstExpressionSuite {
-    
-    private static final TstExpressionCase negative1 = buildNegative1();
-    private static final TstExpressionCase negative2 = buildNegative2();
-    private static final TstExpressionCase negative3 = buildNegative3();
-    
-    /** Cayenne syntax: "-5" */
-    private static TstExpressionCase buildNegative1() {           
-        Expression e1 = ExpressionFactory.expressionOfType(Expression.NEGATIVE);
-        e1.setOperand(0, new Integer(5));
-        return new TstExpressionCase("Painting",
-        e1, 
-        "-?",
-        1, 1
-        );
-    }
-    
-    /** Cayenne syntax: "-estimatedPrice" */
-    private static TstExpressionCase buildNegative2() {           
-        Expression e1 = ExpressionFactory.expressionOfType(Expression.NEGATIVE);
-        Expression e10 = ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "estimatedPrice");
-        e1.setOperand(0, e10);
-        return new TstExpressionCase("Painting",
-        e1, 
-        "-ta.ESTIMATED_PRICE",
-        2, 1
-        );
-    }
-    
-    /** Cayenne syntax: "-toGallery.paintingArray.estimatedPrice" */
-    private static TstExpressionCase buildNegative3() {           
-        Expression e1 = ExpressionFactory.expressionOfType(Expression.NEGATIVE);
-        Expression e10 = ExpressionFactory.expressionOfType(Expression.OBJ_PATH);
-        e10.setOperand(0, "toGallery.paintingArray.estimatedPrice");
-        e1.setOperand(0, e10);
-        return new TstExpressionCase("Exhibit",
-        e1, 
-        "-ta.ESTIMATED_PRICE",
-        2, 1
-        );
-    }
-    
-    
-    public TstUnaryExpSuite() {
-        addCase(negative1);
-        addCase(negative2);
-        addCase(negative3);
-    }
-}