db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1448414 [11/14] - in /db/torque/torque4/trunk/torque-runtime/src: main/java/org/apache/torque/ main/java/org/apache/torque/adapter/ main/java/org/apache/torque/criteria/ main/java/org/apache/torque/map/ main/java/org/apache/torque/oid/ mai...
Date Wed, 20 Feb 2013 21:06:37 GMT
Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java?rev=1448414&r1=1448413&r2=1448414&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java Wed Feb 20 21:06:35 2013
@@ -1,198 +1,198 @@
-package org.apache.torque.criteria;
-
-/*
- * 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.
- */
-
-import org.apache.torque.BaseTestCase;
-import org.apache.torque.ColumnImpl;
-
-/**
- * Test for the Criterion class.
- *
- * @version $Id$
- */
-public class CriterionTest extends BaseTestCase
-{
-
-    public void testHashCodeAndEquals()
-    {
-        Criterion criterion = new Criterion(
-                new ColumnImpl("myTable", "myColumn"),
-                "myValue",
-                Criteria.GREATER_EQUAL);
-        Criterion compareToCriterion = new Criterion(
-                new ColumnImpl("myTable", "myColumn"),
-                "myValue",
-                Criteria.GREATER_EQUAL);
-        assertEquals(criterion.hashCode(), compareToCriterion.hashCode());
-        assertEquals(criterion, compareToCriterion);
-    }
-
-    public void testToStringSingleCriterion()
-    {
-        Criterion criterion = new Criterion(
-                new ColumnImpl("myTable", "myColumn"),
-                "myValue");
-        assertEquals("myTable.myColumn=myValue",
-                criterion.toString());
-    }
-
-    public void testToStringCompositeCriterion()
-    {
-        Criterion criterion = new Criterion(
-                new ColumnImpl("myTable", "myColumn"),
-                "myValue");
-        Criterion innerCriterion = (new Criterion(
-                new ColumnImpl("myTable", "myColumn2"),
-                "myColumn2<abs(myValue2)",
-                SqlEnum.CUSTOM));
-        innerCriterion.and(new Criterion(
-                new ColumnImpl("myTable", "myColumn3"),
-                3,
-                SqlEnum.GREATER_EQUAL));
-        criterion.or(innerCriterion);
-        assertEquals("myTable.myColumn=myValue "
-                + "OR (myColumn2<abs(myValue2) "
-                + "AND myTable.myColumn3>=3)",
-            criterion.toString());
-    }
-
-    /**
-     * Tests that a criterion is copied when being anded to a top level
-     * criterion.
-     * checks TORQUE-243.
-     */
-    public void testCriterionAndedToTopLevelCriterionGetsCopied()
-    {
-        Criterion criterion = new Criterion(stringColumnMap, "abc");
-        Criterion andedCriterion = new Criterion(stringColumnMap, "def");
-        criterion.and(andedCriterion);
-        assertNotSame(criterion.getParts().get(0), andedCriterion);
-        assertNotSame(criterion.getParts().get(1), andedCriterion);
-    }
-
-    /**
-     * Tests that a criterion is copied when being ored to a top level
-     * criterion.
-     * checks TORQUE-243.
-     */
-    public void testCriterionOredToTopLevelCriterionGetsCopied()
-    {
-        Criterion criterion = new Criterion(stringColumnMap, "abc");
-        Criterion oredCriterion = new Criterion(stringColumnMap, "def");
-        criterion.or(oredCriterion);
-        assertNotSame(criterion.getParts().get(0), oredCriterion);
-        assertNotSame(criterion.getParts().get(1), oredCriterion);
-    }
-
-    /**
-     * Tests that a criterion is copied when being anded to a top level
-     * criterion.
-     * checks TORQUE-243.
-     */
-    public void testCriterionAndedToCriterionGetsCopied()
-    {
-        Criterion criterion = new Criterion(stringColumnMap, "abc");
-        criterion.and(new Criterion(stringColumnMap, "xyz"));
-        Criterion andedCriterion = new Criterion(stringColumnMap, "def");
-        criterion.and(andedCriterion);
-        assertNotSame(criterion.getParts().get(0), andedCriterion);
-        assertNotSame(criterion.getParts().get(1), andedCriterion);
-        assertNotSame(criterion.getParts().get(2), andedCriterion);
-    }
-
-    /**
-     * Tests that a criterion is copied when being ored to a top level
-     * criterion.
-     * checks TORQUE-243.
-     */
-    public void testCriterionOredToCriterionGetsCopied()
-    {
-        Criterion criterion = new Criterion(stringColumnMap, "abc");
-        criterion.or(new Criterion(stringColumnMap, "xyz"));
-        Criterion oredCriterion = new Criterion(stringColumnMap, "def");
-        criterion.or(oredCriterion);
-        assertNotSame(criterion.getParts().get(0), oredCriterion);
-        assertNotSame(criterion.getParts().get(1), oredCriterion);
-        assertNotSame(criterion.getParts().get(2), oredCriterion);
-    }
-
-    /**
-     * Tests that a criterion is copied when being added as top level criterion
-     * using where (also tests and).
-     * checks TORQUE-243.
-     */
-    public void testCopyConstructorSimpleCriterion()
-    {
-        Criterion criterion = new Criterion(stringColumnMap, "abc");
-        Criterion copied = new Criterion(criterion);
-        assertEquals(criterion.getLValue(), copied.getLValue());
-        assertEquals(criterion.getComparison(), copied.getComparison());
-        assertEquals(criterion.getRValue(), copied.getRValue());
-        assertNull(copied.getSql());
-        assertNull(copied.getPreparedStatementReplacements());
-        assertFalse(copied.isIgnoreCase());
-        assertNull(copied.getParts());
-        assertNull(copied.getConjunction());
-    }
-
-    /**
-     * Tests that a criterion is copied when being added as top level criterion
-     * using where (also tests and).
-     * checks TORQUE-243.
-     */
-    public void testCopyConstructorCompositeCriterion()
-    {
-        Criterion criterion = new Criterion(stringColumnMap, "abc");
-        criterion.or(new Criterion(stringColumnMap, "def"));
-        criterion.setIgnoreCase(true);
-        Criterion copied = new Criterion(criterion);
-        assertNull(criterion.getLValue());
-        assertNull(criterion.getComparison());
-        assertNull(criterion.getRValue());
-        assertNull(copied.getSql());
-        assertNull(copied.getPreparedStatementReplacements());
-        assertTrue(copied.isIgnoreCase());
-        assertEquals(criterion.getParts(), copied.getParts());
-        assertNotSame(criterion.getParts().get(0), copied.getParts().get(0));
-        assertNotSame(criterion.getParts().get(1), copied.getParts().get(1));
-        assertEquals(criterion.getConjunction(), copied.getConjunction());
-    }
-
-    /**
-     * Tests that a criterion is copied when being added as top level criterion
-     * using where (also tests and).
-     * checks TORQUE-243.
-     */
-    public void testCopyConstructorSqlCriterion()
-    {
-        Criterion criterion = new Criterion(null, null, null, "select 1", new Object[] {1});
-        Criterion copied = new Criterion(criterion);
-        assertNull(criterion.getLValue());
-        assertNull(criterion.getComparison());
-        assertNull(criterion.getRValue());
-        assertEquals(criterion.getSql(), copied.getSql());
-        assertEquals(
-                criterion.getPreparedStatementReplacements(),
-                copied.getPreparedStatementReplacements());
-        assertFalse(copied.isIgnoreCase());
-        assertNull(copied.getParts());
-        assertNull(copied.getConjunction());
-    }
-}
+package org.apache.torque.criteria;
+
+/*
+ * 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.
+ */
+
+import org.apache.torque.BaseTestCase;
+import org.apache.torque.ColumnImpl;
+
+/**
+ * Test for the Criterion class.
+ *
+ * @version $Id$
+ */
+public class CriterionTest extends BaseTestCase
+{
+
+    public void testHashCodeAndEquals()
+    {
+        Criterion criterion = new Criterion(
+                new ColumnImpl("myTable", "myColumn"),
+                "myValue",
+                Criteria.GREATER_EQUAL);
+        Criterion compareToCriterion = new Criterion(
+                new ColumnImpl("myTable", "myColumn"),
+                "myValue",
+                Criteria.GREATER_EQUAL);
+        assertEquals(criterion.hashCode(), compareToCriterion.hashCode());
+        assertEquals(criterion, compareToCriterion);
+    }
+
+    public void testToStringSingleCriterion()
+    {
+        Criterion criterion = new Criterion(
+                new ColumnImpl("myTable", "myColumn"),
+                "myValue");
+        assertEquals("myTable.myColumn=myValue",
+                criterion.toString());
+    }
+
+    public void testToStringCompositeCriterion()
+    {
+        Criterion criterion = new Criterion(
+                new ColumnImpl("myTable", "myColumn"),
+                "myValue");
+        Criterion innerCriterion = (new Criterion(
+                new ColumnImpl("myTable", "myColumn2"),
+                "myColumn2<abs(myValue2)",
+                SqlEnum.CUSTOM));
+        innerCriterion.and(new Criterion(
+                new ColumnImpl("myTable", "myColumn3"),
+                3,
+                SqlEnum.GREATER_EQUAL));
+        criterion.or(innerCriterion);
+        assertEquals("myTable.myColumn=myValue "
+                + "OR (myColumn2<abs(myValue2) "
+                + "AND myTable.myColumn3>=3)",
+            criterion.toString());
+    }
+
+    /**
+     * Tests that a criterion is copied when being anded to a top level
+     * criterion.
+     * checks TORQUE-243.
+     */
+    public void testCriterionAndedToTopLevelCriterionGetsCopied()
+    {
+        Criterion criterion = new Criterion(stringColumnMap, "abc");
+        Criterion andedCriterion = new Criterion(stringColumnMap, "def");
+        criterion.and(andedCriterion);
+        assertNotSame(criterion.getParts().get(0), andedCriterion);
+        assertNotSame(criterion.getParts().get(1), andedCriterion);
+    }
+
+    /**
+     * Tests that a criterion is copied when being ored to a top level
+     * criterion.
+     * checks TORQUE-243.
+     */
+    public void testCriterionOredToTopLevelCriterionGetsCopied()
+    {
+        Criterion criterion = new Criterion(stringColumnMap, "abc");
+        Criterion oredCriterion = new Criterion(stringColumnMap, "def");
+        criterion.or(oredCriterion);
+        assertNotSame(criterion.getParts().get(0), oredCriterion);
+        assertNotSame(criterion.getParts().get(1), oredCriterion);
+    }
+
+    /**
+     * Tests that a criterion is copied when being anded to a top level
+     * criterion.
+     * checks TORQUE-243.
+     */
+    public void testCriterionAndedToCriterionGetsCopied()
+    {
+        Criterion criterion = new Criterion(stringColumnMap, "abc");
+        criterion.and(new Criterion(stringColumnMap, "xyz"));
+        Criterion andedCriterion = new Criterion(stringColumnMap, "def");
+        criterion.and(andedCriterion);
+        assertNotSame(criterion.getParts().get(0), andedCriterion);
+        assertNotSame(criterion.getParts().get(1), andedCriterion);
+        assertNotSame(criterion.getParts().get(2), andedCriterion);
+    }
+
+    /**
+     * Tests that a criterion is copied when being ored to a top level
+     * criterion.
+     * checks TORQUE-243.
+     */
+    public void testCriterionOredToCriterionGetsCopied()
+    {
+        Criterion criterion = new Criterion(stringColumnMap, "abc");
+        criterion.or(new Criterion(stringColumnMap, "xyz"));
+        Criterion oredCriterion = new Criterion(stringColumnMap, "def");
+        criterion.or(oredCriterion);
+        assertNotSame(criterion.getParts().get(0), oredCriterion);
+        assertNotSame(criterion.getParts().get(1), oredCriterion);
+        assertNotSame(criterion.getParts().get(2), oredCriterion);
+    }
+
+    /**
+     * Tests that a criterion is copied when being added as top level criterion
+     * using where (also tests and).
+     * checks TORQUE-243.
+     */
+    public void testCopyConstructorSimpleCriterion()
+    {
+        Criterion criterion = new Criterion(stringColumnMap, "abc");
+        Criterion copied = new Criterion(criterion);
+        assertEquals(criterion.getLValue(), copied.getLValue());
+        assertEquals(criterion.getComparison(), copied.getComparison());
+        assertEquals(criterion.getRValue(), copied.getRValue());
+        assertNull(copied.getSql());
+        assertNull(copied.getPreparedStatementReplacements());
+        assertFalse(copied.isIgnoreCase());
+        assertNull(copied.getParts());
+        assertNull(copied.getConjunction());
+    }
+
+    /**
+     * Tests that a criterion is copied when being added as top level criterion
+     * using where (also tests and).
+     * checks TORQUE-243.
+     */
+    public void testCopyConstructorCompositeCriterion()
+    {
+        Criterion criterion = new Criterion(stringColumnMap, "abc");
+        criterion.or(new Criterion(stringColumnMap, "def"));
+        criterion.setIgnoreCase(true);
+        Criterion copied = new Criterion(criterion);
+        assertNull(criterion.getLValue());
+        assertNull(criterion.getComparison());
+        assertNull(criterion.getRValue());
+        assertNull(copied.getSql());
+        assertNull(copied.getPreparedStatementReplacements());
+        assertTrue(copied.isIgnoreCase());
+        assertEquals(criterion.getParts(), copied.getParts());
+        assertNotSame(criterion.getParts().get(0), copied.getParts().get(0));
+        assertNotSame(criterion.getParts().get(1), copied.getParts().get(1));
+        assertEquals(criterion.getConjunction(), copied.getConjunction());
+    }
+
+    /**
+     * Tests that a criterion is copied when being added as top level criterion
+     * using where (also tests and).
+     * checks TORQUE-243.
+     */
+    public void testCopyConstructorSqlCriterion()
+    {
+        Criterion criterion = new Criterion(null, null, null, "select 1", new Object[] {1});
+        Criterion copied = new Criterion(criterion);
+        assertNull(criterion.getLValue());
+        assertNull(criterion.getComparison());
+        assertNull(criterion.getRValue());
+        assertEquals(criterion.getSql(), copied.getSql());
+        assertEquals(
+                criterion.getPreparedStatementReplacements(),
+                copied.getPreparedStatementReplacements());
+        assertFalse(copied.isIgnoreCase());
+        assertNull(copied.getParts());
+        assertNull(copied.getConjunction());
+    }
+}

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/CriterionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/JoinTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/JoinTest.java?rev=1448414&r1=1448413&r2=1448414&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/JoinTest.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/JoinTest.java Wed Feb 20 21:06:35 2013
@@ -1,60 +1,60 @@
-package org.apache.torque.criteria;
-
-/*
- * 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.
- */
-
-import org.apache.torque.BaseTestCase;
-import org.apache.torque.ColumnImpl;
-
-/**
- * Test for the Join class.
- *
- * @version $Id$
- */
-public class JoinTest extends BaseTestCase
-{
-    public void testHashCodeAndEquals()
-    {
-        Join join = new Join(
-                new ColumnImpl("myTable1", "myColumn1"),
-                new ColumnImpl("myTable2", "myColumn2"),
-                Criteria.EQUAL,
-                Criteria.LEFT_JOIN);
-        Join compareToJoin = new Join(
-                new ColumnImpl("myTable1", "myColumn1"),
-                new ColumnImpl("myTable2", "myColumn2"),
-                Criteria.EQUAL,
-                Criteria.LEFT_JOIN);
-        assertEquals(join.hashCode(), compareToJoin.hashCode());
-        assertEquals(join, compareToJoin);
-    }
-
-
-    public void testToString()
-    {
-        Join join = new Join(
-                new ColumnImpl("myTable1", "myColumn1"),
-                new ColumnImpl("myTable2", "myColumn2"),
-                Criteria.NOT_EQUAL,
-                Criteria.LEFT_JOIN);
-        assertEquals(" LEFT JOIN (null, null): "
-                    + "myTable1.myColumn1<>myTable2.myColumn2",
-                join.toString());
-    }
-}
+package org.apache.torque.criteria;
+
+/*
+ * 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.
+ */
+
+import org.apache.torque.BaseTestCase;
+import org.apache.torque.ColumnImpl;
+
+/**
+ * Test for the Join class.
+ *
+ * @version $Id$
+ */
+public class JoinTest extends BaseTestCase
+{
+    public void testHashCodeAndEquals()
+    {
+        Join join = new Join(
+                new ColumnImpl("myTable1", "myColumn1"),
+                new ColumnImpl("myTable2", "myColumn2"),
+                Criteria.EQUAL,
+                Criteria.LEFT_JOIN);
+        Join compareToJoin = new Join(
+                new ColumnImpl("myTable1", "myColumn1"),
+                new ColumnImpl("myTable2", "myColumn2"),
+                Criteria.EQUAL,
+                Criteria.LEFT_JOIN);
+        assertEquals(join.hashCode(), compareToJoin.hashCode());
+        assertEquals(join, compareToJoin);
+    }
+
+
+    public void testToString()
+    {
+        Join join = new Join(
+                new ColumnImpl("myTable1", "myColumn1"),
+                new ColumnImpl("myTable2", "myColumn2"),
+                Criteria.NOT_EQUAL,
+                Criteria.LEFT_JOIN);
+        assertEquals(" LEFT JOIN (null, null): "
+                    + "myTable1.myColumn1<>myTable2.myColumn2",
+                join.toString());
+    }
+}

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/criteria/JoinTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/map/ColumnMapTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/map/ColumnMapTest.java?rev=1448414&r1=1448413&r2=1448414&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/map/ColumnMapTest.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/map/ColumnMapTest.java Wed Feb 20 21:06:35 2013
@@ -1,54 +1,54 @@
-package org.apache.torque.map;
-
-import org.apache.torque.BaseTestCase;
-
-
-/*
- * 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.
- */
-
-/**
- * Test for the class ColumnMap.
- *
- * @version $Id$
- */
-public class ColumnMapTest extends BaseTestCase
-{
-    public void testGetSqlExpressionNoSchemaDefaultSchemaNull()
-    {
-        ColumnMap column = new ColumnMap("columnName", tableMap);
-        assertEquals("TABLE.columnName", column.getSqlExpression());
-    }
-
-    public void testGetFullTableNameWithoutDefaultSchema()
-    {
-        ColumnMap column = new ColumnMap("columnName", tableMap);
-        assertEquals(
-                "TABLE",
-                column.getFullTableName());
-    }
-
-    public void testGetFullTableNameWithDefaultSchema()
-    {
-        tableMap = databaseMap.addTable("schemaName.TABLE");
-        ColumnMap column = new ColumnMap("columnName", tableMap);
-        assertEquals(
-                "schemaName.TABLE",
-                column.getFullTableName());
-    }
-}
+package org.apache.torque.map;
+
+import org.apache.torque.BaseTestCase;
+
+
+/*
+ * 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.
+ */
+
+/**
+ * Test for the class ColumnMap.
+ *
+ * @version $Id$
+ */
+public class ColumnMapTest extends BaseTestCase
+{
+    public void testGetSqlExpressionNoSchemaDefaultSchemaNull()
+    {
+        ColumnMap column = new ColumnMap("columnName", tableMap);
+        assertEquals("TABLE.columnName", column.getSqlExpression());
+    }
+
+    public void testGetFullTableNameWithoutDefaultSchema()
+    {
+        ColumnMap column = new ColumnMap("columnName", tableMap);
+        assertEquals(
+                "TABLE",
+                column.getFullTableName());
+    }
+
+    public void testGetFullTableNameWithDefaultSchema()
+    {
+        tableMap = databaseMap.addTable("schemaName.TABLE");
+        ColumnMap column = new ColumnMap("columnName", tableMap);
+        assertEquals(
+                "schemaName.TABLE",
+                column.getFullTableName());
+    }
+}

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/map/ColumnMapTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java?rev=1448414&r1=1448413&r2=1448414&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java Wed Feb 20 21:06:35 2013
@@ -1,127 +1,127 @@
-package org.apache.torque.om.mapper;
-
-/*
- * 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.
- */
-
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.math.BigDecimal;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.apache.torque.BaseTestCase;
-import org.apache.torque.TorqueException;
-import org.apache.torque.criteria.Criteria;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-public class BigDecimalMapperTest extends BaseTestCase
-{
-    /** Mock result set. */
-    @Mock
-    private ResultSet resultSet;
-
-    @Override
-    public void setUp() throws Exception
-    {
-        super.setUp();
-        MockitoAnnotations.initMocks(this);
-        when(resultSet.getBigDecimal(1)).thenReturn(null);
-        when(resultSet.getBigDecimal(2)).thenReturn(new BigDecimal(0));
-        when(resultSet.getBigDecimal(3)).thenReturn(new BigDecimal("123.456"));
-        when(resultSet.getBigDecimal(0)).thenThrow(
-                new SQLException("index must be >= 1"));
-    }
-
-    /**
-     * Tests the processRow method for a mapper without internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRow() throws Exception
-    {
-        // prepare
-        BigDecimalMapper mapper = new BigDecimalMapper();
-
-        // execute
-        BigDecimal result1 = mapper.processRow(resultSet, 0, null);
-        BigDecimal result2 = mapper.processRow(resultSet, 1, null);
-
-        // verify
-        assertEquals(null, result1);
-        assertEquals(new BigDecimal(0), result2);
-        verify(resultSet).getBigDecimal(1);
-        verify(resultSet).getBigDecimal(2);
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method for a mapper with internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowInternalOffset() throws Exception
-    {
-        // prepare
-        BigDecimalMapper mapper = new BigDecimalMapper(1);
-
-        // execute
-        BigDecimal result1 = mapper.processRow(resultSet, 0, new Criteria());
-        BigDecimal result2 = mapper.processRow(resultSet, 1, null);
-
-        // verify
-        assertEquals(new BigDecimal(0), result1);
-        assertEquals(new BigDecimal("123.456"), result2);
-        verify(resultSet).getBigDecimal(2);
-        verify(resultSet).getBigDecimal(3);
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method if the resultSet throws a SqlException.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowSqlException() throws Exception
-    {
-        // prepare
-        BigDecimalMapper mapper = new BigDecimalMapper();
-
-        // execute
-        try
-        {
-            mapper.processRow(resultSet, -1, new Criteria());
-            // verify 1
-            fail("Exception expected");
-        }
-        catch (TorqueException e)
-        {
-            // verify 2
-            assertEquals(
-                    "Result could not be mapped to a BigDecimal",
-                    e.getMessage());
-            assertEquals(SQLException.class, e.getCause().getClass());
-            assertEquals("index must be >= 1", e.getCause().getMessage());
-            verify(resultSet).getBigDecimal(0);
-            verifyNoMoreInteractions(resultSet);
-        }
-    }
-}
+package org.apache.torque.om.mapper;
+
+/*
+ * 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.
+ */
+
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.math.BigDecimal;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.apache.torque.BaseTestCase;
+import org.apache.torque.TorqueException;
+import org.apache.torque.criteria.Criteria;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class BigDecimalMapperTest extends BaseTestCase
+{
+    /** Mock result set. */
+    @Mock
+    private ResultSet resultSet;
+
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        MockitoAnnotations.initMocks(this);
+        when(resultSet.getBigDecimal(1)).thenReturn(null);
+        when(resultSet.getBigDecimal(2)).thenReturn(new BigDecimal(0));
+        when(resultSet.getBigDecimal(3)).thenReturn(new BigDecimal("123.456"));
+        when(resultSet.getBigDecimal(0)).thenThrow(
+                new SQLException("index must be >= 1"));
+    }
+
+    /**
+     * Tests the processRow method for a mapper without internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRow() throws Exception
+    {
+        // prepare
+        BigDecimalMapper mapper = new BigDecimalMapper();
+
+        // execute
+        BigDecimal result1 = mapper.processRow(resultSet, 0, null);
+        BigDecimal result2 = mapper.processRow(resultSet, 1, null);
+
+        // verify
+        assertEquals(null, result1);
+        assertEquals(new BigDecimal(0), result2);
+        verify(resultSet).getBigDecimal(1);
+        verify(resultSet).getBigDecimal(2);
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method for a mapper with internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowInternalOffset() throws Exception
+    {
+        // prepare
+        BigDecimalMapper mapper = new BigDecimalMapper(1);
+
+        // execute
+        BigDecimal result1 = mapper.processRow(resultSet, 0, new Criteria());
+        BigDecimal result2 = mapper.processRow(resultSet, 1, null);
+
+        // verify
+        assertEquals(new BigDecimal(0), result1);
+        assertEquals(new BigDecimal("123.456"), result2);
+        verify(resultSet).getBigDecimal(2);
+        verify(resultSet).getBigDecimal(3);
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method if the resultSet throws a SqlException.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowSqlException() throws Exception
+    {
+        // prepare
+        BigDecimalMapper mapper = new BigDecimalMapper();
+
+        // execute
+        try
+        {
+            mapper.processRow(resultSet, -1, new Criteria());
+            // verify 1
+            fail("Exception expected");
+        }
+        catch (TorqueException e)
+        {
+            // verify 2
+            assertEquals(
+                    "Result could not be mapped to a BigDecimal",
+                    e.getMessage());
+            assertEquals(SQLException.class, e.getCause().getClass());
+            assertEquals("index must be >= 1", e.getCause().getMessage());
+            verify(resultSet).getBigDecimal(0);
+            verifyNoMoreInteractions(resultSet);
+        }
+    }
+}

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/BigDecimalMapperTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java?rev=1448414&r1=1448413&r2=1448414&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java Wed Feb 20 21:06:35 2013
@@ -1,124 +1,124 @@
-package org.apache.torque.om.mapper;
-
-/*
- * 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.
- */
-
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.sql.ResultSet;
-import java.util.List;
-
-import org.apache.torque.BaseTestCase;
-import org.apache.torque.TorqueException;
-import org.apache.torque.criteria.Criteria;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-public class CompositeMapperTest extends BaseTestCase
-{
-    /** System under test. */
-    CompositeMapper mapper;
-
-    /** Mock result set. */
-    @Mock
-    private ResultSet resultSet;
-
-    /** Mock delegate RecordMapper. */
-    @Mock
-    private RecordMapper<?> recordMapper1;
-
-    /** Mock delegate RecordMapper. */
-    @Mock
-    private RecordMapper<Integer> recordMapper2;
-
-    /** Mock delegate RecordMapper. */
-    @Mock
-    private RecordMapper<Long> recordMapper3;
-
-    /** The fake criteria which produced the query .*/
-    private Criteria criteria = new Criteria();
-
-    @Override
-    public void setUp() throws Exception
-    {
-        super.setUp();
-        MockitoAnnotations.initMocks(this);
-        when(recordMapper1.processRow(resultSet,3, criteria))
-            .thenReturn(null);
-        when(recordMapper2.processRow(resultSet, 4, criteria))
-            .thenReturn(new Integer(1));
-        when(recordMapper3.processRow(resultSet, 5, criteria))
-            .thenReturn(new Long(2));
-
-        mapper = new CompositeMapper();
-        mapper.addMapper(recordMapper1, 1);
-        mapper.addMapper(recordMapper2, 2);
-        mapper.addMapper(recordMapper3, 3);
-    }
-
-    /**
-     * Tests the processRow method for a mapper without internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRow() throws Exception
-    {
-        // execute
-        List<Object> result = mapper.processRow(resultSet, 2, criteria);
-
-        // verify
-        assertEquals(3, result.size());
-        assertEquals(null, result.get(0));
-        assertEquals(new Integer(1), result.get(1));
-        assertEquals(new Long(2), result.get(2));
-        verify(recordMapper1).processRow(resultSet, 3, criteria);
-        verify(recordMapper2).processRow(resultSet, 4, criteria);
-        verify(recordMapper3).processRow(resultSet, 5, criteria);
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method if a delegate throws a SqlException.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowSqlException() throws Exception
-    {
-        // prepare
-        when(recordMapper1.processRow(resultSet, 1, criteria))
-            .thenThrow(new TorqueException("thrown by mock"));
-
-        // execute
-        try
-        {
-            mapper.processRow(resultSet, 0, criteria);
-            // verify 1
-            fail("Exception expected");
-        }
-        catch (TorqueException e)
-        {
-            // verify 2
-            assertEquals("thrown by mock", e.getMessage());
-            verify(recordMapper1).processRow(resultSet, 1, criteria);
-            verifyNoMoreInteractions(resultSet);
-        }
-    }
-}
+package org.apache.torque.om.mapper;
+
+/*
+ * 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.
+ */
+
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.sql.ResultSet;
+import java.util.List;
+
+import org.apache.torque.BaseTestCase;
+import org.apache.torque.TorqueException;
+import org.apache.torque.criteria.Criteria;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class CompositeMapperTest extends BaseTestCase
+{
+    /** System under test. */
+    CompositeMapper mapper;
+
+    /** Mock result set. */
+    @Mock
+    private ResultSet resultSet;
+
+    /** Mock delegate RecordMapper. */
+    @Mock
+    private RecordMapper<?> recordMapper1;
+
+    /** Mock delegate RecordMapper. */
+    @Mock
+    private RecordMapper<Integer> recordMapper2;
+
+    /** Mock delegate RecordMapper. */
+    @Mock
+    private RecordMapper<Long> recordMapper3;
+
+    /** The fake criteria which produced the query .*/
+    private Criteria criteria = new Criteria();
+
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        MockitoAnnotations.initMocks(this);
+        when(recordMapper1.processRow(resultSet,3, criteria))
+            .thenReturn(null);
+        when(recordMapper2.processRow(resultSet, 4, criteria))
+            .thenReturn(new Integer(1));
+        when(recordMapper3.processRow(resultSet, 5, criteria))
+            .thenReturn(new Long(2));
+
+        mapper = new CompositeMapper();
+        mapper.addMapper(recordMapper1, 1);
+        mapper.addMapper(recordMapper2, 2);
+        mapper.addMapper(recordMapper3, 3);
+    }
+
+    /**
+     * Tests the processRow method for a mapper without internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRow() throws Exception
+    {
+        // execute
+        List<Object> result = mapper.processRow(resultSet, 2, criteria);
+
+        // verify
+        assertEquals(3, result.size());
+        assertEquals(null, result.get(0));
+        assertEquals(new Integer(1), result.get(1));
+        assertEquals(new Long(2), result.get(2));
+        verify(recordMapper1).processRow(resultSet, 3, criteria);
+        verify(recordMapper2).processRow(resultSet, 4, criteria);
+        verify(recordMapper3).processRow(resultSet, 5, criteria);
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method if a delegate throws a SqlException.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowSqlException() throws Exception
+    {
+        // prepare
+        when(recordMapper1.processRow(resultSet, 1, criteria))
+            .thenThrow(new TorqueException("thrown by mock"));
+
+        // execute
+        try
+        {
+            mapper.processRow(resultSet, 0, criteria);
+            // verify 1
+            fail("Exception expected");
+        }
+        catch (TorqueException e)
+        {
+            // verify 2
+            assertEquals("thrown by mock", e.getMessage());
+            verify(recordMapper1).processRow(resultSet, 1, criteria);
+            verifyNoMoreInteractions(resultSet);
+        }
+    }
+}

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/CompositeMapperTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/DateMapperTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/DateMapperTest.java?rev=1448414&r1=1448413&r2=1448414&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/DateMapperTest.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/DateMapperTest.java Wed Feb 20 21:06:35 2013
@@ -1,129 +1,129 @@
-package org.apache.torque.om.mapper;
-
-/*
- * 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.
- */
-
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Date;
-
-import org.apache.torque.BaseTestCase;
-import org.apache.torque.TorqueException;
-import org.apache.torque.criteria.Criteria;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-public class DateMapperTest extends BaseTestCase
-{
-    /** Mock result set. */
-    @Mock
-    private ResultSet resultSet;
-
-    @Override
-    public void setUp() throws Exception
-    {
-        super.setUp();
-        MockitoAnnotations.initMocks(this);
-        when(resultSet.getTimestamp(1)).thenReturn(null);
-        when(resultSet.getTimestamp(2)).thenReturn(
-                new java.sql.Timestamp(0));
-        when(resultSet.getTimestamp(3)).thenReturn(
-                new java.sql.Timestamp(123456));
-        when(resultSet.getTimestamp(0)).thenThrow(
-                new SQLException("index must be >= 1"));
-    }
-
-    /**
-     * Tests the processRow method for a mapper without internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRow() throws Exception
-    {
-        // prepare
-        DateMapper mapper = new DateMapper();
-
-        // execute
-        Date result1 = mapper.processRow(resultSet, 0, null);
-        Date result2 = mapper.processRow(resultSet, 1, null);
-
-        // verify
-        assertEquals(null, result1);
-        assertEquals(new Date(0), result2);
-        verify(resultSet).getTimestamp(1);
-        verify(resultSet).getTimestamp(2);
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method for a mapper with internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowInternalOffset() throws Exception
-    {
-        // prepare
-        DateMapper mapper = new DateMapper(1);
-
-        // execute
-        Date result1 = mapper.processRow(resultSet, 0, new Criteria());
-        Date result2 = mapper.processRow(resultSet, 1, null);
-
-        // verify
-        assertEquals(new Date(0), result1);
-        assertEquals(new Date(123456L), result2);
-        verify(resultSet).getTimestamp(2);
-        verify(resultSet).getTimestamp(3);
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method if the resultSet throws a SqlException.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowSqlException() throws Exception
-    {
-        // prepare
-        DateMapper mapper = new DateMapper();
-
-        // execute
-        try
-        {
-            mapper.processRow(resultSet, -1, new Criteria());
-            // verify 1
-            fail("Exception expected");
-        }
-        catch (TorqueException e)
-        {
-            // verify 2
-            assertEquals(
-                    "Result could not be mapped to a Date",
-                    e.getMessage());
-            assertEquals(SQLException.class, e.getCause().getClass());
-            assertEquals("index must be >= 1", e.getCause().getMessage());
-            verify(resultSet).getTimestamp(0);
-            verifyNoMoreInteractions(resultSet);
-        }
-    }
-}
+package org.apache.torque.om.mapper;
+
+/*
+ * 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.
+ */
+
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Date;
+
+import org.apache.torque.BaseTestCase;
+import org.apache.torque.TorqueException;
+import org.apache.torque.criteria.Criteria;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class DateMapperTest extends BaseTestCase
+{
+    /** Mock result set. */
+    @Mock
+    private ResultSet resultSet;
+
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        MockitoAnnotations.initMocks(this);
+        when(resultSet.getTimestamp(1)).thenReturn(null);
+        when(resultSet.getTimestamp(2)).thenReturn(
+                new java.sql.Timestamp(0));
+        when(resultSet.getTimestamp(3)).thenReturn(
+                new java.sql.Timestamp(123456));
+        when(resultSet.getTimestamp(0)).thenThrow(
+                new SQLException("index must be >= 1"));
+    }
+
+    /**
+     * Tests the processRow method for a mapper without internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRow() throws Exception
+    {
+        // prepare
+        DateMapper mapper = new DateMapper();
+
+        // execute
+        Date result1 = mapper.processRow(resultSet, 0, null);
+        Date result2 = mapper.processRow(resultSet, 1, null);
+
+        // verify
+        assertEquals(null, result1);
+        assertEquals(new Date(0), result2);
+        verify(resultSet).getTimestamp(1);
+        verify(resultSet).getTimestamp(2);
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method for a mapper with internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowInternalOffset() throws Exception
+    {
+        // prepare
+        DateMapper mapper = new DateMapper(1);
+
+        // execute
+        Date result1 = mapper.processRow(resultSet, 0, new Criteria());
+        Date result2 = mapper.processRow(resultSet, 1, null);
+
+        // verify
+        assertEquals(new Date(0), result1);
+        assertEquals(new Date(123456L), result2);
+        verify(resultSet).getTimestamp(2);
+        verify(resultSet).getTimestamp(3);
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method if the resultSet throws a SqlException.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowSqlException() throws Exception
+    {
+        // prepare
+        DateMapper mapper = new DateMapper();
+
+        // execute
+        try
+        {
+            mapper.processRow(resultSet, -1, new Criteria());
+            // verify 1
+            fail("Exception expected");
+        }
+        catch (TorqueException e)
+        {
+            // verify 2
+            assertEquals(
+                    "Result could not be mapped to a Date",
+                    e.getMessage());
+            assertEquals(SQLException.class, e.getCause().getClass());
+            assertEquals("index must be >= 1", e.getCause().getMessage());
+            verify(resultSet).getTimestamp(0);
+            verifyNoMoreInteractions(resultSet);
+        }
+    }
+}

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/DateMapperTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/DateMapperTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java?rev=1448414&r1=1448413&r2=1448414&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java Wed Feb 20 21:06:35 2013
@@ -1,129 +1,129 @@
-package org.apache.torque.om.mapper;
-
-/*
- * 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.
- */
-
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.apache.torque.BaseTestCase;
-import org.apache.torque.TorqueException;
-import org.apache.torque.criteria.Criteria;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-public class IntegerMapperTest extends BaseTestCase
-{
-    /** Mock result set. */
-    @Mock
-    private ResultSet resultSet;
-
-    @Override
-    public void setUp() throws Exception
-    {
-        super.setUp();
-        MockitoAnnotations.initMocks(this);
-        when(resultSet.getInt(1)).thenReturn(0);
-        when(resultSet.getInt(2)).thenReturn(-273343444);
-        when(resultSet.getInt(3)).thenReturn(353344556);
-        when(resultSet.getInt(0)).thenThrow(
-                new SQLException("index must be >= 1"));
-        when(resultSet.wasNull()).thenReturn(true);
-    }
-
-    /**
-     * Tests the processRow method for a mapper without internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRow() throws Exception
-    {
-        // prepare
-        IntegerMapper mapper = new IntegerMapper();
-
-        // execute
-        Integer result1 = mapper.processRow(resultSet, 0, new Criteria());
-        Integer result2 = mapper.processRow(resultSet, 1, null);
-
-        // verify
-        assertEquals(null, result1);
-        assertEquals(Integer.valueOf(-273343444), result2);
-        // verify mock (verification order not relevant)
-        verify(resultSet).getInt(1);
-        verify(resultSet).getInt(2);
-        verify(resultSet).wasNull();
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method for a mapper with internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowInternalOffset() throws Exception
-    {
-        // prepare
-        IntegerMapper mapper = new IntegerMapper(1);
-
-        // execute
-        Integer result1 = mapper.processRow(resultSet, 0, null);
-        Integer result2 = mapper.processRow(resultSet, 1, new Criteria());
-
-        // verify
-        assertEquals(Integer.valueOf(-273343444), result1);
-        assertEquals(Integer.valueOf(353344556), result2);
-        verify(resultSet).getInt(2);
-        verify(resultSet).getInt(3);
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method if the resultSet throws a SqlException.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowSqlException() throws Exception
-    {
-        // prepare
-        IntegerMapper mapper = new IntegerMapper();
-
-        // execute
-        try
-        {
-            mapper.processRow(resultSet, -1, new Criteria());
-            // verify 1
-            fail("Exception expected");
-        }
-        catch (TorqueException e)
-        {
-            // verify 2
-            assertEquals(
-                    "Result could not be mapped to a Integer",
-                    e.getMessage());
-            assertEquals(SQLException.class, e.getCause().getClass());
-            assertEquals("index must be >= 1", e.getCause().getMessage());
-            verify(resultSet).getInt(0);
-            verifyNoMoreInteractions(resultSet);
-        }
-    }
-}
+package org.apache.torque.om.mapper;
+
+/*
+ * 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.
+ */
+
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.apache.torque.BaseTestCase;
+import org.apache.torque.TorqueException;
+import org.apache.torque.criteria.Criteria;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class IntegerMapperTest extends BaseTestCase
+{
+    /** Mock result set. */
+    @Mock
+    private ResultSet resultSet;
+
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        MockitoAnnotations.initMocks(this);
+        when(resultSet.getInt(1)).thenReturn(0);
+        when(resultSet.getInt(2)).thenReturn(-273343444);
+        when(resultSet.getInt(3)).thenReturn(353344556);
+        when(resultSet.getInt(0)).thenThrow(
+                new SQLException("index must be >= 1"));
+        when(resultSet.wasNull()).thenReturn(true);
+    }
+
+    /**
+     * Tests the processRow method for a mapper without internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRow() throws Exception
+    {
+        // prepare
+        IntegerMapper mapper = new IntegerMapper();
+
+        // execute
+        Integer result1 = mapper.processRow(resultSet, 0, new Criteria());
+        Integer result2 = mapper.processRow(resultSet, 1, null);
+
+        // verify
+        assertEquals(null, result1);
+        assertEquals(Integer.valueOf(-273343444), result2);
+        // verify mock (verification order not relevant)
+        verify(resultSet).getInt(1);
+        verify(resultSet).getInt(2);
+        verify(resultSet).wasNull();
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method for a mapper with internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowInternalOffset() throws Exception
+    {
+        // prepare
+        IntegerMapper mapper = new IntegerMapper(1);
+
+        // execute
+        Integer result1 = mapper.processRow(resultSet, 0, null);
+        Integer result2 = mapper.processRow(resultSet, 1, new Criteria());
+
+        // verify
+        assertEquals(Integer.valueOf(-273343444), result1);
+        assertEquals(Integer.valueOf(353344556), result2);
+        verify(resultSet).getInt(2);
+        verify(resultSet).getInt(3);
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method if the resultSet throws a SqlException.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowSqlException() throws Exception
+    {
+        // prepare
+        IntegerMapper mapper = new IntegerMapper();
+
+        // execute
+        try
+        {
+            mapper.processRow(resultSet, -1, new Criteria());
+            // verify 1
+            fail("Exception expected");
+        }
+        catch (TorqueException e)
+        {
+            // verify 2
+            assertEquals(
+                    "Result could not be mapped to a Integer",
+                    e.getMessage());
+            assertEquals(SQLException.class, e.getCause().getClass());
+            assertEquals("index must be >= 1", e.getCause().getMessage());
+            verify(resultSet).getInt(0);
+            verifyNoMoreInteractions(resultSet);
+        }
+    }
+}

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/IntegerMapperTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/LongMapperTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/LongMapperTest.java?rev=1448414&r1=1448413&r2=1448414&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/LongMapperTest.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/LongMapperTest.java Wed Feb 20 21:06:35 2013
@@ -1,129 +1,129 @@
-package org.apache.torque.om.mapper;
-
-/*
- * 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.
- */
-
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.apache.torque.BaseTestCase;
-import org.apache.torque.TorqueException;
-import org.apache.torque.criteria.Criteria;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-public class LongMapperTest extends BaseTestCase
-{
-    /** Mock result set. */
-    @Mock
-    private ResultSet resultSet;
-
-    @Override
-    public void setUp() throws Exception
-    {
-        super.setUp();
-        MockitoAnnotations.initMocks(this);
-        when(resultSet.getLong(1)).thenReturn(0L);
-        when(resultSet.getLong(2)).thenReturn(-2733434442345777L);
-        when(resultSet.getLong(3)).thenReturn(35334455623667566L);
-        when(resultSet.getLong(0)).thenThrow(
-                new SQLException("index must be >= 1"));
-        when(resultSet.wasNull()).thenReturn(true);
-    }
-
-    /**
-     * Tests the processRow method for a mapper without internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRow() throws Exception
-    {
-        // prepare
-        LongMapper mapper = new LongMapper();
-
-        // execute
-        Long result1 = mapper.processRow(resultSet, 0, new Criteria());
-        Long result2 = mapper.processRow(resultSet, 1, null);
-
-        // verify
-        assertEquals(null, result1);
-        assertEquals(Long.valueOf(-2733434442345777L), result2);
-        // verify mock (verification order not relevant)
-        verify(resultSet).getLong(1);
-        verify(resultSet).getLong(2);
-        verify(resultSet).wasNull();
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method for a mapper with internal Offset.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowInternalOffset() throws Exception
-    {
-        // prepare
-        LongMapper mapper = new LongMapper(1);
-
-        // execute
-        Long result1 = mapper.processRow(resultSet, 0, null);
-        Long result2 = mapper.processRow(resultSet, 1, new Criteria());
-
-        // verify
-        assertEquals(Long.valueOf(-2733434442345777L), result1);
-        assertEquals(Long.valueOf(35334455623667566L), result2);
-        verify(resultSet).getLong(2);
-        verify(resultSet).getLong(3);
-        verifyNoMoreInteractions(resultSet);
-    }
-
-    /**
-     * Tests the processRow method if the resultSet throws a SqlException.
-     *
-     * @throws Exception if the test fails
-     */
-    public void testProcessRowSqlException() throws Exception
-    {
-        // prepare
-        LongMapper mapper = new LongMapper();
-
-        // execute
-        try
-        {
-            mapper.processRow(resultSet, -1, new Criteria());
-            // verify 1
-            fail("Exception expected");
-        }
-        catch (TorqueException e)
-        {
-            // verify 2
-            assertEquals(
-                    "Result could not be mapped to a Long",
-                    e.getMessage());
-            assertEquals(SQLException.class, e.getCause().getClass());
-            assertEquals("index must be >= 1", e.getCause().getMessage());
-            verify(resultSet).getLong(0);
-            verifyNoMoreInteractions(resultSet);
-        }
-    }
-}
+package org.apache.torque.om.mapper;
+
+/*
+ * 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.
+ */
+
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.apache.torque.BaseTestCase;
+import org.apache.torque.TorqueException;
+import org.apache.torque.criteria.Criteria;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class LongMapperTest extends BaseTestCase
+{
+    /** Mock result set. */
+    @Mock
+    private ResultSet resultSet;
+
+    @Override
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        MockitoAnnotations.initMocks(this);
+        when(resultSet.getLong(1)).thenReturn(0L);
+        when(resultSet.getLong(2)).thenReturn(-2733434442345777L);
+        when(resultSet.getLong(3)).thenReturn(35334455623667566L);
+        when(resultSet.getLong(0)).thenThrow(
+                new SQLException("index must be >= 1"));
+        when(resultSet.wasNull()).thenReturn(true);
+    }
+
+    /**
+     * Tests the processRow method for a mapper without internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRow() throws Exception
+    {
+        // prepare
+        LongMapper mapper = new LongMapper();
+
+        // execute
+        Long result1 = mapper.processRow(resultSet, 0, new Criteria());
+        Long result2 = mapper.processRow(resultSet, 1, null);
+
+        // verify
+        assertEquals(null, result1);
+        assertEquals(Long.valueOf(-2733434442345777L), result2);
+        // verify mock (verification order not relevant)
+        verify(resultSet).getLong(1);
+        verify(resultSet).getLong(2);
+        verify(resultSet).wasNull();
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method for a mapper with internal Offset.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowInternalOffset() throws Exception
+    {
+        // prepare
+        LongMapper mapper = new LongMapper(1);
+
+        // execute
+        Long result1 = mapper.processRow(resultSet, 0, null);
+        Long result2 = mapper.processRow(resultSet, 1, new Criteria());
+
+        // verify
+        assertEquals(Long.valueOf(-2733434442345777L), result1);
+        assertEquals(Long.valueOf(35334455623667566L), result2);
+        verify(resultSet).getLong(2);
+        verify(resultSet).getLong(3);
+        verifyNoMoreInteractions(resultSet);
+    }
+
+    /**
+     * Tests the processRow method if the resultSet throws a SqlException.
+     *
+     * @throws Exception if the test fails
+     */
+    public void testProcessRowSqlException() throws Exception
+    {
+        // prepare
+        LongMapper mapper = new LongMapper();
+
+        // execute
+        try
+        {
+            mapper.processRow(resultSet, -1, new Criteria());
+            // verify 1
+            fail("Exception expected");
+        }
+        catch (TorqueException e)
+        {
+            // verify 2
+            assertEquals(
+                    "Result could not be mapped to a Long",
+                    e.getMessage());
+            assertEquals(SQLException.class, e.getCause().getClass());
+            assertEquals("index must be >= 1", e.getCause().getMessage());
+            verify(resultSet).getLong(0);
+            verifyNoMoreInteractions(resultSet);
+        }
+    }
+}

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/LongMapperTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: db/torque/torque4/trunk/torque-runtime/src/test/java/org/apache/torque/om/mapper/LongMapperTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message