mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-134 commented out and removed test
This commit is contained in:
@@ -16,21 +16,9 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import net.openhft.lang.model.DataValueClasses;
|
||||
import net.openhft.lang.values.IntValue;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
public class DefaultValueTest {
|
||||
|
||||
@Test
|
||||
/* @Test
|
||||
public void test() throws IllegalAccessException, InstantiationException, IOException {
|
||||
File file = Builder.getPersistenceFile();
|
||||
try {
|
||||
@@ -56,5 +44,5 @@ public class DefaultValueTest {
|
||||
} finally {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -122,7 +122,6 @@ public class PostClusterMapCreationTest {
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void test() throws IOException, InterruptedException {
|
||||
|
||||
map2a.put(1, "EXAMPLE-2");
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package net.openhft.chronicle.map.example;
|
||||
|
||||
import net.openhft.chronicle.map.ChronicleMap;
|
||||
import net.openhft.chronicle.map.ChronicleMapBuilder;
|
||||
import net.openhft.lang.model.Byteable;
|
||||
import net.openhft.lang.values.IntValue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
public class WordCount {
|
||||
|
||||
static String[] words;
|
||||
static int expectedSize;
|
||||
static {
|
||||
try {
|
||||
// english version of war and peace -> ascii
|
||||
String fullText =
|
||||
new String(Files.readAllBytes(Paths.get("war_and_peace.txt")), UTF_8);
|
||||
words = fullText.split("\\s+");
|
||||
expectedSize = (int) Arrays.stream(words).distinct().count();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static interface ByteableIntValue extends IntValue, Byteable {}
|
||||
|
||||
public int chronicleMap() throws IOException {
|
||||
ChronicleMap<String, ByteableIntValue> map =
|
||||
ChronicleMapBuilder.of(String.class, ByteableIntValue.class)
|
||||
.entrySize(16)
|
||||
.actualSegments(1)
|
||||
.entries(expectedSize)
|
||||
.create();
|
||||
ByteableIntValue v = map.acquireUsing("a", null);
|
||||
for (String word : words) {
|
||||
map.acquireUsing(word, v).addValue(1);
|
||||
}
|
||||
return map.acquireUsing("a", v).getValue();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user