test_class.declarator: options
test_class.modifier: private
test_class.original_string: private CmdlineOptions options;
test_class.type: CmdlineOptions
test_class.var_name: options
test_class.declarator: listener
test_class.modifier: private
test_class.original_string: private Listener listener;
test_class.type: Listener
test_class.var_name: listener
test_class.file: ontopia-engine/src/test/java/net/ontopia/utils/CmdlineOptionsTest.java
test_class.identifier: CmdlineOptionsTest
test_case.body: @Test
    public void testWithMistypedOption() throws CmdlineOptions.OptionsException {
      String[] argv = {"-tmid=140", "propfile", "tmfile.xtm"};
      setupRDBMS(argv);
  
      try {
        options.parse();
        Assert.fail("Incorrect options allowed");
      } catch (CmdlineOptions.OptionsException e) {
        Assert.assertTrue("Wrong problem reported" + e.getArgument(), e.getArgument().equals("-tmid=140"));
      }
    }
test_case.class_method_signature: CmdlineOptionsTest.testWithMistypedOption()
test_case.full_signature: @Test public void testWithMistypedOption()
test_case.identifier: testWithMistypedOption
test_case.invocations: setupRDBMS parse fail assertTrue getArgument equals getArgument
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWithMistypedOption()
focal_class.declarator: application
focal_class.modifier: protected
focal_class.original_string: protected String application;
focal_class.type: String
focal_class.var_name: application
focal_class.declarator: argv
focal_class.modifier: protected
focal_class.original_string: protected String[] argv;
focal_class.type: String[]
focal_class.var_name: argv
focal_class.declarator: sargs = new StringBuilder()
focal_class.modifier: protected
focal_class.original_string: protected StringBuilder sargs = new StringBuilder();
focal_class.type: StringBuilder
focal_class.var_name: sargs
focal_class.declarator: largs = new ArrayList<LongOpt>()
focal_class.modifier: protected
focal_class.original_string: protected List<LongOpt> largs = new ArrayList<LongOpt>();
focal_class.type: List<LongOpt>
focal_class.var_name: largs
focal_class.declarator: listeners = new HashMap<Integer, ListenerIF>()
focal_class.modifier: protected
focal_class.original_string: protected Map<Integer, ListenerIF> listeners = new HashMap<Integer, ListenerIF>();
focal_class.type: Map<Integer, ListenerIF>
focal_class.var_name: listeners
focal_class.declarator: arguments = new ArrayList<String>()
focal_class.modifier: protected
focal_class.original_string: protected List<String> arguments = new ArrayList<String>();
focal_class.type: List<String>
focal_class.var_name: arguments
focal_class.file: ontopia-engine/src/main/java/net/ontopia/utils/CmdlineOptions.java
focal_class.identifier: CmdlineOptions
focal_class.class_method_signature: CmdlineOptions.CmdlineOptions(String application, String[] argv)
focal_class.full_signature: public  CmdlineOptions(String application, String[] argv)
focal_class.identifier: CmdlineOptions
focal_class.modifiers: public
focal_class.parameters: (String application, String[] argv)
focal_class.signature:  CmdlineOptions(String application, String[] argv)
focal_class.class_method_signature: CmdlineOptions.addShort(ListenerIF listener, char c)
focal_class.full_signature: public void addShort(ListenerIF listener, char c)
focal_class.identifier: addShort
focal_class.modifiers: public
focal_class.parameters: (ListenerIF listener, char c)
focal_class.return: void
focal_class.signature: void addShort(ListenerIF listener, char c)
focal_class.class_method_signature: CmdlineOptions.addShort(ListenerIF listener, char c, boolean req_arg)
focal_class.full_signature: public void addShort(ListenerIF listener, char c, boolean req_arg)
focal_class.identifier: addShort
focal_class.modifiers: public
focal_class.parameters: (ListenerIF listener, char c, boolean req_arg)
focal_class.return: void
focal_class.signature: void addShort(ListenerIF listener, char c, boolean req_arg)
focal_class.class_method_signature: CmdlineOptions.addLong(ListenerIF listener, String name, char c)
focal_class.full_signature: public void addLong(ListenerIF listener, String name, char c)
focal_class.identifier: addLong
focal_class.modifiers: public
focal_class.parameters: (ListenerIF listener, String name, char c)
focal_class.return: void
focal_class.signature: void addLong(ListenerIF listener, String name, char c)
focal_class.class_method_signature: CmdlineOptions.addLong(ListenerIF listener, String name, char c, boolean req_arg)
focal_class.full_signature: public void addLong(ListenerIF listener, String name, char c, boolean req_arg)
focal_class.identifier: addLong
focal_class.modifiers: public
focal_class.parameters: (ListenerIF listener, String name, char c, boolean req_arg)
focal_class.return: void
focal_class.signature: void addLong(ListenerIF listener, String name, char c, boolean req_arg)
focal_class.class_method_signature: CmdlineOptions.parse()
focal_class.full_signature: public void parse()
focal_class.identifier: parse
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void parse()
focal_class.class_method_signature: CmdlineOptions.getArguments()
focal_class.full_signature: public String[] getArguments()
focal_class.identifier: getArguments
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getArguments()
focal_method.body: public void parse() throws OptionsException {
      Getopt g = new Getopt(application, argv, sargs.toString(), largs.toArray(new LongOpt[] {}));
      g.setOpterr(false); // We'll do our own error handling
      
      int c;
      while ((c = g.getopt()) != -1) {
        switch (c) {
        case '?':
          // Get invalid option
          int ix = g.getOptind();
          String option = argv[(ix == 0 ? 0 : ix-1)];
          throw new OptionsException(option, g.getOptarg());
        default:
          ListenerIF listener = listeners.get(new Integer(c));
          if (listener != null)
            listener.processOption((char)c, g.getOptarg());
          else
            System.err.println ("Warning: option '" + (char)c + "' ignored");
          break;
        }
      }
      
      // Get non-option arguments
      for (int i = g.getOptind(); i < argv.length ; i++) {
        arguments.add(argv[i]);
      }
    }
focal_method.class_method_signature: CmdlineOptions.parse()
focal_method.full_signature: public void parse()
focal_method.identifier: parse
focal_method.invocations: toString toArray setOpterr getopt getOptind getOptarg get processOption getOptarg println getOptind add
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void parse()