summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-02-22 21:24:37 (EST)
committerCaspar De Groot2011-02-22 21:24:37 (EST)
commitbaad70b607cd76bcbbd5dcb884eb697d6e37042f (patch)
tree5c7485c0918dadce8caf0e804c32712436c84c50
parent8a4ddd6e9ad7206180607c0a3f18e9ca2fc0bbdb (diff)
downloadcdo-baad70b607cd76bcbbd5dcb884eb697d6e37042f.zip
cdo-baad70b607cd76bcbbd5dcb884eb697d6e37042f.tar.gz
cdo-baad70b607cd76bcbbd5dcb884eb697d6e37042f.tar.bz2
[Bug 337180] Use a unique resource name per test method
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337180
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/CustomTypeMappingTest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBStoreTest.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java4
5 files changed, 22 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java
index 6fb3dc0..39359e6 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/AllTestsDBH2Branching.java
@@ -209,6 +209,7 @@ public class AllTestsDBH2Branching extends DBConfigs
finally
{
DBUtil.close(stmt);
+ DBUtil.close(conn);
}
JdbcDataSource dataSource = new JdbcDataSource();
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/CustomTypeMappingTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/CustomTypeMappingTest.java
index 30461fa..7486966 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/CustomTypeMappingTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/CustomTypeMappingTest.java
@@ -56,8 +56,8 @@ public class CustomTypeMappingTest extends AbstractCDOTest
try
{
- EPackage pkg = EMFUtil.createEPackage("underscoreTest", "uct",
- "http://cdo.eclipse.org/tests/underscoreTest.ecore");
+ EPackage pkg = EMFUtil.createEPackage("underscoreTest2", "uct2",
+ "http://cdo.eclipse.org/tests/underscoreTest2.ecore");
EClass cls = EMFUtil.createEClass(pkg, "foo", false, false);
EAttribute att = EMFUtil.createEAttribute(cls, "bar", EcorePackage.eINSTANCE.getEInt());
@@ -75,7 +75,7 @@ public class CustomTypeMappingTest extends AbstractCDOTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/test");
+ CDOResource resource = transaction.createResource(getResourcePath("/test"));
EObject obj = EcoreUtil.create(cls);
obj.eSet(att, 42);
@@ -96,7 +96,7 @@ public class CustomTypeMappingTest extends AbstractCDOTest
try
{
stmt = getStatement();
- rset = stmt.executeQuery("SELECT bar FROM underscoreTest_foo");
+ rset = stmt.executeQuery("SELECT bar FROM underscoreTest2_foo");
assertEquals("java.lang.String", rset.getMetaData().getColumnClassName(1));
rset.next();
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java
index afafc3b..4a34975 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBAnnotationsTest.java
@@ -52,7 +52,7 @@ public class DBAnnotationsTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
msg("Commit a product that has a name with an allowed string length.");
EClass eClass = (EClass)model1.getEClassifier("Product1");
@@ -84,7 +84,7 @@ public class DBAnnotationsTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
msg("Commit a product that has a name with an invalid string length.");
EClass eClass = (EClass)model1.getEClassifier("Product1");
@@ -124,7 +124,7 @@ public class DBAnnotationsTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
msg("Commit a product.");
EClass eClass = (EClass)model1.getEClassifier("Product1");
@@ -210,7 +210,7 @@ public class DBAnnotationsTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
msg("Commit a category.");
EClass eClass = (EClass)model1.getEClassifier("Category");
@@ -250,7 +250,7 @@ public class DBAnnotationsTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
msg("Commit a category.");
EClass eClass = (EClass)model1.getEClassifier("Category");
@@ -295,7 +295,7 @@ public class DBAnnotationsTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
msg("Commit a category.");
EClass eClass = (EClass)model1.getEClassifier("Category");
@@ -334,7 +334,7 @@ public class DBAnnotationsTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
msg("Commit a category.");
EClass eClass = (EClass)model1.getEClassifier("Category");
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBStoreTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBStoreTest.java
index 6d291ae..5bfd025 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBStoreTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/DBStoreTest.java
@@ -100,7 +100,7 @@ public class DBStoreTest extends AbstractCDOTest
{
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.getOrCreateResource("/test");
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("/test"));
PurchaseOrder o = Model1Factory.eINSTANCE.createPurchaseOrder();
o.setDate(new GregorianCalendar(2008, 11, 24, 12, 34, 56).getTime());
@@ -114,7 +114,7 @@ public class DBStoreTest extends AbstractCDOTest
session = openSession();
CDOView view = session.openView();
- resource = view.getResource("/test");
+ resource = view.getResource(getResourcePath("/test"));
assertEquals(1, resource.getContents().size());
o = (PurchaseOrder)resource.getContents().get(0);
@@ -155,7 +155,7 @@ public class DBStoreTest extends AbstractCDOTest
CDOSession session = openSession();
session.getPackageRegistry().putEPackage(pkg);
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/test");
+ CDOResource resource = transaction.createResource(getResourcePath("/test"));
resource.getContents().add(obj1);
resource.getContents().add(obj2);
transaction.commit();
@@ -169,7 +169,7 @@ public class DBStoreTest extends AbstractCDOTest
CDOSession session = openSession();
session.getPackageRegistry().putEPackage(pkg);
CDOView view = session.openView();
- CDOResource resource = view.getResource("/test");
+ CDOResource resource = view.getResource(getResourcePath("/test"));
assertEquals(2, resource.getContents().size());
@@ -249,7 +249,7 @@ public class DBStoreTest extends AbstractCDOTest
{
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.getOrCreateResource("/test");
+ CDOResource resource = transaction.getOrCreateResource(getResourcePath("/test"));
Company e = Model1Factory.eINSTANCE.createCompany();
e.setName(s);
@@ -273,7 +273,7 @@ public class DBStoreTest extends AbstractCDOTest
session = openSession();
CDOView view = session.openView();
- resource = view.getResource("/test");
+ resource = view.getResource(getResourcePath("/test"));
assertEquals(1, resource.getContents().size());
e = (Company)resource.getContents().get(0);
@@ -293,7 +293,7 @@ public class DBStoreTest extends AbstractCDOTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/test");
+ CDOResource resource = transaction.createResource(getResourcePath("/test"));
EObject foo = EcoreUtil.create(cls);
foo.eSet(att, "foobar");
@@ -315,7 +315,7 @@ public class DBStoreTest extends AbstractCDOTest
CDOSession session = openSession();
CDOTransaction transaction = session.openTransaction();
- CDOResource resource = transaction.createResource("/test");
+ CDOResource resource = transaction.createResource(getResourcePath("/test"));
EObject foo = EcoreUtil.create(cls);
foo.eSet(att, "foobar");
diff --git a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java
index 9e30daa..47b76c6 100644
--- a/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests.db/src/org/eclipse/emf/cdo/tests/db/SQLQueryTest.java
@@ -128,7 +128,7 @@ public class SQLQueryTest extends AbstractCDOTest
intResult = ((Long)result).intValue();
}
- assertEquals(intResult, NUM_OF_PRODUCTS);
+ assertEquals(NUM_OF_PRODUCTS, intResult);
}
transaction.commit();
@@ -284,7 +284,7 @@ public class SQLQueryTest extends AbstractCDOTest
CDOTransaction transaction = session.openTransaction();
msg("Creating resource");
- CDOResource resource = transaction.createResource("/test1");
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
fillResource(resource);