Package net.sf.lapg.gen

Examples of net.sf.lapg.gen.LapgOptions


      System.out.println(HELP_MESSAGE);
      System.exit(1);
      return;
    }

    LapgOptions options = LapgOptions.parseArguments(args, System.err);
    if (options == null) {
      System.err.println("Try 'lapg --help' for more information.");
      System.exit(1);
      return;
    }
View Full Code Here


      current = null;
    }
  }

  public void testCheckNoArgs() {
    LapgOptions lo = LapgOptions.parseArguments(new String[0], failingStream);
    Assert.assertNotNull(lo);
    Assert.assertEquals("syntax", lo.getInput());
    Assert.assertNull(lo.getOutputFolder());
    Assert.assertEquals(0, lo.getDebug());
    Assert.assertEquals("java", lo.getTemplateName());
    Assert.assertEquals(0, lo.getAdditionalOptions().size());
    Assert.assertEquals(0, lo.getIncludeFolders().size());
    Assert.assertEquals(true, lo.isUseDefaultTemplates());
  }
View Full Code Here

    Assert.assertEquals(0, lo.getIncludeFolders().size());
    Assert.assertEquals(true, lo.isUseDefaultTemplates());
  }

  public void testCheckDebug() {
    LapgOptions lo = LapgOptions.parseArguments("-e".split(" "), failingStream);
    Assert.assertNotNull(lo);
    Assert.assertEquals("syntax", lo.getInput());
    Assert.assertEquals(LapgOptions.DEBUG_TABLES, lo.getDebug());
    lo = LapgOptions.parseArguments("-d".split(" "), failingStream);
    Assert.assertEquals(LapgOptions.DEBUG_AMBIG, lo.getDebug());
  }
View Full Code Here

    lo = LapgOptions.parseArguments("-d".split(" "), failingStream);
    Assert.assertEquals(LapgOptions.DEBUG_AMBIG, lo.getDebug());
  }

  public void testInput() {
    LapgOptions lo = LapgOptions.parseArguments("-e synt1".split(" "), failingStream);
    Assert.assertNotNull(lo);
    Assert.assertEquals("synt1", lo.getInput());
    Assert.assertEquals(LapgOptions.DEBUG_TABLES, lo.getDebug());
  }
View Full Code Here

    Assert.assertEquals(LapgOptions.DEBUG_TABLES, lo.getDebug());
  }

  public void testInput2() {
    expectError("lapg: should be only one input in arguments\n");
    LapgOptions lo = LapgOptions.parseArguments("synt2 synt1".split(" "), System.err);
    Assert.assertNull(lo);
    closeError();
  }
View Full Code Here

    closeError();
  }

  public void testTwiceArg() {
    expectError("lapg: option cannot be used twice -e\n");
    LapgOptions lo = LapgOptions.parseArguments("-e -e".split(" "), System.err);
    Assert.assertNull(lo);
    closeError();

    expectError("lapg: option cannot be used twice -x\n");
    lo = LapgOptions.parseArguments("--no-default-templates -x".split(" "), System.err);
View Full Code Here

    closeError();
  }

  public void testError() {
    expectError("lapg: no value for option -o\n");
    LapgOptions lo = LapgOptions.parseArguments("-o".split(" "), System.err);
    Assert.assertNull(lo);
    closeError();

    expectError("lapg: no value for option --output\n");
    lo = LapgOptions.parseArguments("--output".split(" "), System.err);
View Full Code Here

    Assert.assertNull(lo);
    closeError();
  }

  public void testComplicated() {
    LapgOptions lo = LapgOptions.parseArguments("-e -x -o outputY -i folder1;folder2 -i folder3 -t java2 a=5 b=6 syntax.g".split(" "), failingStream);
    Assert.assertNotNull(lo);
    Assert.assertEquals("syntax.g", lo.getInput());
    Assert.assertEquals("outputY", lo.getOutputFolder());
    Assert.assertEquals(LapgOptions.DEBUG_TABLES, lo.getDebug());
    Assert.assertEquals("java2", lo.getTemplateName());
    Assert.assertEquals(3, lo.getIncludeFolders().size());
    Assert.assertEquals("folder1", lo.getIncludeFolders().get(0));
    Assert.assertEquals("folder2", lo.getIncludeFolders().get(1));
    Assert.assertEquals("folder3", lo.getIncludeFolders().get(2));
    Assert.assertEquals(2, lo.getAdditionalOptions().size());
    Assert.assertEquals("5", lo.getAdditionalOptions().get("a"));
    Assert.assertEquals("6", lo.getAdditionalOptions().get("b"));
    Assert.assertEquals(false, lo.isUseDefaultTemplates());
  }
View Full Code Here

TOP

Related Classes of net.sf.lapg.gen.LapgOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.