Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2010-10-26 15:21:57 -0400
committerMarkus Alexander Kuppe2010-10-26 15:22:41 -0400
commitc863b478712c91c0d666802964dad42be7b008d9 (patch)
treee5a61a7a419da430fa0fd81e15c90262a2d5d451
parent588ad10826f9b5fef1667e2b992e44818d0e96aa (diff)
downloadorg.eclipse.ecf-c863b478712c91c0d666802964dad42be7b008d9.tar.gz
org.eclipse.ecf-c863b478712c91c0d666802964dad42be7b008d9.tar.xz
org.eclipse.ecf-c863b478712c91c0d666802964dad42be7b008d9.zip
RESOLVED - bug 328759: IDFactory(Service)Test fail in automated test environment
https://bugs.eclipse.org/bugs/show_bug.cgi?id=328759
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryServiceTest.java67
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryTest.java67
-rw-r--r--tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IIDNamespaceTest.java78
3 files changed, 82 insertions, 130 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryServiceTest.java b/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryServiceTest.java
index 147fdb58d..d87c4e22b 100755
--- a/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryServiceTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryServiceTest.java
@@ -11,22 +11,12 @@
package org.eclipse.ecf.tests.core.identity;
-import java.util.List;
-
-import org.eclipse.ecf.core.identity.GUID;
-import org.eclipse.ecf.core.identity.IIDFactory;
-import org.eclipse.ecf.core.identity.LongID;
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.core.identity.StringID;
import org.eclipse.ecf.internal.tests.Activator;
-public class IDFactoryServiceTest extends NamespaceTest {
-
- IIDFactory fixture = null;
-
+public class IDFactoryServiceTest extends IIDNamespaceTest {
/*
* (non-Javadoc)
- *
+ *
* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
@@ -34,57 +24,4 @@ public class IDFactoryServiceTest extends NamespaceTest {
fixture = Activator.getDefault().getIDFactory();
assertNotNull(fixture);
}
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- fixture = null;
- assertNull(fixture);
- }
-
- public void testIDFactoryGetNamespaces() {
- List namespaces = fixture.getNamespaces();
- assertNotNull(namespaces);
- assertTrue(namespaces.size() > 0);
- }
-
- public void testIDFactoryGetStringIDNamespaceByName() {
- Namespace namespace = fixture.getNamespaceByName(StringID.class
- .getName());
- assertNotNull(namespace);
- }
-
- public void testIDFactoryGetGUIDIDNamespaceByName() {
- Namespace namespace = fixture.getNamespaceByName(GUID.class.getName());
- assertNotNull(namespace);
- }
-
- public void testIDFactoryGetLongIDNamespaceByName() {
- Namespace namespace = fixture
- .getNamespaceByName(LongID.class.getName());
- assertNotNull(namespace);
- }
-
- public void testIDFactoryAddNamespace() {
- Namespace namespace = createNamespace();
- int currentSize = fixture.getNamespaces().size();
- Namespace ns = fixture.addNamespace(namespace);
- assertNull(ns);
- assertTrue(fixture.getNamespaces().size() == (currentSize + 1));
- }
-
- public void testIDFactoryRemoveNamespace() {
- Namespace namespace = fixture.getNamespaceByName(StringID.class
- .getName());
- int currentSize = fixture.getNamespaces().size();
- Namespace removed = fixture.removeNamespace(namespace);
- assertNotNull(removed);
- assertTrue(fixture.getNamespaces().size() == (currentSize - 1));
- // Put it back
- fixture.addNamespace(removed);
- }
}
diff --git a/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryTest.java b/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryTest.java
index 4e62ea023..58a4f4809 100755
--- a/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IDFactoryTest.java
@@ -11,22 +11,12 @@
package org.eclipse.ecf.tests.core.identity;
-import java.util.List;
-
-import org.eclipse.ecf.core.identity.GUID;
import org.eclipse.ecf.core.identity.IDFactory;
-import org.eclipse.ecf.core.identity.IIDFactory;
-import org.eclipse.ecf.core.identity.LongID;
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.core.identity.StringID;
-
-public class IDFactoryTest extends NamespaceTest {
-
- IIDFactory fixture = null;
+public class IDFactoryTest extends IIDNamespaceTest {
/*
* (non-Javadoc)
- *
+ *
* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
@@ -34,57 +24,4 @@ public class IDFactoryTest extends NamespaceTest {
fixture = IDFactory.getDefault();
assertNotNull(fixture);
}
-
- /*
- * (non-Javadoc)
- *
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- fixture = null;
- assertNull(fixture);
- }
-
- public void testIDFactoryGetNamespaces() {
- List namespaces = fixture.getNamespaces();
- assertNotNull(namespaces);
- assertTrue(namespaces.size() > 0);
- }
-
- public void testIDFactoryGetStringIDNamespaceByName() {
- Namespace namespace = fixture.getNamespaceByName(StringID.class
- .getName());
- assertNotNull(namespace);
- }
-
- public void testIDFactoryGetGUIDIDNamespaceByName() {
- Namespace namespace = fixture.getNamespaceByName(GUID.class.getName());
- assertNotNull(namespace);
- }
-
- public void testIDFactoryGetLongIDNamespaceByName() {
- Namespace namespace = fixture
- .getNamespaceByName(LongID.class.getName());
- assertNotNull(namespace);
- }
-
- public void testIDFactoryAddNamespace() {
- Namespace namespace = createNamespace();
- int currentSize = fixture.getNamespaces().size();
- Namespace ns = fixture.addNamespace(namespace);
- assertNull(ns);
- assertTrue(fixture.getNamespaces().size() == (currentSize + 1));
- }
-
- public void testIDFactoryRemoveNamespace() {
- Namespace namespace = fixture.getNamespaceByName(StringID.class
- .getName());
- int currentSize = fixture.getNamespaces().size();
- Namespace removed = fixture.removeNamespace(namespace);
- assertNotNull(removed);
- assertTrue(fixture.getNamespaces().size() == (currentSize - 1));
- // Put it back
- fixture.addNamespace(removed);
- }
}
diff --git a/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IIDNamespaceTest.java b/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IIDNamespaceTest.java
new file mode 100644
index 000000000..3feb11a42
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests/src/org/eclipse/ecf/tests/core/identity/IIDNamespaceTest.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Markus Alexander Kuppe.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Markus Alexander Kuppe (ecf-dev_eclipse.org <at> lemmster <dot> de) - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.tests.core.identity;
+
+import java.util.List;
+
+import org.eclipse.ecf.core.identity.GUID;
+import org.eclipse.ecf.core.identity.IIDFactory;
+import org.eclipse.ecf.core.identity.LongID;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.identity.StringID;
+
+public abstract class IIDNamespaceTest extends NamespaceTest {
+
+ IIDFactory fixture = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ fixture = null;
+ assertNull(fixture);
+ }
+
+ public void testIDFactoryGetNamespaces() {
+ List namespaces = fixture.getNamespaces();
+ assertNotNull(namespaces);
+ assertTrue(namespaces.size() > 0);
+ }
+
+ public void testIDFactoryGetStringIDNamespaceByName() {
+ Namespace namespace = fixture.getNamespaceByName(StringID.class
+ .getName());
+ assertNotNull(namespace);
+ }
+
+ public void testIDFactoryGetGUIDIDNamespaceByName() {
+ Namespace namespace = fixture.getNamespaceByName(GUID.class.getName());
+ assertNotNull(namespace);
+ }
+
+ public void testIDFactoryGetLongIDNamespaceByName() {
+ Namespace namespace = fixture
+ .getNamespaceByName(LongID.class.getName());
+ assertNotNull(namespace);
+ }
+
+ public void testIDFactoryAddNamespace() {
+ Namespace namespace = createNamespace();
+ int currentSize = fixture.getNamespaces().size();
+ Namespace ns = fixture.addNamespace(namespace);
+ assertNull(ns);
+ assertTrue(fixture.getNamespaces().size() == (currentSize + 1));
+ fixture.removeNamespace(namespace);
+ }
+
+ public void testIDFactoryRemoveNamespace() {
+ Namespace namespace = fixture.getNamespaceByName(StringID.class
+ .getName());
+ int currentSize = fixture.getNamespaces().size();
+ Namespace removed = fixture.removeNamespace(namespace);
+ assertNotNull(removed);
+ assertTrue(fixture.getNamespaces().size() == (currentSize - 1));
+ // Put it back
+ fixture.addNamespace(removed);
+ }
+}

Back to the top