test_class.file: cli-scanner/src/test/java/org/eclipse/steady/cli/VulasCliTest.java
test_class.identifier: VulasCliTest
test_class.superclass: extends AbstractGoalTest
test_case.body: @Test
    public void testCleanGoal() throws GoalConfigurationException, GoalExecutionException {
      // Mock REST services
      this.configureBackendServiceUrl(server);
      this.setupMockServices(this.testApp);
  
      final String[] args = new String[] {"-goal", "clean"};
      VulasCli.main(args);
  
      // Check the HTTP calls made
      verifyHttp(server).times(1, method(Method.POST), uri("/backend" + PathBuilder.app(testApp)));
      verifyHttp(server)
          .times(
              2,
              method(Method.POST),
              uri("/backend" + PathBuilder.goalExcecutions(null, null, this.testApp)));
    }
test_case.class_method_signature: VulasCliTest.testCleanGoal()
test_case.full_signature: @Test public void testCleanGoal()
test_case.identifier: testCleanGoal
test_case.invocations: configureBackendServiceUrl setupMockServices main times verifyHttp method uri app times verifyHttp method uri goalExcecutions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCleanGoal()
focal_class.declarator: log = org.apache.logging.log4j.LogManager.getLogger()
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = org.apache.logging.log4j.LogManager.getLogger();
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: goalType = null
focal_class.modifier: private static
focal_class.original_string: private static GoalType goalType = null;
focal_class.type: GoalType
focal_class.var_name: goalType
focal_class.declarator: goal = null
focal_class.modifier: private static
focal_class.original_string: private static AbstractGoal goal = null;
focal_class.type: AbstractGoal
focal_class.var_name: goal
focal_class.file: cli-scanner/src/main/java/org/eclipse/steady/cli/VulasCli.java
focal_class.identifier: VulasCli
focal_class.class_method_signature: VulasCli.main(String[] _args)
focal_class.full_signature: public static void main(String[] _args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] _args)
focal_class.return: void
focal_class.signature: void main(String[] _args)
focal_method.body: public static void main(String[] _args)
        throws GoalConfigurationException, GoalExecutionException {
  
      // Prepare parsing of cmd line arguments
      final Options options = new Options();
      options.addOption(
          "goal",
          "goal",
          true,
          "Goal to be executed (clean, cleanSpace, app, a2c, t2c, instr, report, upload)");
  
      // Get the goal to be executed
      try {
        final CommandLineParser parser = new DefaultParser();
        final CommandLine cmd = parser.parse(options, _args);
        String g = cmd.getOptionValue("goal", null);
  
        // Ugly workaround to correct the non-intuitive goal type SPACECLEAN and SPACEDEL
        // TODO: Change GoalType.SPACECLEAN and GoalType.SPACEDEL
        if ("cleanSpace".equals(g)) g = "spaceClean";
        else if ("cleanSpace".equals(g)) g = "spaceDel";
  
        goalType = GoalType.parseGoal(g);
      }
      // Happens for unknown/invalid options
      catch (ParseException pe) {
        log.error(pe.getMessage());
        final HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp("Vulas Command Line Interface", options);
        return;
      }
      // Happens during the parsing of the goal
      catch (IllegalArgumentException iae) {
        log.error(iae.getMessage());
        final HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp("Vulas Command Line Interface", options);
        return;
      }
  
      // Create and execute the goal
      try {
        goal = GoalFactory.create(goalType, GoalClient.CLI);
        goal.executeSync();
      } catch (IllegalStateException ise) {
        log.error(ise.getMessage());
      } catch (IllegalArgumentException iae) {
        log.error(iae.getMessage());
      }
    }
focal_method.class_method_signature: VulasCli.main(String[] _args)
focal_method.full_signature: public static void main(String[] _args)
focal_method.identifier: main
focal_method.invocations: addOption parse getOptionValue equals equals parseGoal error getMessage printHelp error getMessage printHelp create executeSync error getMessage error getMessage
focal_method.modifiers: public static
focal_method.parameters: (String[] _args)
focal_method.return: void
focal_method.signature: void main(String[] _args)