[update] Update to junit 5
This commit is contained in:
parent
8b0efef54f
commit
1f642ec91d
@ -33,11 +33,11 @@ package net.bigeon.gclc.system;
|
|||||||
* knowledge of the CeCILL license and that you accept its terms.
|
* knowledge of the CeCILL license and that you accept its terms.
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import net.bigeon.gclc.exception.CommandRunException;
|
import net.bigeon.gclc.exception.CommandRunException;
|
||||||
import net.bigeon.gclc.manager.ConsoleInput;
|
import net.bigeon.gclc.manager.ConsoleInput;
|
||||||
@ -51,10 +51,10 @@ public class ExecSystemCommandTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testExecSystemCommand() {
|
public void testExecSystemCommand() {
|
||||||
final ExecSystemCommand cmd = new ExecSystemCommand("test");
|
final ExecSystemCommand cmd = new ExecSystemCommand("test");
|
||||||
assertEquals("Name should be preserved", "test", cmd.getCommandName());
|
assertEquals("test", cmd.getCommandName(), "Name should be preserved");
|
||||||
assertNotNull("tip should be defined", cmd.tip());
|
assertNotNull(cmd.tip(), "tip should be defined");
|
||||||
assertNotNull("usage should be defined", cmd.usagePattern());
|
assertNotNull(cmd.usagePattern(), "usage should be defined");
|
||||||
assertNotNull("usage should be defined", cmd.usageDetail());
|
assertNotNull(cmd.usageDetail(), "usage should be detailed");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Test the execution of the command.
|
/** Test the execution of the command.
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
*/
|
*/
|
||||||
package net.bigeon.gclc.system;
|
package net.bigeon.gclc.system;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
|
|
||||||
import net.bigeon.gclc.exception.CommandRunException;
|
import net.bigeon.gclc.exception.CommandRunException;
|
||||||
@ -27,8 +27,8 @@ public class ForwardingRunnableTest {
|
|||||||
// Runnable should close immediatly.
|
// Runnable should close immediatly.
|
||||||
runnable.run();
|
runnable.run();
|
||||||
|
|
||||||
assertTrue("Error should be a CommandRunException",
|
assertInstanceOf(CommandRunException.class, runnable.getError(),
|
||||||
runnable.getError() instanceof CommandRunException);
|
"Error should be a CommandRunException");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -39,6 +39,6 @@ public class ForwardingRunnableTest {
|
|||||||
is);
|
is);
|
||||||
// Runnable should close immediatly.
|
// Runnable should close immediatly.
|
||||||
runnable.run();
|
runnable.run();
|
||||||
assertTrue("Error should be an IO", runnable.getError() instanceof IOException);
|
assertInstanceOf(IOException.class, runnable.getError(), "Error should be an IO");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user