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/pom.xml b/core/store/persistence/pom.xml
index 9783749..1b60206 100644
--- a/core/store/persistence/pom.xml
+++ b/core/store/persistence/pom.xml
@@ -18,18 +18,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <repositories>
- <repository>
- <id>repository.springsource.com.release</id>
- <name>SpringSource OBR - Release</name>
- <url>http://repository.springsource.com/maven/bundles/release</url>
- </repository>
- <repository>
- <id>repository.springsource.com.external</id>
- <name>SpringSource OBR - External</name>
- <url>http://repository.springsource.com/maven/bundles/external</url>
- </repository>
- </repositories>
<parent>
<groupId>org.onosproject</groupId>
@@ -46,16 +34,14 @@
<dependencies>
- <!--<dependency>
- <groupId>org.onosproject</groupId>
- <artifactId>onos-api</artifactId>
- </dependency>-->
+
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-api</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.mapdb</groupId>
<artifactId>mapdb</artifactId>
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",