Update tests
This commit is contained in:
parent
0d2ad849da
commit
cb5cb37bf0
@ -37,7 +37,7 @@ import ocr.GestionnaireCopies;
|
||||
|
||||
public class Read implements Callable <Void> {
|
||||
|
||||
private static Logger logger = LogManager.getLogger(Read.class);
|
||||
public Logger logger = LogManager.getLogger(Read.class);
|
||||
|
||||
@Spec
|
||||
Model.CommandSpec spec;
|
||||
|
@ -2,8 +2,10 @@ package commands;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import picocli.CommandLine;
|
||||
import picocli.CommandLine.Command;
|
||||
import picocli.CommandLine.HelpCommand;
|
||||
@ -28,23 +30,34 @@ import picocli.CommandLine.HelpCommand;
|
||||
|
||||
class TestRead {
|
||||
|
||||
Read read = new Read(System.out);
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
@BeforeEach
|
||||
void setUp () {
|
||||
|
||||
Read read = new Read(System.out);
|
||||
read = new Read(System.out);
|
||||
|
||||
CommandLine cmd = new CommandLine (new TestRead())
|
||||
.addSubcommand("-r", read)
|
||||
.addSubcommand("help", new HelpCommand());
|
||||
.addSubcommand("-r", read);
|
||||
|
||||
String[] t = {"-r","-v9","-d","pdf","config.txt"};
|
||||
cmd.execute(t);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void testCommand() {
|
||||
|
||||
assertFalse(read == null);
|
||||
|
||||
assertEquals("pdf",read.directory_name);
|
||||
assertEquals(false,read.help);
|
||||
assertEquals(9,read.vb_level);
|
||||
assertEquals("config.txt",read.source_path);
|
||||
assertEquals("result.csv",read.result_name);
|
||||
|
||||
assertFalse(read.logger == null);
|
||||
assertEquals(Level.DEBUG.toString(), read.logger.getLevel().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user