Search in sources :

Example 6 with ArgDecl

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

the class TestCmdLine method test_Flag3.

@Test
public void test_Flag3() {
    String[] args = new String[] { "-a", "filename" };
    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 7 with ArgDecl

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

the class TestCmdLine method test_Arg2.

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

Aggregations

ArgDecl (jena.cmd.ArgDecl)7 CmdLineArgs (jena.cmd.CmdLineArgs)6 Test (org.junit.Test)6 InputStream (java.io.InputStream)1 CmdException (jena.cmd.CmdException)1 Dataset (org.apache.jena.query.Dataset)1 Lang (org.apache.jena.riot.Lang)1 Logger (org.slf4j.Logger)1