Search in sources :

Example 1 with CmdLineArgs

use of jena.cmd.CmdLineArgs in project jena by apache.

the class TestCmdLine method test_Flag1.

@Test
public void test_Flag1() {
    String[] args = new String[] { "" };
    CmdLineArgs cl = new CmdLineArgs(args);
    ArgDecl argA = new ArgDecl(false, "-a");
    cl.add(argA);
    cl.process();
    assertTrue("-a argument found", !cl.contains(argA));
}
Also used : ArgDecl(jena.cmd.ArgDecl) CmdLineArgs(jena.cmd.CmdLineArgs) Test(org.junit.Test)

Example 2 with CmdLineArgs

use of jena.cmd.CmdLineArgs in project jena by apache.

the class TestCmdLine method test_Flag2.

@Test
public void test_Flag2() {
    String[] args = new String[] { "-a" };
    CmdLineArgs cl = new CmdLineArgs(args);
    ArgDecl argA = new ArgDecl(false, "-a");
    cl.add(argA);
    cl.process();
    assertTrue("No -a argument found", cl.contains(argA));
}
Also used : ArgDecl(jena.cmd.ArgDecl) CmdLineArgs(jena.cmd.CmdLineArgs) Test(org.junit.Test)

Example 3 with CmdLineArgs

use of jena.cmd.CmdLineArgs in project jena by apache.

the class TestCmdLine method test_Simple1.

@Test
public void test_Simple1() {
    String[] args = new String[] { "" };
    CmdLineArgs cl = new CmdLineArgs(args);
    cl.process();
}
Also used : CmdLineArgs(jena.cmd.CmdLineArgs) Test(org.junit.Test)

Example 4 with CmdLineArgs

use of jena.cmd.CmdLineArgs in project jena by apache.

the class TestCmdLine method test_nArg1.

@Test
public void test_nArg1() {
    String[] args = new String[] { "-arg=V1", "--arg=V2", "-v" };
    CmdLineArgs cl = new CmdLineArgs(args);
    ArgDecl argA = new ArgDecl(true, "-arg");
    cl.add(argA);
    ArgDecl argV = new ArgDecl(false, "-v");
    cl.add(argV);
    cl.process();
    assertTrue("No -arg= argument found", cl.contains(argA));
    Iterator<String> iter = cl.getValues("arg").iterator();
    assertEquals("Argument 1", iter.next(), "V1");
    assertEquals("Argument 2", iter.next(), "V2");
}
Also used : ArgDecl(jena.cmd.ArgDecl) CmdLineArgs(jena.cmd.CmdLineArgs) Test(org.junit.Test)

Example 5 with CmdLineArgs

use of jena.cmd.CmdLineArgs in project jena by apache.

the class TestCmdLine method test_Arg1.

@Test
public void test_Arg1() {
    String[] args = new String[] { "" };
    CmdLineArgs cl = new CmdLineArgs(args);
    ArgDecl argA = new ArgDecl(true, "-arg");
    cl.add(argA);
    cl.process();
    assertTrue("-arg argument found", !cl.contains(argA));
}
Also used : ArgDecl(jena.cmd.ArgDecl) CmdLineArgs(jena.cmd.CmdLineArgs) Test(org.junit.Test)

Aggregations

CmdLineArgs (jena.cmd.CmdLineArgs)7 Test (org.junit.Test)7 ArgDecl (jena.cmd.ArgDecl)6