Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-09-16 22:02:45 -0400
committerRyan D. Brooks2010-09-16 22:02:45 -0400
commit9e705c1615bc09ce6d0eaa2d8e7901bbe5a91d6a (patch)
tree1477d66d354d73f948f0b142c4d71928fff1bf84 /plugins
parent7b5d56bf2dd4671166a1bb8c35cffccc61acb076 (diff)
downloadorg.eclipse.osee-9e705c1615bc09ce6d0eaa2d8e7901bbe5a91d6a.tar.gz
org.eclipse.osee-9e705c1615bc09ce6d0eaa2d8e7901bbe5a91d6a.tar.xz
org.eclipse.osee-9e705c1615bc09ce6d0eaa2d8e7901bbe5a91d6a.zip
refactor: Remove GuidObject mock test object from test suite
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GuidObject.java87
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HashCollectionTest.java8
2 files changed, 4 insertions, 91 deletions
diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GuidObject.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GuidObject.java
deleted file mode 100644
index a8e814504a..0000000000
--- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/GuidObject.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.jdk.core.test.util;
-
-import junit.framework.Assert;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.junit.Test;
-
-/**
- * Used for testing object storage and retrieval using guid hashCode/equals
- *
- * @author Donald G. Dunne
- */
-public class GuidObject {
- private String guid = GUID.create();
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- @Override
- public String toString() {
- return guid;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (guid == null ? 0 : guid.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- GuidObject other = (GuidObject) obj;
- if (guid == null) {
- if (other.guid != null) {
- return false;
- }
- } else if (!guid.equals(other.guid)) {
- return false;
- }
- return true;
- }
-
- @Test
- public void testGuidObject() {
-
- // test GuidObject that will be used for next test
- GuidObject keyObjectA = new GuidObject();
- GuidObject keyObjectB = new GuidObject();
- GuidObject keyObjectA1 = new GuidObject();
-
- Assert.assertTrue(keyObjectA.equals(keyObjectA));
- Assert.assertFalse(keyObjectA.equals(keyObjectB));
- Assert.assertFalse(keyObjectA.equals(keyObjectA1));
-
- // This should make them equal
- keyObjectA1.setGuid(keyObjectA.getGuid());
-
- Assert.assertTrue(keyObjectA.equals(keyObjectA));
- Assert.assertTrue(keyObjectA.equals(keyObjectA1));
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HashCollectionTest.java b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HashCollectionTest.java
index cca52818c8..15c866b50f 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HashCollectionTest.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core.test/src/org/eclipse/osee/framework/jdk/core/test/util/HashCollectionTest.java
@@ -165,20 +165,20 @@ public class HashCollectionTest {
@Test
public void testHashCollectionObject() {
- HashCollection<GuidObject, String> collection = new HashCollection<GuidObject, String>();
+ HashCollection<Object, String> collection = new HashCollection<Object, String>();
Assert.assertEquals(0, collection.size());
Assert.assertEquals(0, collection.getValues().size());
- Assert.assertNull(collection.getValues(new GuidObject()));
+ Assert.assertNull(collection.getValues(new Object()));
- GuidObject keyObject = new GuidObject();
+ Object keyObject = new Object();
for (int x = 1; x <= 5; x++) {
collection.put(keyObject, "value " + x);
}
Assert.assertEquals(5, collection.size());
Assert.assertEquals(5, collection.getValues().size());
- Assert.assertNull(collection.getValues(new GuidObject()));
+ Assert.assertNull(collection.getValues(new Object()));
Assert.assertEquals(5, collection.getValues(keyObject).size());
}

Back to the top