Package org.apache.oodt.cas.cli.option

Examples of org.apache.oodt.cas.cli.option.HelpCmdLineOption


      action.setName(actionName);
      Set<CmdLineAction> actions = Sets.newHashSet((CmdLineAction) action);

      // Setup Supported Options.
      Set<CmdLineOption> options = Sets.newHashSet();
      options.add(new HelpCmdLineOption());
      options.add(new PrintSupportedActionsCmdLineOption());
      options.add(createActionOption("action"));
      AdvancedCmdLineOption option = createAdvancedOption("message",
            createApplyToActionHandler(actionName, "setMessage"));
      ArgRegExpCmdLineOptionValidator validator = new ArgRegExpCmdLineOptionValidator();
View Full Code Here


      Set<CmdLineOption> validOptions = optionStore.loadSupportedOptions();
      initializeHandlers(validOptions);

      // Insure help options is present if required.
      if (findHelpOption(validOptions) == null) {
         validOptions.add(new HelpCmdLineOption());
      }

      // Insure action options are present if required.
      if (findFirstActionOption(validOptions) == null) {
         validOptions.add(new ActionCmdLineOption());
View Full Code Here

   }

   public void testIsSimpleOption() {
      assertTrue(CmdLineUtils
            .isSimpleOption(new PrintSupportedActionsCmdLineOption()));
      assertTrue(CmdLineUtils.isSimpleOption(new HelpCmdLineOption()));
      assertTrue(CmdLineUtils.isSimpleOption(createSimpleOption("Test", true)));
   }
View Full Code Here

      assertTrue(CmdLineUtils.isSimpleOption(new HelpCmdLineOption()));
      assertTrue(CmdLineUtils.isSimpleOption(createSimpleOption("Test", true)));
   }

   public void testIsActionOption() {
      assertFalse(CmdLineUtils.isActionOption(new HelpCmdLineOption()));
      assertTrue(CmdLineUtils.isActionOption(createActionOption("action")));
   }
View Full Code Here

      } catch (IllegalArgumentException ignore) { /* expect throw */ }
     
   }

   public void testIsGroupOption() {
      assertFalse(CmdLineUtils.isGroupOption(new HelpCmdLineOption()));
      assertTrue(CmdLineUtils.isGroupOption(createGroupOption("test", false)));
   }
View Full Code Here

      CmdLineUtils.asGroupOption(createGroupOption("test", false));
   }

   public void testIsHelpOption() {
      assertFalse(CmdLineUtils.isHelpOption(createSimpleOption("test", false)));
      assertTrue(CmdLineUtils.isHelpOption(new HelpCmdLineOption()));
   }
View Full Code Here

   public void testAsHelpOption() {
      try {
         CmdLineUtils.asHelpOption(createSimpleOption("test", false));
         fail("Should have thrown IllegalArgumentException");
      } catch (IllegalArgumentException ignore) { /* expect throw */ }
      CmdLineUtils.asHelpOption(new HelpCmdLineOption());
   }
View Full Code Here

      } catch (IllegalArgumentException ignore) { /* expect throw */ }
      CmdLineUtils.asHelpOption(new HelpCmdLineOption());
   }

   public void testFindHelpOption() {
      HelpCmdLineOption helpOption = new HelpCmdLineOption();
      Set<CmdLineOption> options = Sets.newHashSet(
            (CmdLineOption) createSimpleOption("test", false),
            createSimpleOption("test", false));

      assertNull(CmdLineUtils.findHelpOption(options));
View Full Code Here

      options.add(helpOption);
      assertEquals(helpOption, CmdLineUtils.findHelpOption(options));
   }

   public void testFindSpecifiedHelpOption() {
      CmdLineOptionInstance helpOption = createOptionInstance(new HelpCmdLineOption());
      Set<CmdLineOptionInstance> options = Sets.newHashSet(
            createOptionInstance(createSimpleOption("test", false)),
            createOptionInstance(createSimpleOption("test", false)));

      assertNull(findSpecifiedHelpOption(options));
      options.add(helpOption);
      assertEquals(helpOption, findSpecifiedHelpOption(options));
      options.add(createOptionInstance(new HelpCmdLineOption("h2", "help2", "Second Help Option", true)));
      try {
         findSpecifiedHelpOption(options);
         fail("Should have thrown IllegalArgumentException");
      } catch (IllegalArgumentException ignore) { /* expect throw */ }
   }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.cli.option.HelpCmdLineOption

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.