Cut blank lines

This commit is contained in:
Peter Lawrey
2016-07-07 20:33:40 +01:00
parent 6e23ba5a12
commit a230c08e89
36 changed files with 36 additions and 183 deletions
@@ -27,14 +27,12 @@ import java.io.IOException;
*/
public class BuildVersionTest {
@Test
public void test() throws IOException, InterruptedException {
// checks that we always get a version
Assert.assertNotNull(BuildVersion.version());
}
/**
* check that the map records the version
*
@@ -43,7 +43,5 @@ public class BytesMarshallableValueTest {
this.x = x;
this.foo = foo;
}
}
}
}
@@ -158,7 +158,6 @@ interface IBean {
@RunWith(value = Parameterized.class)
public class CHMUseCasesTest {
static volatile int i = 0;
private final TypeOfMap typeOfMap;
@@ -238,7 +237,6 @@ public class CHMUseCasesTest {
assertEquals(map1.size(), map2.size());
for (Object key : map1.keySet()) {
if (map1.valueClass() == byte[].class)
@@ -250,7 +248,6 @@ public class CHMUseCasesTest {
byte[][] o1 = (byte[][]) map1.get(key);
byte[][] o2 = (byte[][]) map2.get(key);
Assert.assertEquals(o1.length, o2.length);
for (int i = 0; i < o1.length; i++) {
Assert.assertArrayEquals(o1[i], o2[i]);
@@ -289,7 +286,6 @@ public class CHMUseCasesTest {
try (ChronicleMap actual = builder.create()) {
actual.putAll(file);
if (map1.valueClass() == char[].class ||
map1.valueClass() == byte[].class ||
map1.valueClass() == byte[][].class) {
@@ -448,8 +444,7 @@ public class CHMUseCasesTest {
mpx1030.setAskPx(109.7);
mpx1030.setBidPx(107.6);
}
}
}
}
@@ -532,7 +527,6 @@ public class CHMUseCasesTest {
public void testStringStringMap() throws ExecutionException, InterruptedException,
IOException {
ChronicleMapBuilder<String, String> builder = ChronicleMapBuilder
.of(String.class, String.class)
.entries(1);
@@ -603,7 +597,6 @@ public class CHMUseCasesTest {
public void testCharSequenceCharSequenceMap()
throws ExecutionException, InterruptedException, IOException {
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder
.of(CharSequence.class, CharSequence.class)
.entries(10);
@@ -623,7 +616,6 @@ public class CHMUseCasesTest {
map.remove("key-1");
assertNull(map.getUsing(key, value));
assertEquals("New World", map.getMapped("Hello", s -> "New " + s));
assertEquals(null, map.getMapped("No key",
(SerializableFunction<CharSequence, CharSequence>) s -> "New " + s));
@@ -647,7 +639,6 @@ public class CHMUseCasesTest {
@Test
public void testAcquireUsingWithCharSequence() throws IOException {
ChronicleMapBuilder<CharSequence, CharSequence> builder = ChronicleMapBuilder
.of(CharSequence.class, CharSequence.class)
.entries(1);
@@ -693,7 +684,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<IntValue, CharSequence> map = newInstance(builder)) {
IntValue using = Values.newHeapInstance(IntValue.class);
using.setValue(1);
@@ -716,7 +706,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<IntValue, StringBuilder> map = newInstance(builder)) {
IntValue key = Values.newHeapInstance(IntValue.class);
key.setValue(1);
@@ -921,7 +910,6 @@ public class CHMUseCasesTest {
map.put(key1, value1);
assertEquals(value1, map.get(key1));
key2 = 2;
value2 = 22;
map.put(key2, value2);
@@ -964,7 +952,6 @@ public class CHMUseCasesTest {
@Test
public void testLongLongMap() throws ExecutionException, InterruptedException, IOException {
ChronicleMapBuilder<Long, Long> builder = ChronicleMapBuilder
.of(Long.class, Long.class)
.entries(10);
@@ -1005,7 +992,6 @@ public class CHMUseCasesTest {
@Test
public void testDoubleDoubleMap() throws ExecutionException, InterruptedException, IOException {
ChronicleMapBuilder<Double, Double> builder = ChronicleMapBuilder
.of(Double.class, Double.class)
.entries(10);
@@ -1035,9 +1021,7 @@ public class CHMUseCasesTest {
} catch (Exception todoMoreSpecificException) {
}
}
}
}
@Test
@@ -1060,7 +1044,6 @@ public class CHMUseCasesTest {
map.put(key1, value1);
assertTrue(Arrays.equals(new byte[]{11, 11},
map.getMapped(key1, new SerializableFunction<byte[], byte[]>() {
@Override
@@ -1085,7 +1068,6 @@ public class CHMUseCasesTest {
byte[] a2 = map.get(key1);
assertTrue(Arrays.equals(new byte[]{12, 10}, a2));
}
}
@@ -1101,7 +1083,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<ByteBuffer, ByteBuffer> map = newInstance(builder)) {
ByteBuffer key1 = ByteBuffer.wrap(new byte[]{1, 1, 1, 1});
ByteBuffer key2 = ByteBuffer.wrap(new byte[]{2, 2, 2, 2});
ByteBuffer value1 = ByteBuffer.wrap(new byte[]{11, 11, 11, 11});
@@ -1111,7 +1092,6 @@ public class CHMUseCasesTest {
assertBBEquals(value2, map.get(key1));
assertNull(map.get(key2));
map.put(key1, value1);
mapChecks();
@@ -1130,7 +1110,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<ByteBuffer, ByteBuffer> map = newInstance(builder)) {
ByteBuffer key1 = ByteBuffer.wrap(new byte[]{1, 1, 1, 1});
ByteBuffer key2 = ByteBuffer.wrap(new byte[]{2, 2, 2, 2});
ByteBuffer value1 = ByteBuffer.wrap(new byte[]{11, 11, 11, 11});
@@ -1201,12 +1180,10 @@ public class CHMUseCasesTest {
valueA.flip();
}
value1.clear();
value1.putInt(12345);
value1.flip();
try (net.openhft.chronicle.core.io.Closeable c =
map.acquireContext(key1, valueB)) {
assertBBEquals(value1, valueB);
@@ -1241,7 +1218,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<ByteBuffer, ByteBuffer> map = newInstance(builder)) {
ByteBuffer key1 = ByteBuffer.wrap(new byte[]{1, 1, 1, 1});
ByteBuffer key2 = ByteBuffer.wrap(new byte[]{2, 2, 2, 2});
ByteBuffer value1 = ByteBuffer.allocateDirect(4);
@@ -1299,7 +1275,6 @@ public class CHMUseCasesTest {
IntValue value1 = Values.newHeapInstance(IntValue.class);
IntValue value2 = Values.newHeapInstance(IntValue.class);
key1.setValue(1);
value1.setValue(11);
map.put(key1, value1);
@@ -1517,7 +1492,6 @@ public class CHMUseCasesTest {
// this may change due to alignment
// assertEquals(6, entrySize(map));
// assertEquals(1, ((VanillaChronicleMap) map).maxChunksPerEntry);
IntValue key1 = Values.newHeapInstance(IntValue.class);
IntValue key2 = Values.newHeapInstance(IntValue.class);
@@ -1621,7 +1595,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<IntValue, UnsignedShortValue> map = newInstance(builder)) {
// this may change due to alignment
// assertEquals(8, entrySize(map));
assertEquals(1, ((VanillaChronicleMap) map).maxChunksPerEntry);
@@ -1726,7 +1699,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<IntValue, CharValue> map = newInstance(builder)) {
assertEquals(1, ((VanillaChronicleMap) map).maxChunksPerEntry);
IntValue key1 = Values.newHeapInstance(IntValue.class);
IntValue key2 = Values.newHeapInstance(IntValue.class);
@@ -1826,7 +1798,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<IntValue, UnsignedByteValue> map = newInstance(builder)) {
// TODO should be 5, but shorter fields based on range doesn't seem to be implemented
// on data value generation level yet
//assertEquals(8, entrySize(map)); this may change due to alignmented
@@ -1837,7 +1808,6 @@ public class CHMUseCasesTest {
UnsignedByteValue value1 = Values.newHeapInstance(UnsignedByteValue.class);
UnsignedByteValue value2 = Values.newHeapInstance(UnsignedByteValue.class);
key1.setValue(1);
value1.setValue(11);
map.put(key1, value1);
@@ -1933,7 +1903,6 @@ public class CHMUseCasesTest {
try (ChronicleMap<IntValue, BooleanValue> map = newInstance(builder)) {
assertEquals(1, ((VanillaChronicleMap) map).maxChunksPerEntry);
IntValue key1 = Values.newHeapInstance(IntValue.class);
@@ -1941,7 +1910,6 @@ public class CHMUseCasesTest {
BooleanValue value1 = Values.newHeapInstance(BooleanValue.class);
BooleanValue value2 = Values.newHeapInstance(BooleanValue.class);
key1.setValue(1);
value1.setValue(true);
map.put(key1, value1);
@@ -2044,7 +2012,6 @@ public class CHMUseCasesTest {
FloatValue value1 = Values.newHeapInstance(FloatValue.class);
FloatValue value2 = Values.newHeapInstance(FloatValue.class);
key1.setValue(1);
value1.setValue(11);
map.put(key1, value1);
@@ -2150,7 +2117,6 @@ public class CHMUseCasesTest {
DoubleValue value1 = Values.newHeapInstance(DoubleValue.class);
DoubleValue value2 = Values.newHeapInstance(DoubleValue.class);
key1.setValue(1);
value1.setValue(11);
assertEquals(null, map.get(key1));
@@ -2257,7 +2223,6 @@ public class CHMUseCasesTest {
LongValue value1 = Values.newHeapInstance(LongValue.class);
LongValue value2 = Values.newHeapInstance(LongValue.class);
key1.setValue(1);
value1.setValue(11);
assertEquals(null, map.get(key1));
@@ -2350,7 +2315,6 @@ public class CHMUseCasesTest {
.valueMarshaller(ListMarshaller.of(
new StringBytesReader(), CharSequenceBytesWriter.INSTANCE));
try (ChronicleMap<String, List<String>> map = newInstance(builder)) {
map.put("1", Collections.<String>emptyList());
map.put("2", asList("two-A"));
@@ -2397,7 +2361,6 @@ public class CHMUseCasesTest {
.valueMarshaller(SetMarshaller.of(
new StringBytesReader(), CharSequenceBytesWriter.INSTANCE));
try (ChronicleMap<String, Set<String>> map = newInstance(builder)) {
map.put("1", Collections.<String>emptySet());
map.put("2", new LinkedHashSet<>(asList("one")));
@@ -2445,7 +2408,6 @@ public class CHMUseCasesTest {
.entries(3)
.valueMarshaller(valueMarshaller);
try (ChronicleMap<String, Map<String, String>> map = newInstance(builder)) {
map.put("1", Collections.<String, String>emptyMap());
map.put("2", mapOf("one", "uni"));
@@ -2602,7 +2564,6 @@ public class CHMUseCasesTest {
enum TypeOfMap {SIMPLE, SIMPLE_PERSISTED}
interface I1 {
@Array(length = 10)
String getStrAt(int i);
@@ -175,7 +175,6 @@ public class ChronicleMapImportExportTest {
}
}
@Test
public void testFromHashMap() throws IOException, InterruptedException {
@@ -189,13 +188,11 @@ public class ChronicleMapImportExportTest {
map.put(1, "one");
map.put(2, "two");
final XStream xstream = new XStream(new JettisonMappedXmlDriver());
xstream.setMode(XStream.NO_REFERENCES);
xstream.toXML(map, new FileOutputStream(file));
try (ChronicleMap<Integer, String> expected = ChronicleMapBuilder
.of(Integer.class, String.class)
.averageValueSize(10)
@@ -213,7 +210,6 @@ public class ChronicleMapImportExportTest {
Assert.assertEquals("two", expected.get(2));
}
file.deleteOnExit();
}
@@ -251,7 +247,6 @@ public class ChronicleMapImportExportTest {
}
}
@Test
public void testBondVOInterface() throws IOException, InterruptedException {
@@ -119,8 +119,7 @@ public class ChronicleMapSanityCheckTest {
throw new RuntimeException(e);
}
}
}
}
enum DummyValue {
DUMMY_VALUE
@@ -189,7 +189,6 @@ public class ChronicleMapTest {
}
}
@Test
public void testByteArrayPersistenceFileReuse() throws IOException {
final File persistenceFile = Builder.getPersistenceFile();
@@ -226,8 +225,7 @@ public class ChronicleMapTest {
assertEquals(map1, map2);
}
}
}
}
@Test
@@ -250,11 +248,9 @@ public class ChronicleMapTest {
assertEquals(map1, map2);
}
}
}
}
@Test
public void testEqualsByteArray() {
@@ -275,11 +271,9 @@ public class ChronicleMapTest {
assertEquals(map1, map2);
}
}
}
}
@Test
public void testSize() {
@@ -714,12 +708,10 @@ public class ChronicleMapTest {
assertEquals(j, value3.getValue());
}
}
}
}
}
}
@Test
public void testAcquireFromMultipleThreads() throws InterruptedException {
int entries = 1000 * 1000;
@@ -807,8 +799,7 @@ public class ChronicleMapTest {
}
}
}
}
}
@Test
public void testLargerEntries() {
@@ -857,7 +848,6 @@ public class ChronicleMapTest {
.averageKeySize(14)
.averageValueSize(value0.length() + 4);
// File tmpFile = File.createTempFile("testAcquirePerf", ".deleteme");
// tmpFile.deleteOnExit();
//createPersistedTo(tmpFile);
@@ -1005,7 +995,6 @@ public class ChronicleMapTest {
es.awaitTermination(1, TimeUnit.MINUTES);
}
static final LongValue ONE = Values.newHeapInstance(LongValue.class);
static {
@@ -1040,7 +1029,6 @@ public class ChronicleMapTest {
final int independence = Math.min(procs, runs > 500 ? 8 : 4);
System.out.println("\nKey size: " + runs + " Million entries. " + builder);
for (int j = 0; j < count; j++) {
long start = System.currentTimeMillis();
List<Future> futures = new ArrayList<>();
@@ -1274,8 +1262,7 @@ public class ChronicleMapTest {
assertNull(map.getUsing(key, value));
}
}
}
}
}
@Test
@@ -1294,9 +1281,7 @@ public class ChronicleMapTest {
assertValues(values, new CharSequence[]{"1", "3"});
assertValues(map.values(), new CharSequence[]{"1", "3"});
}
}
}
@Test
public void mapPutReflectedInViews() throws IOException {
@@ -1316,7 +1301,6 @@ public class ChronicleMapTest {
}
}
@Test
public void entrySetRemoveReflectedInMapAndOtherViews() throws IOException {
try (ChronicleMap<Integer, CharSequence> map = getViewTestMap(3)) {
@@ -1332,7 +1316,6 @@ public class ChronicleMapTest {
}
}
@Test
public void keySetRemoveReflectedInMapAndOtherViews() throws IOException {
try (ChronicleMap<Integer, CharSequence> map = getViewTestMap(3)) {
@@ -1348,8 +1331,7 @@ public class ChronicleMapTest {
assertValues(values, new CharSequence[]{"1", "3"});
}
}
}
@Test
public void valuesRemoveReflectedInMap() throws IOException {
@@ -1365,8 +1347,7 @@ public class ChronicleMapTest {
assertValues(values, new CharSequence[]{"1", "3"});
}
}
}
@Test
public void entrySetIteratorRemoveReflectedInMapAndOtherViews() throws IOException {
@@ -1389,7 +1370,6 @@ public class ChronicleMapTest {
}
}
@Test
public void keySetIteratorRemoveReflectedInMapAndOtherViews() throws IOException {
try (ChronicleMap<Integer, CharSequence> map = getViewTestMap(3)) {
@@ -1410,8 +1390,7 @@ public class ChronicleMapTest {
assertValues(values, expectedValues);
}
}
}
@Test
public void valuesIteratorRemoveReflectedInMapAndOtherViews() throws IOException {
@@ -1438,8 +1417,7 @@ public class ChronicleMapTest {
assertValues(values, expectedValues);
}
}
}
@Test
public void entrySetRemoveAllReflectedInMapAndOtherViews() throws IOException {
@@ -1460,8 +1438,7 @@ public class ChronicleMapTest {
assertValues(values, new CharSequence[]{"3"});
}
}
}
@Test
public void keySetRemoveAllReflectedInMapAndOtherViews() throws IOException {
@@ -1477,8 +1454,7 @@ public class ChronicleMapTest {
assertValues(values, new CharSequence[]{"3"});
}
}
}
@Test
public void valuesRemoveAllReflectedInMapAndOtherViews() throws IOException {
@@ -1496,7 +1472,6 @@ public class ChronicleMapTest {
}
}
@Test
public void entrySetRetainAllReflectedInMapAndOtherViews() throws IOException {
try (ChronicleMap<Integer, CharSequence> map = getViewTestMap(3)) {
@@ -1515,7 +1490,6 @@ public class ChronicleMapTest {
}
}
@Test
public void keySetRetainAllReflectedInMapAndOtherViews() throws IOException {
try (ChronicleMap<Integer, CharSequence> map = getViewTestMap(3)) {
@@ -1530,8 +1504,7 @@ public class ChronicleMapTest {
assertValues(values, new CharSequence[]{"2", "1"});
}
}
}
@Test
public void valuesRetainAllReflectedInMapAndOtherViews() throws IOException {
@@ -1563,8 +1536,7 @@ public class ChronicleMapTest {
org.junit.Assert.assertTrue(values.isEmpty());
}
}
}
@Test
public void keySetClearReflectedInMapAndOtherViews() throws IOException {
@@ -1596,8 +1568,7 @@ public class ChronicleMapTest {
org.junit.Assert.assertTrue(values.isEmpty());
}
}
}
@Test
public void clearMapViaEntryIteratorRemoves() throws IOException {
@@ -1615,8 +1586,7 @@ public class ChronicleMapTest {
assertEquals(noOfElements, sum);
}
}
}
@Test
public void clearMapViaKeyIteratorRemoves() throws IOException {
@@ -1661,7 +1631,6 @@ public class ChronicleMapTest {
++sum;
}
assertEquals(noOfElements, sum);
}
}
@@ -1690,9 +1659,7 @@ public class ChronicleMapTest {
assertValues(map.values(), new String[]{"B"});
}
}
}
@Test
public void equalsTest() throws IOException {
@@ -1711,9 +1678,7 @@ public class ChronicleMapTest {
assertEquals(map1, map2);
}
}
}
}
private static final class IncrementRunnable implements Runnable {
@@ -1746,9 +1711,7 @@ public class ChronicleMapTest {
e.printStackTrace();
}
}
}
}
@Test
public void testPutLongValue() throws IOException {
@@ -1769,8 +1732,7 @@ public class ChronicleMapTest {
throw new AssertionError("Should throw either IllegalStateException or " +
"NullPointerException, but succeed");
}
}
}
@Test
public void testOffheapAcquireUsingLocked() throws IOException {
@@ -1826,8 +1788,7 @@ public class ChronicleMapTest {
assert value == v;
assertEquals(1, c.entry().value().get().getValue());
}
}
}
}
@Test(expected = IllegalArgumentException.class)
@@ -1937,4 +1898,3 @@ public class ChronicleMapTest {
}
@@ -189,7 +189,6 @@ public class EntryCountMapTest {
final int maxKeySize = "key:".length() +
(int) round(log10(moreThanMaxSize(maxSize) * stride + counter)) + 1;
return es.submit(new Callable<Void>() {
@Override
public Void call() {
@@ -256,8 +255,7 @@ public class EntryCountMapTest {
", seg: " + segments + ", min: " + minSize +
", size: " + map.size());
}
}
}
private static int moreThanMaxSize(int maxSize) {
return maxSize * 14 / 10 + 300;
@@ -45,7 +45,6 @@ public class Issue43Test {
}
}
private static class ValueWrapper {
private final double values[];
@@ -77,8 +77,7 @@ public class Issue58 {
.collect(toMap(k -> data.get(k), k -> k));
reverseMap.putAll(reverse);
}
}
}
public void test1(Map<String, UUID> data) throws IOException {
try (
@@ -125,9 +124,7 @@ public class Issue58 {
map.entrySet().forEach(e -> System.out.println(e.getKey() + "->" + e.getValue()));
reverseMap.forEach((k, v) -> System.out.println(k + " -> " + v));
}
}
}
static final class UuidMarshaller
implements BytesReader<UUID>, BytesWriter<UUID>, EnumMarshallable<UuidMarshaller> {
@@ -100,7 +100,6 @@ public class Issue63Test {
.entries(10)
.createPersistedTo(mapFile);
float[] exp1 = new float[]{
(float) -0.4200737, (float) -0.5428019, (float) 0.25542524, (float) -0.10631648,
(float) 0.12206168, (float) 0.0411969, (float) 0.9899967, (float) 0.15887073,
@@ -40,7 +40,6 @@ public class KeySegmentDistributionTest {
keySegmentDistributionTest(1000, 5);
}
public void keySegmentDistributionTest(int size, int segments) {
ChronicleMap<CharSequence, Integer> map = ChronicleMapBuilder
.of(CharSequence.class, Integer.class)
@@ -16,7 +16,6 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.values.MaxUtf8Length;
import net.openhft.chronicle.values.Values;
@@ -117,6 +117,5 @@ public class WriteThroughputTest {
long time = System.nanoTime() - start;
System.out.printf("Concurrent %,d MB took %.3f seconds%n", size * count >> 20, time / 1e9);
}
}
}
}
@@ -37,7 +37,6 @@ import static org.junit.Assert.*;
public class ChronicleMapTest extends JSR166TestCase {
static ChronicleMap<Integer, CharSequence> newShmIntString(int size) throws IOException {
return ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.averageValueSize(1)
@@ -109,7 +109,6 @@ public class MapCheck {
serTest(size);
}
static Map newMap() {
try {
return ChronicleMapBuilder.of(Object.class, Object.class).create();
@@ -66,8 +66,7 @@ public class Builder {
System.out.println("same");
break;
}
}
}
Jvm.pause(1);
if (System.currentTimeMillis() - startTime > timeOutMs)
break;
@@ -66,7 +66,6 @@ public class Issue24ChronicleSetTest {
}
System.out.println("Finished all threads");
}
public static class WorkerThread implements Runnable {
@@ -92,13 +91,11 @@ public class Issue24ChronicleSetTest {
set.addAll(nomenclatures);
Set<String> strings = new HashSet<>(
selectRandomSubset(nomenclatures, nomenclatures.size() / 2));
set.addAll(strings);
Set<String> toRemove = new HashSet<>();
Random generator = new Random();
for (int j = 0; j < 3; j++) {
@@ -121,6 +118,5 @@ public class Issue24ChronicleSetTest {
System.out.println(s);
}
}
}
}
}
@@ -43,7 +43,6 @@ public class DoubleArray implements Byteable, Copyable<DoubleArray> {
offset = 0;
}
@Override
public void bytesStore(BytesStore bytes, long offset, long maxSize) {
this.bs = bytes;