Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@

<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/openhft/chronicle/values/AlignTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import net.openhft.chronicle.bytes.Byteable;
import net.openhft.chronicle.bytes.BytesStore;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static net.openhft.chronicle.values.Values.newNativeReference;

Expand Down
18 changes: 9 additions & 9 deletions src/test/java/net/openhft/chronicle/values/ComplexValueTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

import net.openhft.chronicle.bytes.Byteable;
import net.openhft.chronicle.bytes.BytesStore;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

import static net.openhft.chronicle.values.Values.newHeapInstance;
import static net.openhft.chronicle.values.Values.newNativeReference;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class ComplexValueTest extends ValuesTestCommon {

Expand Down Expand Up @@ -44,13 +44,13 @@ public void heapAndNativeBehaviourMatch() {
Map<String, FieldModel> byName = model.fields()
.collect(Collectors.toMap(FieldModel::name, Function.identity()));

assertTrue("label field present", byName.containsKey("label"));
assertTrue("mirrorEnabled field present", byName.containsKey("mirrorEnabled"));
assertTrue("label offset should be resolved",
model.fieldBitOffset(byName.get("label")) >= 0);
assertTrue("history should allocate extent per element",
model.fieldBitExtent(byName.get("history"))
>= 3 * Long.SIZE);
assertTrue(byName.containsKey("label"), "label field present");
assertTrue(byName.containsKey("mirrorEnabled"), "mirrorEnabled field present");
assertTrue(model.fieldBitOffset(byName.get("label")) >= 0,
"label offset should be resolved");
assertTrue(model.fieldBitExtent(byName.get("history"))
>= 3 * Long.SIZE,
"history should allocate extent per element");

// behaviour assertions
assertEquals(ComplexValue.Status.ACTIVE, nativeValue.getStatus());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import net.openhft.chronicle.bytes.BytesStore;
import net.openhft.chronicle.core.values.*;
import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static net.openhft.chronicle.bytes.BytesStore.nativeStoreWithFixedCapacity;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

@SuppressWarnings({"rawtypes", "unchecked"})
public class CoreValuesTest extends ValuesTestCommon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import net.openhft.chronicle.core.values.IntValue;
import net.openhft.chronicle.core.values.LongValue;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

/**
* Interface holding a five element array of {@code long} values for field type tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
package net.openhft.chronicle.values;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class UnderscoreFieldNameTest extends ValuesTestCommon {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.openhft.chronicle.bytes.Bytes;
import net.openhft.chronicle.bytes.BytesStore;
import net.openhft.chronicle.core.values.LongValue;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer;
Expand All @@ -17,8 +17,8 @@
import static net.openhft.chronicle.values.Generators.generateNativeClass;
import static net.openhft.chronicle.values.Values.newHeapInstance;
import static net.openhft.chronicle.values.Values.newNativeReference;
import static org.junit.Assert.*;
import static net.openhft.compiler.CompilerUtils.CACHED_COMPILER;
import static org.junit.jupiter.api.Assertions.*;

/**
* Tests code generation and serialisation routines.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

import net.openhft.chronicle.bytes.Byteable;
import net.openhft.chronicle.bytes.BytesStore;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static net.openhft.chronicle.values.ValueInterfaceWithEnumTest.SimpleValueInterface.SVIEnum.SIX;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

/**
* @author ges
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/net/openhft/chronicle/values/ValuesTestCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import net.openhft.chronicle.core.threads.CleaningThread;
import net.openhft.chronicle.core.threads.ThreadDump;
import net.openhft.chronicle.core.time.SystemTimeProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;

import java.util.LinkedHashMap;
import java.util.Map;
Expand All @@ -32,7 +32,7 @@ public class ValuesTestCommon {
private Map<ExceptionKey, Integer> exceptions;
private final Map<Predicate<ExceptionKey>, String> expectedExceptions = new LinkedHashMap<>();

@Before
@BeforeEach
public void enableReferenceTracing() {
AbstractReferenceCounted.enableReferenceTracing();
}
Expand All @@ -45,7 +45,7 @@ private void assertReferencesReleased() {
AbstractReferenceCounted.assertReferencesReleased();
}

@Before
@BeforeEach
public void threadDump() {
threadDump = new ThreadDump();
}
Expand All @@ -54,7 +54,7 @@ private void checkThreadDump() {
threadDump.assertNoNewThreads();
}

@Before
@BeforeEach
public void recordExceptions() {
exceptions = Jvm.recordExceptions();
}
Expand Down Expand Up @@ -98,7 +98,7 @@ private void checkExceptions() {
}
}

@After
@AfterEach
public void afterChecks() {
SystemTimeProvider.CLOCK = SystemTimeProvider.INSTANCE;
CleaningThread.performCleanup(Thread.currentThread());
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/net/openhft/chronicle/values/VolatileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

import net.openhft.chronicle.bytes.Byteable;
import net.openhft.chronicle.bytes.BytesStore;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.nio.ByteBuffer;

import static net.openhft.chronicle.values.Values.newHeapInstance;
import static net.openhft.chronicle.values.Values.newNativeReference;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;

/*
* Created by daniel on 11/06/2014.
Expand Down Expand Up @@ -53,7 +53,7 @@ public void testGenerateJavaCode() throws ClassNotFoundException, IllegalAccessE
assertEquals(3, jbi.getVolatileIntAt(3));
} catch (AssertionError e) {
e.printStackTrace();
assertFalse("Throws an IllegalArgumentException", true);
assertFalse(true, "Throws an IllegalArgumentException");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it shouldn't catch the AssertionError

}

//Test the native interface
Expand All @@ -75,7 +75,7 @@ public void testGenerateJavaCode() throws ClassNotFoundException, IllegalAccessE
assertEquals(3, jbi.getVolatileIntAt(3));
} catch (AssertionError e) {
e.printStackTrace();
assertFalse("Throws an IllegalArgumentException", true);
assertFalse(true, "Throws an IllegalArgumentException");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import net.openhft.chronicle.values.Values;
import net.openhft.chronicle.values.ValuesTestCommon;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class ChronicleValueTypeTest extends ValuesTestCommon {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import net.openhft.chronicle.values.NotNull;
import net.openhft.chronicle.values.Values;
import net.openhft.chronicle.values.ValuesTestCommon;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Tests that heap and native {@link Entity} values hold the same content but
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import net.openhft.chronicle.values.Values;
import net.openhft.chronicle.values.ValuesTestCommon;
import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static java.util.Objects.requireNonNull;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

public class PointerTest extends ValuesTestCommon {

Expand Down