[JAVA-19668] (#13721)
* [JAVA-19668] Moved libraries-5 module to jdk9-and-above profile * [JAVA-19668] Moved libraries-4 module to jdk9-and-above profile * [JAVA-19668] Moved libraries-6 module to jdk9-and-above profile * [JAVA-19668] Moved libraries module to jdk9-and-above profile + reverted changes fro libraries-6 * [JAVA-19668] Created libraries-jdk8 module * [JAVA-19668] Clean up
This commit is contained in:
+46
@@ -0,0 +1,46 @@
|
||||
package com.baeldung.chronicle.queue;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.baeldung.chronicle.queue.ChronicleQueue;
|
||||
|
||||
import net.openhft.chronicle.Chronicle;
|
||||
import net.openhft.chronicle.ChronicleQueueBuilder;
|
||||
import net.openhft.chronicle.ExcerptTailer;
|
||||
import net.openhft.chronicle.tools.ChronicleTools;
|
||||
|
||||
public class ChronicleQueueIntegrationTest {
|
||||
|
||||
// @Ignore
|
||||
@Test
|
||||
public void givenSetOfValues_whenWriteToQueue_thenWriteSuccesfully() throws IOException {
|
||||
File queueDir = Files.createTempDirectory("chronicle-queue").toFile();
|
||||
ChronicleTools.deleteOnExit(queueDir.getPath());
|
||||
|
||||
Chronicle chronicle = ChronicleQueueBuilder.indexed(queueDir).build();
|
||||
String stringVal = "Hello World";
|
||||
int intVal = 101;
|
||||
long longVal = System.currentTimeMillis();
|
||||
double doubleVal = 90.00192091d;
|
||||
|
||||
ChronicleQueue.writeToQueue(chronicle, stringVal, intVal, longVal, doubleVal);
|
||||
|
||||
ExcerptTailer tailer = chronicle.createTailer();
|
||||
while (tailer.nextIndex()) {
|
||||
assertEquals(stringVal, tailer.readUTF());
|
||||
assertEquals(intVal, tailer.readInt());
|
||||
assertEquals(longVal, tailer.readLong());
|
||||
assertEquals((Double) doubleVal, (Double) tailer.readDouble());
|
||||
}
|
||||
tailer.finish();
|
||||
tailer.close();
|
||||
chronicle.close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package reflections;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class ReflectionsUnitTest {
|
||||
|
||||
@Test
|
||||
public void givenTypeThenGetAllSubTypes() {
|
||||
ReflectionsApp reflectionsApp = new ReflectionsApp();
|
||||
assertFalse(reflectionsApp.getReflectionsSubTypes()
|
||||
.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenTypeAndUsingBuilderThenGetAllSubTypes() {
|
||||
ReflectionsApp reflectionsApp = new ReflectionsApp();
|
||||
assertFalse(reflectionsApp.getReflectionsSubTypesUsingBuilder()
|
||||
.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenAnnotationThenGetAllAnnotatedMethods() {
|
||||
ReflectionsApp reflectionsApp = new ReflectionsApp();
|
||||
assertFalse(reflectionsApp.getDateDeprecatedMethods()
|
||||
.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenAnnotationThenGetAllAnnotatedConstructors() {
|
||||
ReflectionsApp reflectionsApp = new ReflectionsApp();
|
||||
assertFalse(reflectionsApp.getDateDeprecatedConstructors()
|
||||
.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenParamTypeThenGetAllMethods() {
|
||||
ReflectionsApp reflectionsApp = new ReflectionsApp();
|
||||
assertFalse(reflectionsApp.getMethodsWithDateParam()
|
||||
.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenReturnTypeThenGetAllMethods() {
|
||||
ReflectionsApp reflectionsApp = new ReflectionsApp();
|
||||
assertFalse(reflectionsApp.getMethodsWithVoidReturn()
|
||||
.isEmpty());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user