Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2016-11-07 04:58:48 -0500
committerMartin Taal2016-11-07 04:58:48 -0500
commitb6d4d898cdf3bef5ce3972f85f9984a858f87d43 (patch)
tree03c17e2c8ea0291375df935be808bb4dd65c7a93
parentc402126d9d1d3fbc6a6e0253ef5d065836c63f96 (diff)
downloadorg.eclipse.emf.texo-master.tar.gz
org.eclipse.emf.texo-master.tar.xz
org.eclipse.emf.texo-master.zip
Make tests run on neonHEADmaster
-rw-r--r--tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/store/EMFResourceObjectStoreTest.java34
-rw-r--r--tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/EMFResourceObjectStoreWSTest.java12
-rw-r--r--tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/WSMainTest.java19
-rw-r--r--tests/org.eclipse.emf.texo.test.all/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.emf.texo.test.all/src/org/eclipse/emf/texo/test/all/CombinedTestSuiteJunit4.java2
5 files changed, 40 insertions, 29 deletions
diff --git a/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/store/EMFResourceObjectStoreTest.java b/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/store/EMFResourceObjectStoreTest.java
index 8e5e20f7..b23d2d10 100644
--- a/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/store/EMFResourceObjectStoreTest.java
+++ b/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/store/EMFResourceObjectStoreTest.java
@@ -33,6 +33,8 @@ import org.eclipse.emf.texo.store.EMFResourceObjectStore;
import org.eclipse.emf.texo.store.ObjectStore;
import org.eclipse.emf.texo.store.TexoEMFResourceURIConverter;
import org.eclipse.emf.texo.test.model.issues.bz391624.Bz391624ModelPackage;
+import org.eclipse.emf.texo.test.model.samples.emap.EmapsampleModelPackage;
+import org.eclipse.emf.texo.test.model.samples.extlibrary.ExtlibraryModelPackage;
import org.eclipse.emf.texo.test.model.samples.library.Book;
import org.eclipse.emf.texo.test.model.samples.library.Library;
import org.eclipse.emf.texo.test.model.samples.library.Writer;
@@ -68,6 +70,8 @@ public class EMFResourceObjectStoreTest {
public static void beforeClass() {
ModelResolver.getInstance().deregister(Bz391624ModelPackage.INSTANCE);
ModelResolver.getInstance().deregister(EmapModelPackage.INSTANCE);
+ ModelResolver.getInstance().deregister(EmapsampleModelPackage.INSTANCE);
+ ModelResolver.getInstance().deregister(ExtlibraryModelPackage.INSTANCE);
}
@AfterClass
@@ -75,6 +79,8 @@ public class EMFResourceObjectStoreTest {
ObjectStoreFactory.setInstance(new ObjectStoreFactory());
ModelResolver.getInstance().reRegisterModelPackage(Bz391624ModelPackage.INSTANCE);
ModelResolver.getInstance().reRegisterModelPackage(EmapModelPackage.INSTANCE);
+ ModelResolver.getInstance().reRegisterModelPackage(EmapsampleModelPackage.INSTANCE);
+ ModelResolver.getInstance().reRegisterModelPackage(ExtlibraryModelPackage.INSTANCE);
}
@Before
@@ -130,10 +136,10 @@ public class EMFResourceObjectStoreTest {
private void readAdd() {
ObjectStore os = getObjectStore();
os.begin();
- Assert.assertEquals(1,
- os.count("FROM " + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), new HashMap<String, Object>()));
- Assert.assertEquals(COUNT,
- os.count("FROM " + LibraryModelPackage.INSTANCE.getBookEClass().getName(), new HashMap<String, Object>()));
+ Assert.assertEquals(1, os.count("FROM library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(),
+ new HashMap<String, Object>()));
+ Assert.assertEquals(COUNT, os.count("FROM library|" + LibraryModelPackage.INSTANCE.getBookEClass().getName(),
+ new HashMap<String, Object>()));
Library lib = (Library) os.query(LibraryModelPackage.INSTANCE.getLibraryEClass(), 0, 100).get(0);
Book bk = LibraryModelPackage.INSTANCE.getModelFactory().createBook();
bk.setTitle("Title " + 11);
@@ -146,10 +152,10 @@ public class EMFResourceObjectStoreTest {
private void readRemove() {
ObjectStore os = getObjectStore();
os.begin();
- Assert.assertEquals(1,
- os.count("FROM " + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), new HashMap<String, Object>()));
- Assert.assertEquals(COUNT + 1,
- os.count("FROM " + LibraryModelPackage.INSTANCE.getBookEClass().getName(), new HashMap<String, Object>()));
+ Assert.assertEquals(1, os.count("FROM library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(),
+ new HashMap<String, Object>()));
+ Assert.assertEquals(COUNT + 1, os.count("FROM library|" + LibraryModelPackage.INSTANCE.getBookEClass().getName(),
+ new HashMap<String, Object>()));
Library lib = (Library) os.query(LibraryModelPackage.INSTANCE.getLibraryEClass(), 0, 100).get(0);
{
os.remove(lib.getBooks().get(0));
@@ -173,10 +179,10 @@ public class EMFResourceObjectStoreTest {
{
ObjectStore os = getObjectStore();
os.begin();
- Assert.assertEquals(1,
- os.count("FROM " + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), new HashMap<String, Object>()));
- Assert.assertEquals(COUNT - 1,
- os.count("FROM " + LibraryModelPackage.INSTANCE.getBookEClass().getName(), new HashMap<String, Object>()));
+ Assert.assertEquals(1, os.count("FROM library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(),
+ new HashMap<String, Object>()));
+ Assert.assertEquals(COUNT - 1, os.count("FROM library|" + LibraryModelPackage.INSTANCE.getBookEClass().getName(),
+ new HashMap<String, Object>()));
Library lib = (Library) os.query(LibraryModelPackage.INSTANCE.getLibraryEClass(), 0, 100).get(0);
lib.getBooks().get(5).setTitle(newTitle);
os.commit();
@@ -215,8 +221,8 @@ public class EMFResourceObjectStoreTest {
protected ObjectStore getObjectStore() {
try {
- final EMFResourceObjectStore objectStore = ComponentProvider.getInstance()
- .newInstance(EMFResourceObjectStore.class);
+ final EMFResourceObjectStore objectStore = ComponentProvider.getInstance().newInstance(
+ EMFResourceObjectStore.class);
if (uriStr == null) {
uriStr = "http://localhost:8080/texo/data";
}
diff --git a/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/EMFResourceObjectStoreWSTest.java b/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/EMFResourceObjectStoreWSTest.java
index 82db348c..c0903ca8 100644
--- a/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/EMFResourceObjectStoreWSTest.java
+++ b/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/EMFResourceObjectStoreWSTest.java
@@ -40,6 +40,8 @@ import org.eclipse.emf.texo.store.ObjectStore;
import org.eclipse.emf.texo.store.TexoEMFResourceURIConverter;
import org.eclipse.emf.texo.test.model.base.identifiable.Identifiable;
import org.eclipse.emf.texo.test.model.issues.bz391624.Bz391624ModelPackage;
+import org.eclipse.emf.texo.test.model.samples.emap.EmapsampleModelPackage;
+import org.eclipse.emf.texo.test.model.samples.extlibrary.ExtlibraryModelPackage;
import org.eclipse.emf.texo.test.model.samples.library.Book;
import org.eclipse.emf.texo.test.model.samples.library.Library;
import org.eclipse.emf.texo.test.model.samples.library.Writer;
@@ -80,6 +82,8 @@ public class EMFResourceObjectStoreWSTest extends BaseWSWebTest {
public static void beforeClass() {
ModelResolver.getInstance().deregister(Bz391624ModelPackage.INSTANCE);
ModelResolver.getInstance().deregister(EmapModelPackage.INSTANCE);
+ ModelResolver.getInstance().deregister(EmapsampleModelPackage.INSTANCE);
+ ModelResolver.getInstance().deregister(ExtlibraryModelPackage.INSTANCE);
}
@AfterClass
@@ -87,6 +91,8 @@ public class EMFResourceObjectStoreWSTest extends BaseWSWebTest {
ObjectStoreFactory.setInstance(new ObjectStoreFactory());
ModelResolver.getInstance().reRegisterModelPackage(Bz391624ModelPackage.INSTANCE);
ModelResolver.getInstance().reRegisterModelPackage(EmapModelPackage.INSTANCE);
+ ModelResolver.getInstance().reRegisterModelPackage(EmapsampleModelPackage.INSTANCE);
+ ModelResolver.getInstance().reRegisterModelPackage(ExtlibraryModelPackage.INSTANCE);
}
@Before
@@ -153,8 +159,8 @@ public class EMFResourceObjectStoreWSTest extends BaseWSWebTest {
@Override
protected ObjectStore getNewObjectStore() {
try {
- final EMFResourceObjectStore objectStore = ComponentProvider.getInstance()
- .newInstance(EMFResourceObjectStore.class);
+ final EMFResourceObjectStore objectStore = ComponentProvider.getInstance().newInstance(
+ EMFResourceObjectStore.class);
objectStore.setUri(URI.createURI(getURL()));
((TexoEMFResourceURIConverter) objectStore.getURIConverter()).setResourceType(resourceType);
objectStore.setChildLevels(3);
@@ -234,7 +240,7 @@ public class EMFResourceObjectStoreWSTest extends BaseWSWebTest {
public void testUpdateAndDeleteOfChildren() {
final Library lib = createTestData();
{
- String content = doGetRequest(LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), null,
+ String content = doGetRequest("library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), null,
HttpServletResponse.SC_OK);
final List<Object> objects = deserialize(content);
Assert.assertEquals(1, objects.size());
diff --git a/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/WSMainTest.java b/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/WSMainTest.java
index 4863d89f..6c192605 100644
--- a/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/WSMainTest.java
+++ b/tests/org.eclipse.emf.texo.server.test/src/org/eclipse/emf/texo/server/test/ws/WSMainTest.java
@@ -106,9 +106,8 @@ public class WSMainTest extends BaseWSWebTest {
}
{
- final String content = doGetRequest(
- "model/eclassifier?name=BookCategory&epackage=" + LibraryModelPackage.NS_URI, null,
- HttpServletResponse.SC_OK);
+ final String content = doGetRequest("model/eclassifier?name=BookCategory&epackage="
+ + LibraryModelPackage.NS_URI, null, HttpServletResponse.SC_OK);
final List<Object> objects = deserialize(content);
Assert.assertEquals(1, objects.size());
Assert.assertTrue(objects.get(0) instanceof DynamicModelObject);
@@ -119,7 +118,7 @@ public class WSMainTest extends BaseWSWebTest {
}
// get all libraries
{
- final String content = doGetRequest(LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), null,
+ final String content = doGetRequest("library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), null,
HttpServletResponse.SC_OK);
final List<Object> objects = deserialize(content);
Assert.assertEquals(1, objects.size());
@@ -157,12 +156,12 @@ public class WSMainTest extends BaseWSWebTest {
}
// now delete the library
- doDeleteRequest(LibraryModelPackage.INSTANCE.getLibraryEClass().getName() + "/" + lib.getDb_Id(), //$NON-NLS-1$
+ doDeleteRequest("library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName() + "/" + lib.getDb_Id(), //$NON-NLS-1$
HttpServletResponse.SC_OK);
// this should fail
{
final String content = doGetRequest(
- LibraryModelPackage.INSTANCE.getLibraryEClass().getName() + "/" + lib.getDb_Id(), null, //$NON-NLS-1$
+ "library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName() + "/" + lib.getDb_Id(), null, //$NON-NLS-1$
HttpServletResponse.SC_NOT_FOUND);
final List<Object> objects = deserialize(content);
Assert.assertEquals(1, objects.size());
@@ -179,7 +178,7 @@ public class WSMainTest extends BaseWSWebTest {
public void testUpdateAndDeleteOfChildren() {
final Library lib = createTestData();
{
- String content = doGetRequest(LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), null,
+ String content = doGetRequest("library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), null,
HttpServletResponse.SC_OK);
final List<Object> objects = deserialize(content);
Assert.assertEquals(1, objects.size());
@@ -203,7 +202,7 @@ public class WSMainTest extends BaseWSWebTest {
// check that the name of the library got updated
{
- String content = doGetRequest(LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), null,
+ String content = doGetRequest("library|" + LibraryModelPackage.INSTANCE.getLibraryEClass().getName(), null,
HttpServletResponse.SC_OK);
final List<Object> objects = deserialize(content);
Assert.assertEquals(1, objects.size());
@@ -221,8 +220,8 @@ public class WSMainTest extends BaseWSWebTest {
final Writer w = LibraryModelPackage.MODELFACTORY.createWriter();
w.setName("name" + i); //$NON-NLS-1$
final String content = serialize(w);
- final String resultStr = doContentRequest(LibraryModelPackage.INSTANCE.getWriterEClass().getName(), content,
- HttpServletResponse.SC_OK, null, HttpMethod.POST);
+ final String resultStr = doContentRequest("library|" + LibraryModelPackage.INSTANCE.getWriterEClass().getName(),
+ content, HttpServletResponse.SC_OK, null, HttpMethod.POST);
final ResultType result = (ResultType) deserialize(resultStr).get(0);
Assert.assertEquals(1, result.getInserted().size());
Assert.assertEquals(0, result.getUpdated().size());
diff --git a/tests/org.eclipse.emf.texo.test.all/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.texo.test.all/META-INF/MANIFEST.MF
index b0a509c3..1ac56183 100644
--- a/tests/org.eclipse.emf.texo.test.all/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.emf.texo.test.all/META-INF/MANIFEST.MF
@@ -5,7 +5,7 @@ Bundle-SymbolicName: org.eclipse.emf.texo.test.all;singleton:=true
Bundle-Version: 0.9.0.qualifier
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.emf.texo.test;bundle-version="[0.9.0,1.1.0)",
org.eclipse.emf.texo.datagenerator.test;bundle-version="[0.9.0,1.1.0)",
org.eclipse.emf.texo.xml.test;bundle-version="[0.9.0,1.1.0)",
diff --git a/tests/org.eclipse.emf.texo.test.all/src/org/eclipse/emf/texo/test/all/CombinedTestSuiteJunit4.java b/tests/org.eclipse.emf.texo.test.all/src/org/eclipse/emf/texo/test/all/CombinedTestSuiteJunit4.java
index f56a571e..5ffd104a 100644
--- a/tests/org.eclipse.emf.texo.test.all/src/org/eclipse/emf/texo/test/all/CombinedTestSuiteJunit4.java
+++ b/tests/org.eclipse.emf.texo.test.all/src/org/eclipse/emf/texo/test/all/CombinedTestSuiteJunit4.java
@@ -30,6 +30,6 @@ import org.junit.runners.Suite;
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({ AllServerTests.class, AllTestsTests.class, CopyCompareTestSuite.class, ModelJSONTestSuite.class,
- CombinedTestSuite.class })
+ CombinedTestSuite.class })
public class CombinedTestSuiteJunit4 {
}

Back to the top