Fixes for Persistent{Map, Set}
- Remove unnecessary repository in pom
- Move Tests to appropriate path/package
- cosmetic fixes
Change-Id: I017293837626a976fe64f811583bb6e314edbd65
diff --git a/core/store/persistence/src/main/test/test/PersistentMapTest.java b/core/store/persistence/src/test/java/org/onosproject/persistence/impl/PersistentMapTest.java
similarity index 98%
rename from core/store/persistence/src/main/test/test/PersistentMapTest.java
rename to core/store/persistence/src/test/java/org/onosproject/persistence/impl/PersistentMapTest.java
index b059f18..f5cfef8 100644
--- a/core/store/persistence/src/main/test/test/PersistentMapTest.java
+++ b/core/store/persistence/src/test/java/org/onosproject/persistence/impl/PersistentMapTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package test;
+package org.onosproject.persistence.impl;
import com.google.common.collect.Maps;
import org.junit.After;
@@ -22,7 +22,6 @@
import org.junit.Test;
import org.mapdb.DB;
import org.mapdb.DBMaker;
-import org.onosproject.persistence.impl.PersistentMap;
import org.onosproject.store.service.Serializer;
import java.nio.file.Paths;
diff --git a/core/store/persistence/src/main/test/test/PersistentSetTest.java b/core/store/persistence/src/test/java/org/onosproject/persistence/impl/PersistentSetTest.java
similarity index 97%
rename from core/store/persistence/src/main/test/test/PersistentSetTest.java
rename to core/store/persistence/src/test/java/org/onosproject/persistence/impl/PersistentSetTest.java
index 3107ab3..0e2ac2c 100644
--- a/core/store/persistence/src/main/test/test/PersistentSetTest.java
+++ b/core/store/persistence/src/test/java/org/onosproject/persistence/impl/PersistentSetTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package test;
+package org.onosproject.persistence.impl;
import com.google.common.collect.Sets;
import org.junit.After;
@@ -22,7 +22,6 @@
import org.junit.Test;
import org.mapdb.DB;
import org.mapdb.DBMaker;
-import org.onosproject.persistence.impl.PersistentSet;
import org.onosproject.store.service.Serializer;
import java.nio.file.Paths;
@@ -34,6 +33,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
/**
@@ -143,7 +143,7 @@
Object[] arr = set.toArray();
assertEquals("The array should be of length 10.", 10, arr.length);
for (int i = 0; i < 10; i++) {
- assertTrue("All elements of the array should be in the set.", set.contains((Integer) arr[i]));
+ assertTrue("All elements of the array should be in the set.", set.contains(arr[i]));
}
}
@@ -154,7 +154,7 @@
fillSet(9, set);
//Test the case where the array and set match in size
Object[] retArray = set.toArray(originalArray);
- assertEquals("If the set can fit the array should be the one passed in.", originalArray, retArray);
+ assertSame("If the set can fit the array should be the one passed in.", originalArray, retArray);
//Test the case where the passe array is too small to fit the set
set.add(9);
assertNotEquals("A new set should be generated if the contents will not fit in the passed set",