mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
refactor to junit 5 latest and repoint dependencies
remove all testng references update annotations
This commit is contained in:
@@ -26,12 +26,6 @@
|
||||
<version>3.12.73-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
@@ -40,7 +34,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core-java8</artifactId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ package io.nosqlbench.engine.cli;
|
||||
|
||||
import io.nosqlbench.engine.cli.NBCLIOptions;
|
||||
import io.nosqlbench.engine.cli.NBCLIScriptAssembly;
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
|
||||
package io.nosqlbench.engine.cli;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@Test
|
||||
public class SessionNamerTest {
|
||||
|
||||
@Test
|
||||
@@ -33,6 +32,7 @@ public class SessionNamerTest {
|
||||
assertThat(name2).matches("scenario_\\d{8}_\\d{6}_\\d{3}");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomFormat() {
|
||||
SessionNamer namer = new SessionNamer();
|
||||
String name1 = namer.format("Custom_session_name");
|
||||
@@ -42,4 +42,4 @@ public class SessionNamerTest {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package io.nosqlbench.engine.cli;
|
||||
|
||||
import io.nosqlbench.docsys.core.PathWalker;
|
||||
import io.nosqlbench.virtdata.api.VirtDataResources;
|
||||
import org.testng.annotations.Test;
|
||||
import io.nosqlbench.nb.api.VirtDataResources;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.net.URL;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@Test
|
||||
public class TestNBCLIOptions {
|
||||
|
||||
@Test
|
||||
@@ -68,7 +66,7 @@ public class TestNBCLIOptions {
|
||||
assertThat(opts.wantsActivityTypes()).isFalse();
|
||||
opts = new NBCLIOptions(new String[]{"--list-drivers"});
|
||||
assertThat(opts.wantsActivityTypes()).isTrue();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -88,7 +86,7 @@ public class TestNBCLIOptions {
|
||||
assertThat(opts.wantsTopicalHelp()).isFalse();
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = {InvalidParameterException.class}, expectedExceptionsMessageRegExp = ".*unrecognized option.*")
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
public void shouldErrorSanelyWhenNoMatch() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{"unrecognizable command"});
|
||||
}
|
||||
@@ -103,14 +101,12 @@ public class TestNBCLIOptions {
|
||||
assertThat(cmd.getCmdArgs().get("param1")).isEqualTo("value1");
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = {InvalidParameterException.class},
|
||||
expectedExceptionsMessageRegExp = ".*script name must precede.*")
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
public void testShouldErrorSanelyWhenScriptNameSkipped() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{"script", "param1=value1"});
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = {InvalidParameterException.class},
|
||||
expectedExceptionsMessageRegExp = ".*script name not found.*")
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
public void testShouldErrorForMissingScriptName() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{"script"});
|
||||
}
|
||||
@@ -158,7 +154,7 @@ public class TestNBCLIOptions {
|
||||
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = InvalidParameterException.class)
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
public void shouldThrowErrorForInvalidStopActivity() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{ "stop", "woah=woah" });
|
||||
List<NBCLIOptions.Cmd> cmds = opts.getCommands();
|
||||
@@ -173,7 +169,7 @@ public class TestNBCLIOptions {
|
||||
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = InvalidParameterException.class)
|
||||
@Test(expected = InvalidParameterException.class)
|
||||
public void shouldThrowErrorForInvalidAwaitActivity() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{ "await", "awaitme=notvalid" });
|
||||
List<NBCLIOptions.Cmd> cmds = opts.getCommands();
|
||||
@@ -189,14 +185,13 @@ public class TestNBCLIOptions {
|
||||
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = NumberFormatException.class)
|
||||
@Test(expected = NumberFormatException.class)
|
||||
public void shouldThrowErrorForInvalidWaitMillisOperand() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{ "waitmillis", "noway" });
|
||||
List<NBCLIOptions.Cmd> cmds = opts.getCommands();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void listWorkloads() {
|
||||
NBCLIOptions opts = new NBCLIOptions(new String[]{ "--list-workloads"});
|
||||
|
||||
Reference in New Issue
Block a user