change to <mainClass>net.openhft.chronicle.map.MissSizedMapsTest</mainClass>

This commit is contained in:
Rob Austin
2018-11-15 09:56:31 +00:00
parent 4a3a8e2f23
commit e2edffe3c5
2 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -384,7 +384,7 @@
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.mypackage.MyClass</mainClass>
<mainClass>net.openhft.chronicle.map.MissSizedMapsTest</mainClass>
</manifest>
</archive>
</configuration>
@@ -1,8 +1,5 @@
package net.openhft.chronicle.map;
import org.junit.Assert;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.net.URI;
@@ -18,12 +15,13 @@ import java.util.Map;
*/
public class MissSizedMapsTest {
@Test
public void testSmallEntries() throws IOException, URISyntaxException {
public static void main(String[] args) throws IOException, URISyntaxException {
ChronicleMap<String, String> actual = ChronicleMapBuilder.of(String.class, String.class)
.averageKey("D-6.0149935894066442E18").averageValue("226|16533|4|1|1|testHarness").entries(150 << 10)
.createPersistedTo(File.createTempFile("chronicle", "cmap"));
check(actual);
MissSizedMapsTest missSizedMapsTest = new MissSizedMapsTest();
missSizedMapsTest.check(actual);
}
private void check(final ChronicleMap<String, String> actual) throws
@@ -44,18 +42,18 @@ public class MissSizedMapsTest {
}
Assert.assertEquals(actual.size(), expected.size());
Assert.assertEquals(actual.keySet().size(), expected.keySet().size());
assert actual.size() == expected.size();
assert actual.keySet().size() == expected.keySet().size();
for (String key : actual.keySet()) {
if (!expected.containsKey(key)) {
Assert.fail(key + " not in key set but in map expected");
throw new IllegalStateException(key + " not in key set but in map expected");
}
}
for (String key : expected.keySet()) {
if (!actual.containsKey(key)) {
Assert.fail(key + " not in key set but in map actual");
throw new IllegalStateException(key + " not in key set but in map actual");
}
}