http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/ObjectStoreIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/ObjectStoreIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/ObjectStoreIT.java index 4929c4f..55c5efc 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/ObjectStoreIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/ObjectStoreIT.java @@ -35,6 +35,11 @@ import org.junit.Test; import java.util.Collections; import java.util.Date; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ObjectStoreIT extends ServerCase {
http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/OptimisticLockingIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/OptimisticLockingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/OptimisticLockingIT.java index 20e9f07..edcf679 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/OptimisticLockingIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/OptimisticLockingIT.java @@ -35,6 +35,11 @@ import java.sql.Types; import java.util.List; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.LOCKING_PROJECT) public class OptimisticLockingIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/PrefetchProcessorTreeBuilderIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/PrefetchProcessorTreeBuilderIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/PrefetchProcessorTreeBuilderIT.java index 6e9a6ad..5a4e6fa 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/PrefetchProcessorTreeBuilderIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/PrefetchProcessorTreeBuilderIT.java @@ -41,6 +41,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class PrefetchProcessorTreeBuilderIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/QuotedIdentifiersIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/QuotedIdentifiersIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/QuotedIdentifiersIT.java index 2eac6d0..b629dbb 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/QuotedIdentifiersIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/QuotedIdentifiersIT.java @@ -39,6 +39,8 @@ import java.util.Collections; import java.util.Date; import java.util.List; +import static org.junit.Assert.assertEquals; + @UseServerRuntime(ServerCase.QUOTED_IDENTIFIERS_PROJECT) public class QuotedIdentifiersIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java index d84939c..9b61b6a 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/ReturnTypesMappingIT.java @@ -38,6 +38,10 @@ import java.util.Arrays; import java.util.Calendar; import java.util.Date; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Test Types mapping for selected columns */ http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListDataRowsIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListDataRowsIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListDataRowsIT.java index 99e5f41..d1d6ee6 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListDataRowsIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListDataRowsIT.java @@ -35,6 +35,10 @@ import org.junit.Test; import java.util.Iterator; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Tests IncrementalFaultList behavior when fetching data rows. */ http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListIT.java index 22e3691..42dbc25 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListIT.java @@ -37,6 +37,12 @@ import java.util.Iterator; import java.util.List; import java.util.ListIterator; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SimpleIdIncrementalFaultListIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListPrefetchIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListPrefetchIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListPrefetchIT.java index 6194ff8..fee6220 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListPrefetchIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/SimpleIdIncrementalFaultListPrefetchIT.java @@ -39,6 +39,11 @@ import org.junit.Test; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SimpleIdIncrementalFaultListPrefetchIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritance1IT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritance1IT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritance1IT.java index 31e093c..02b2c41 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritance1IT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritance1IT.java @@ -31,6 +31,8 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertTrue; + /** * Special test cases per CAY-1378, CAY-1379. */ http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritanceIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritanceIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritanceIT.java index 22a6e8b..8f8cd39 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritanceIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/SingleTableInheritanceIT.java @@ -49,6 +49,11 @@ import java.sql.Types; import java.util.Arrays; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.PEOPLE_PROJECT) public class SingleTableInheritanceIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/ToManyListIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/ToManyListIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/ToManyListIT.java index e31a0bd..6355ed5 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/ToManyListIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/ToManyListIT.java @@ -33,6 +33,10 @@ import java.lang.reflect.Field; import java.util.LinkedList; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ToManyListIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/TransactionThreadIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/TransactionThreadIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/TransactionThreadIT.java index b4a9b10..caf6d6a 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/TransactionThreadIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/TransactionThreadIT.java @@ -33,6 +33,9 @@ import org.junit.Test; import java.sql.Connection; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class TransactionThreadIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java index e3cb82e..45ab106 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/UUIDIT.java @@ -32,6 +32,9 @@ import org.junit.Test; import java.util.UUID; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class UUIDIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/UserTransactionIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/UserTransactionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/UserTransactionIT.java index 3d77739..d88ae08 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/UserTransactionIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/UserTransactionIT.java @@ -32,6 +32,8 @@ import org.junit.Test; import java.sql.Connection; +import static org.junit.Assert.assertEquals; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class UserTransactionIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java index c389fa1..f93f140 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java @@ -41,6 +41,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.INHERTITANCE_VERTICAL_PROJECT) public class VerticalInheritanceIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/SchemaUpdateStrategyIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/SchemaUpdateStrategyIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/SchemaUpdateStrategyIT.java index 8ac759d..29ca1ae 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/SchemaUpdateStrategyIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/SchemaUpdateStrategyIT.java @@ -29,6 +29,9 @@ import org.junit.Test; import java.util.Collections; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.SUS_PROJECT) public class SchemaUpdateStrategyIT extends SchemaUpdateStrategyBase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialOrCreateSchemaStrategyIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialOrCreateSchemaStrategyIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialOrCreateSchemaStrategyIT.java new file mode 100644 index 0000000..f38e524 --- /dev/null +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialOrCreateSchemaStrategyIT.java @@ -0,0 +1,85 @@ +/***************************************************************** + * 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.access.dbsync; + +import org.apache.cayenne.CayenneRuntimeException; +import org.apache.cayenne.access.OperationObserver; +import org.apache.cayenne.query.SQLTemplate; +import org.apache.cayenne.unit.di.server.ServerCase; +import org.apache.cayenne.unit.di.server.UseServerRuntime; +import org.junit.Test; + +import java.util.Collections; +import java.util.Map; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; + +@UseServerRuntime(ServerCase.SUS_PROJECT) +public class ThrowOnPartialOrCreateSchemaStrategyIT extends SchemaUpdateStrategyBase { + + @Test + public void testMixedStrategyTableExist() throws Exception { + + createOneTable("SUS1"); + createOneTable("SUS2"); + + String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; + SQLTemplate query = new SQLTemplate(Object.class, template); + + setStrategy(ThrowOnPartialOrCreateSchemaStrategy.class); + node.performQueries(Collections.singletonList(query), mock(OperationObserver.class)); + } + + @Test + public void testMixedStrategyTableNoExist() throws Exception { + + String template = "SELECT #result('id' 'int') FROM SUS1"; + SQLTemplate query = new SQLTemplate(Object.class, template); + + setStrategy(ThrowOnPartialOrCreateSchemaStrategy.class); + + node.performQueries(Collections.singletonList(query), mock(OperationObserver.class)); + Map<String, Boolean> nameTables = tablesMap(); + assertTrue(nameTables.get("SUS1")); + assertEquals(2, existingTables().size()); + + node.performQueries(Collections.singletonList(query), mock(OperationObserver.class)); + assertEquals(2, existingTables().size()); + } + + @Test + public void testMixedStrategyWithOneTable() throws Exception { + createOneTable("SUS1"); + setStrategy(ThrowOnPartialOrCreateSchemaStrategy.class); + + String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; + SQLTemplate query = new SQLTemplate(Object.class, template); + + try { + node.performQueries(Collections.singletonList(query), mock(OperationObserver.class)); + assertEquals(1, existingTables().size()); + fail("Must have thrown on partial schema"); + } catch (CayenneRuntimeException e) { + // expected + } + } +} http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialOrCreateSchemaStrategyTest.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialOrCreateSchemaStrategyTest.java b/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialOrCreateSchemaStrategyTest.java deleted file mode 100644 index cd7f7af..0000000 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialOrCreateSchemaStrategyTest.java +++ /dev/null @@ -1,82 +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.access.dbsync; - -import org.apache.cayenne.CayenneRuntimeException; -import org.apache.cayenne.access.OperationObserver; -import org.apache.cayenne.query.SQLTemplate; -import org.apache.cayenne.unit.di.server.ServerCase; -import org.apache.cayenne.unit.di.server.UseServerRuntime; -import org.junit.Test; - -import java.util.Collections; -import java.util.Map; - -import static org.mockito.Mockito.mock; - -@UseServerRuntime(ServerCase.SUS_PROJECT) -public class ThrowOnPartialOrCreateSchemaStrategyTest extends SchemaUpdateStrategyBase { - - @Test - public void testMixedStrategyTableExist() throws Exception { - - createOneTable("SUS1"); - createOneTable("SUS2"); - - String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; - SQLTemplate query = new SQLTemplate(Object.class, template); - - setStrategy(ThrowOnPartialOrCreateSchemaStrategy.class); - node.performQueries(Collections.singletonList(query), mock(OperationObserver.class)); - } - - @Test - public void testMixedStrategyTableNoExist() throws Exception { - - String template = "SELECT #result('id' 'int') FROM SUS1"; - SQLTemplate query = new SQLTemplate(Object.class, template); - - setStrategy(ThrowOnPartialOrCreateSchemaStrategy.class); - - node.performQueries(Collections.singletonList(query), mock(OperationObserver.class)); - Map<String, Boolean> nameTables = tablesMap(); - assertTrue(nameTables.get("SUS1")); - assertEquals(2, existingTables().size()); - - node.performQueries(Collections.singletonList(query), mock(OperationObserver.class)); - assertEquals(2, existingTables().size()); - } - - @Test - public void testMixedStrategyWithOneTable() throws Exception { - createOneTable("SUS1"); - setStrategy(ThrowOnPartialOrCreateSchemaStrategy.class); - - String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; - SQLTemplate query = new SQLTemplate(Object.class, template); - - try { - node.performQueries(Collections.singletonList(query), mock(OperationObserver.class)); - assertEquals(1, existingTables().size()); - fail("Must have thrown on partial schema"); - } catch (CayenneRuntimeException e) { - // expected - } - } -} http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialSchemaStrategyIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialSchemaStrategyIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialSchemaStrategyIT.java new file mode 100644 index 0000000..8738e2f --- /dev/null +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialSchemaStrategyIT.java @@ -0,0 +1,93 @@ +/***************************************************************** + * 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.access.dbsync; + +import org.apache.cayenne.CayenneRuntimeException; +import org.apache.cayenne.access.MockOperationObserver; +import org.apache.cayenne.query.Query; +import org.apache.cayenne.query.SQLTemplate; +import org.apache.cayenne.unit.di.server.ServerCase; +import org.apache.cayenne.unit.di.server.UseServerRuntime; +import org.junit.Test; + +import java.util.Collections; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +@UseServerRuntime(ServerCase.SUS_PROJECT) +public class ThrowOnPartialSchemaStrategyIT extends SchemaUpdateStrategyBase { + + @Test + public void testThrowOnPartialStrategyTableNoExist() throws Exception { + + String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; + SQLTemplate query = new SQLTemplate(Object.class, template); + MockOperationObserver observer = new MockOperationObserver(); + + setStrategy(ThrowOnPartialSchemaStrategy.class); + + try { + node.performQueries(Collections.singletonList((Query) query), observer); + } catch (CayenneRuntimeException e) { + assertNotNull(e); + } + + try { + node.performQueries(Collections.singletonList((Query) query), observer); + } catch (CayenneRuntimeException e) { + assertNotNull(e); + } + } + + @Test + public void testThrowOnPartialStrategyTableExist() throws Exception { + + String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; + SQLTemplate query = new SQLTemplate(Object.class, template); + MockOperationObserver observer = new MockOperationObserver(); + + createOneTable("SUS1"); + createOneTable("SUS2"); + + setStrategy(ThrowOnPartialSchemaStrategy.class); + node.performQueries(Collections.singletonList(query), observer); + } + + @Test + public void testThrowOnPartialStrategyWithOneTable() throws Exception { + createOneTable("SUS1"); + + setStrategy(ThrowOnPartialSchemaStrategy.class); + + String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; + SQLTemplate query = new SQLTemplate(Object.class, template); + MockOperationObserver observer = new MockOperationObserver(); + + try { + node.performQueries(Collections.singletonList(query), observer); + assertEquals(1, existingTables().size()); + fail("Must have thrown on partial schema"); + } catch (CayenneRuntimeException e) { + // expected + } + } + +} http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialSchemaStrategyTest.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialSchemaStrategyTest.java b/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialSchemaStrategyTest.java deleted file mode 100644 index 55abbcb..0000000 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/ThrowOnPartialSchemaStrategyTest.java +++ /dev/null @@ -1,89 +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.access.dbsync; - -import org.apache.cayenne.CayenneRuntimeException; -import org.apache.cayenne.access.MockOperationObserver; -import org.apache.cayenne.query.Query; -import org.apache.cayenne.query.SQLTemplate; -import org.apache.cayenne.unit.di.server.ServerCase; -import org.apache.cayenne.unit.di.server.UseServerRuntime; -import org.junit.Test; - -import java.util.Collections; - -@UseServerRuntime(ServerCase.SUS_PROJECT) -public class ThrowOnPartialSchemaStrategyTest extends SchemaUpdateStrategyBase { - - @Test - public void testThrowOnPartialStrategyTableNoExist() throws Exception { - - String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; - SQLTemplate query = new SQLTemplate(Object.class, template); - MockOperationObserver observer = new MockOperationObserver(); - - setStrategy(ThrowOnPartialSchemaStrategy.class); - - try { - node.performQueries(Collections.singletonList((Query) query), observer); - } catch (CayenneRuntimeException e) { - assertNotNull(e); - } - - try { - node.performQueries(Collections.singletonList((Query) query), observer); - } catch (CayenneRuntimeException e) { - assertNotNull(e); - } - } - - @Test - public void testThrowOnPartialStrategyTableExist() throws Exception { - - String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; - SQLTemplate query = new SQLTemplate(Object.class, template); - MockOperationObserver observer = new MockOperationObserver(); - - createOneTable("SUS1"); - createOneTable("SUS2"); - - setStrategy(ThrowOnPartialSchemaStrategy.class); - node.performQueries(Collections.singletonList(query), observer); - } - - @Test - public void testThrowOnPartialStrategyWithOneTable() throws Exception { - createOneTable("SUS1"); - - setStrategy(ThrowOnPartialSchemaStrategy.class); - - String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID"; - SQLTemplate query = new SQLTemplate(Object.class, template); - MockOperationObserver observer = new MockOperationObserver(); - - try { - node.performQueries(Collections.singletonList(query), observer); - assertEquals(1, existingTables().size()); - fail("Must have thrown on partial schema"); - } catch (CayenneRuntimeException e) { - // expected - } - } - -} http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java index f59c4f6..51bd248 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionIT.java @@ -33,6 +33,8 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; @UseServerRuntime(ServerCase.TESTMAP_PROJECT) http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingIT.java index 89cc849..4152e50 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingIT.java @@ -47,6 +47,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; @UseServerRuntime(ServerCase.LOCKING_PROJECT) http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionIT.java index b9f0240..58a15ed 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionIT.java @@ -46,6 +46,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SQLTemplateActionIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java index 77df179..48ddcef 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SelectActionIT.java @@ -33,6 +33,9 @@ import org.junit.Test; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SelectActionIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DefaultBatchTranslatorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DefaultBatchTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DefaultBatchTranslatorIT.java index fef421e..8d6ee68 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DefaultBatchTranslatorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DefaultBatchTranslatorIT.java @@ -33,6 +33,8 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; import static org.mockito.Mockito.mock; @UseServerRuntime(ServerCase.TESTMAP_PROJECT) http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DeleteBatchTranslatorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DeleteBatchTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DeleteBatchTranslatorIT.java index 6384c07..c6c2ad6 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DeleteBatchTranslatorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/DeleteBatchTranslatorIT.java @@ -38,6 +38,9 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; import static org.mockito.Mockito.mock; @UseServerRuntime(ServerCase.LOCKING_PROJECT) http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/InsertBatchTranslatorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/InsertBatchTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/InsertBatchTranslatorIT.java index ad28d6e..5febbae 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/InsertBatchTranslatorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/InsertBatchTranslatorIT.java @@ -31,6 +31,9 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; import static org.mockito.Mockito.mock; @UseServerRuntime(ServerCase.LOCKING_PROJECT) http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/SoftDeleteBatchTranslatorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/SoftDeleteBatchTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/SoftDeleteBatchTranslatorIT.java index 1860cc1..dee5340 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/SoftDeleteBatchTranslatorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/SoftDeleteBatchTranslatorIT.java @@ -43,6 +43,9 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + @UseServerRuntime(ServerCase.LOCKING_PROJECT) public class SoftDeleteBatchTranslatorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/UpdateBatchTranslatorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/UpdateBatchTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/UpdateBatchTranslatorIT.java index 8f3eea2..848860a 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/UpdateBatchTranslatorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/batch/UpdateBatchTranslatorIT.java @@ -37,6 +37,9 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; import static org.mockito.Mockito.mock; @UseServerRuntime(ServerCase.LOCKING_PROJECT) http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/translator/ejbql/EJBQLSelectTranslatorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/ejbql/EJBQLSelectTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/ejbql/EJBQLSelectTranslatorIT.java index 7db9fe3..c9c7203 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/ejbql/EJBQLSelectTranslatorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/ejbql/EJBQLSelectTranslatorIT.java @@ -34,6 +34,9 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class EJBQLSelectTranslatorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/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 d5a8e5a..34ead39 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 @@ -32,6 +32,8 @@ import org.junit.Test; import java.sql.Connection; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class OrderingTranslatorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/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 8dddbe0..9417ac4 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 @@ -41,6 +41,10 @@ import org.junit.Test; import java.sql.Connection; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class QualifierTranslatorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QueryAssemblerIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QueryAssemblerIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QueryAssemblerIT.java index c731bb8..133281b 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QueryAssemblerIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/QueryAssemblerIT.java @@ -30,6 +30,9 @@ import org.junit.Test; import java.sql.Connection; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class QueryAssemblerIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/SelectTranslatorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/SelectTranslatorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/SelectTranslatorIT.java index a225b7e..c872a4b 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/SelectTranslatorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/translator/select/SelectTranslatorIT.java @@ -47,6 +47,11 @@ import java.sql.Connection; import java.util.Date; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SelectTranslatorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/access/util/DefaultOperationObserverIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/util/DefaultOperationObserverIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/util/DefaultOperationObserverIT.java index 948cf37..dafacd6 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/util/DefaultOperationObserverIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/util/DefaultOperationObserverIT.java @@ -24,6 +24,9 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class DefaultOperationObserverIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/ashwood/AshwoodEntitySorterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/ashwood/AshwoodEntitySorterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/ashwood/AshwoodEntitySorterIT.java index 75c4d82..e7eff63 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/ashwood/AshwoodEntitySorterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/ashwood/AshwoodEntitySorterIT.java @@ -34,6 +34,8 @@ import java.sql.Types; import java.util.Collections; import java.util.List; +import static org.junit.Assert.assertEquals; + @UseServerRuntime(ServerCase.RELATIONSHIPS_PROJECT) public class AshwoodEntitySorterIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/cache/QueryCacheIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/cache/QueryCacheIT.java b/cayenne-server/src/test/java/org/apache/cayenne/cache/QueryCacheIT.java index 13276c6..9536e44 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/cache/QueryCacheIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/cache/QueryCacheIT.java @@ -29,6 +29,8 @@ import org.junit.Test; import java.util.List; +import static org.junit.Assert.assertNotSame; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class QueryCacheIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/JNDIDataSourceFactoryIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/JNDIDataSourceFactoryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/JNDIDataSourceFactoryIT.java index e140fe1..c5e8a75 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/JNDIDataSourceFactoryIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/JNDIDataSourceFactoryIT.java @@ -30,6 +30,9 @@ import org.junit.Test; import javax.naming.InitialContext; import javax.naming.NameNotFoundException; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class JNDIDataSourceFactoryIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java index ef5f536..86218d9 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeBuilder_InAction_IT.java @@ -31,6 +31,8 @@ import org.junit.Test; import javax.sql.DataSource; import java.util.List; +import static org.junit.Assert.assertEquals; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ServerRuntimeBuilder_InAction_IT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/conn/PoolManagerIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/conn/PoolManagerIT.java b/cayenne-server/src/test/java/org/apache/cayenne/conn/PoolManagerIT.java index 02622d3..ff0b69f 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/conn/PoolManagerIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/conn/PoolManagerIT.java @@ -26,6 +26,8 @@ import org.junit.Test; import java.sql.Connection; +import static org.junit.Assert.assertEquals; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class PoolManagerIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/AutoAdapterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/AutoAdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/AutoAdapterIT.java index 623e603..e267277 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/AutoAdapterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/AutoAdapterIT.java @@ -30,6 +30,9 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/ConcurrentPkGeneratorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/ConcurrentPkGeneratorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/ConcurrentPkGeneratorIT.java index 646e192..8719e86 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/ConcurrentPkGeneratorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/ConcurrentPkGeneratorIT.java @@ -38,6 +38,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + @UseServerRuntime("cayenne-default.xml") public class ConcurrentPkGeneratorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcAdapterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcAdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcAdapterIT.java index 21ca79c..b760549 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcAdapterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcAdapterIT.java @@ -32,6 +32,9 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class JdbcAdapterIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcPkGeneratorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcPkGeneratorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcPkGeneratorIT.java index dd56f0b..8a1c692 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcPkGeneratorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/JdbcPkGeneratorIT.java @@ -31,6 +31,8 @@ import org.junit.Test; import java.util.Collections; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class JdbcPkGeneratorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/PkGeneratorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/PkGeneratorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/PkGeneratorIT.java index 63e3d91..2d8214b 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/PkGeneratorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/PkGeneratorIT.java @@ -30,6 +30,10 @@ import org.junit.Test; import java.util.ArrayList; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class PkGeneratorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/TypesMappingIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/TypesMappingIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/TypesMappingIT.java index f3163ff..a07de22 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/TypesMappingIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/TypesMappingIT.java @@ -34,6 +34,9 @@ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + public class TypesMappingIT extends ServerCase { @Inject http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterIT.java index 414a28b..d7c3ccb 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapterIT.java @@ -29,6 +29,9 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class HSQLDBAdapterIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterIT.java index 908a030..754667d 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/mysql/MySQLAdapterIT.java @@ -27,6 +27,8 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class MySQLAdapterIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterIT.java index cfa295e..808c8a2 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/Oracle8AdapterIT.java @@ -28,6 +28,10 @@ import org.junit.Test; import java.net.URL; import java.sql.Types; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class Oracle8AdapterIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java index edcde29..d2a372e 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OracleAdapterIT.java @@ -30,6 +30,11 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class OracleAdapterIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorIT.java index 603944b..d8494af 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/oracle/OraclePkGeneratorIT.java @@ -28,6 +28,8 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertEquals; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class OraclePkGeneratorIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/postgres/PostgresAdapterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/postgres/PostgresAdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/postgres/PostgresAdapterIT.java index adada5b..a5ea63d 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/postgres/PostgresAdapterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/postgres/PostgresAdapterIT.java @@ -28,6 +28,9 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class PostgresAdapterIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapterIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapterIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapterIT.java index 198b2b1..41a6ab9 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapterIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapterIT.java @@ -28,6 +28,9 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SQLServerAdapterIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerSnifferIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerSnifferIT.java b/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerSnifferIT.java index fc27cf9..ffb848a 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerSnifferIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/dba/sqlserver/SQLServerSnifferIT.java @@ -32,6 +32,9 @@ import org.junit.Test; import java.sql.Connection; import java.sql.SQLException; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SQLServerSnifferIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLCompiledExpressionIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLCompiledExpressionIT.java b/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLCompiledExpressionIT.java index 1a6ecac..6cf63ec 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLCompiledExpressionIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/ejbql/EJBQLCompiledExpressionIT.java @@ -25,6 +25,10 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class EJBQLCompiledExpressionIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionFactory_InContextIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionFactory_InContextIT.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionFactory_InContextIT.java index 917a18a..85fd501 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionFactory_InContextIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/ExpressionFactory_InContextIT.java @@ -33,6 +33,12 @@ import org.junit.Test; import java.util.ArrayList; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ExpressionFactory_InContextIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_InContextIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_InContextIT.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_InContextIT.java index e8af55b..13cf36f 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_InContextIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/Expression_InContextIT.java @@ -34,6 +34,13 @@ import org.junit.Test; import java.util.ArrayList; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class Expression_InContextIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/exp/ParsedExpQualifierCompatIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/ParsedExpQualifierCompatIT.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/ParsedExpQualifierCompatIT.java index 5e4c5cd..ff1a88f 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/exp/ParsedExpQualifierCompatIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/ParsedExpQualifierCompatIT.java @@ -34,6 +34,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.junit.Assert.assertEquals; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ParsedExpQualifierCompatIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryIT.java index b99c369..8360807 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ExpressionEvaluateInMemoryIT.java @@ -40,6 +40,10 @@ import org.junit.Test; import java.math.BigDecimal; import java.sql.Types; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ExpressionEvaluateInMemoryIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/ClientEntityResolverIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/ClientEntityResolverIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/ClientEntityResolverIT.java index df0466a..5c4025f 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/ClientEntityResolverIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/ClientEntityResolverIT.java @@ -30,6 +30,11 @@ import org.junit.Test; import java.util.Collection; import java.util.Collections; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.MULTI_TIER_PROJECT) public class ClientEntityResolverIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/DbEntityIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/DbEntityIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/DbEntityIT.java index fc9b747..7c4cedc 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/DbEntityIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/DbEntityIT.java @@ -29,6 +29,13 @@ import org.junit.Test; import java.util.Collection; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class DbEntityIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/DbRelationshipIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/DbRelationshipIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/DbRelationshipIT.java index fbe1b24..947d9b0 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/DbRelationshipIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/DbRelationshipIT.java @@ -28,6 +28,11 @@ import org.junit.Test; import java.util.HashMap; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class DbRelationshipIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/EntityIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityIT.java index 7f9ab16..fbc6947 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityIT.java @@ -32,6 +32,14 @@ import org.junit.Test; import java.util.Collection; import java.util.Iterator; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class EntityIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverClassDescriptorIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverClassDescriptorIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverClassDescriptorIT.java index 68f9df8..2a32c5e 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverClassDescriptorIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverClassDescriptorIT.java @@ -32,6 +32,11 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverGenericStackIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverGenericStackIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverGenericStackIT.java index 69553ad..155b9fe 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverGenericStackIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverGenericStackIT.java @@ -27,6 +27,11 @@ import org.junit.Test; import java.util.Collections; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.DEFAULT_PROJECT) public class EntityResolverGenericStackIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverIT.java index cd4bf49..bf7a64e 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverIT.java @@ -35,6 +35,12 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class EntityResolverIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverInheritanceIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverInheritanceIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverInheritanceIT.java index 55071d4..5858164 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverInheritanceIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/EntityResolverInheritanceIT.java @@ -24,6 +24,11 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; + @UseServerRuntime(ServerCase.PEOPLE_PROJECT) public class EntityResolverInheritanceIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java index 575cae5..9103f15 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/ObjEntityIT.java @@ -38,6 +38,14 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ObjEntityIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java b/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java index 4ae579e..ce66e0c 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/map/ObjRelationshipIT.java @@ -38,6 +38,14 @@ import java.net.URL; import java.util.Collections; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ObjRelationshipIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/AddColumnToModelIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/AddColumnToModelIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/AddColumnToModelIT.java index ddc96ef..6e3296f 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/AddColumnToModelIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/AddColumnToModelIT.java @@ -29,6 +29,11 @@ import org.junit.Test; import java.sql.Types; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class AddColumnToModelIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/CreateTableToModelIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/CreateTableToModelIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/CreateTableToModelIT.java index bcb58b2..2067b46 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/CreateTableToModelIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/CreateTableToModelIT.java @@ -28,6 +28,12 @@ import org.junit.Test; import java.sql.Types; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class CreateTableToModelIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/DropColumnToModelIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/DropColumnToModelIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/DropColumnToModelIT.java index e308b77..9dd44e5 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/DropColumnToModelIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/DropColumnToModelIT.java @@ -32,6 +32,13 @@ import org.junit.Test; import java.sql.Types; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class DropColumnToModelIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/DropRelationshipToModelIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/DropRelationshipToModelIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/DropRelationshipToModelIT.java index 20dff04..c160193 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/DropRelationshipToModelIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/DropRelationshipToModelIT.java @@ -32,6 +32,12 @@ import org.junit.Test; import java.sql.Types; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.fail; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class DropRelationshipToModelIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/DropTableToModelIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/DropTableToModelIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/DropTableToModelIT.java index 64ef6ad..bcfc34d 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/DropTableToModelIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/DropTableToModelIT.java @@ -29,6 +29,11 @@ import org.junit.Test; import java.sql.Types; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class DropTableToModelIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java index dc8a349..53d5039 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/MergeCase.java @@ -18,13 +18,6 @@ ****************************************************************/ package org.apache.cayenne.merge; -import java.sql.Connection; -import java.sql.Statement; -import java.sql.Types; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import org.apache.cayenne.access.DataNode; import org.apache.cayenne.configuration.server.ServerRuntime; import org.apache.cayenne.dba.DbAdapter; @@ -40,6 +33,15 @@ import org.apache.cayenne.unit.di.server.ServerCaseDataSourceFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import java.sql.Connection; +import java.sql.Statement; +import java.sql.Types; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static org.junit.Assert.assertEquals; + public abstract class MergeCase extends ServerCase { private Log logger = LogFactory.getLog(MergeCase.class); http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/MergerFactoryIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/MergerFactoryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/MergerFactoryIT.java index 40233d5..c0a3198 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/MergerFactoryIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/MergerFactoryIT.java @@ -33,6 +33,10 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class MergerFactoryIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbIT.java index d3f815e..536f706 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/SetAllowNullToDbIT.java @@ -26,6 +26,8 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertNotNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SetAllowNullToDbIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/SetNotNullToDbIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/SetNotNullToDbIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/SetNotNullToDbIT.java index 2656a52..ff6d0d6 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/SetNotNullToDbIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/SetNotNullToDbIT.java @@ -28,6 +28,8 @@ import org.junit.Test; import java.sql.Types; +import static org.junit.Assert.assertNotNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class SetNotNullToDbIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/merge/ValueForNullIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/merge/ValueForNullIT.java b/cayenne-server/src/test/java/org/apache/cayenne/merge/ValueForNullIT.java index ec3effe..3761035 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/merge/ValueForNullIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/merge/ValueForNullIT.java @@ -38,6 +38,10 @@ import org.junit.Test; import java.sql.Types; import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ValueForNullIT extends MergeCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java index 350a774..2513627 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/query/EJBQLQueryIT.java @@ -43,6 +43,13 @@ import java.io.StringWriter; import java.util.List; import java.util.Map; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class EJBQLQueryIT extends ServerCase { http://git-wip-us.apache.org/repos/asf/cayenne/blob/49dd1041/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java ---------------------------------------------------------------------- diff --git a/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java b/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java index 4a1f94d..bab22f8 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/query/ProcedureQueryCacheKeyIT.java @@ -26,6 +26,10 @@ import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + @UseServerRuntime(ServerCase.TESTMAP_PROJECT) public class ProcedureQueryCacheKeyIT extends ServerCase {