HIGUCHI Yuta

Fixes for Persistent{Map, Set}

- Remove unnecessary repository in pom
- Move Tests to appropriate path/package
- cosmetic fixes

Change-Id: I017293837626a976fe64f811583bb6e314edbd65
......@@ -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>
......
......@@ -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.Before;
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;
......
......@@ -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.Before;
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.assertEquals;
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 @@ public class PersistentSetTest {
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 @@ public class PersistentSetTest {
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",
......