Ejemplo n.º 1
0
def run(args, exec_path):
    conf_file = os.path.join(exec_path, args.file)
    """Read configuration with config readers, update configuration with cli parsers"""
    config = parse_config_file(conf_file)
    config.update(get_updated_config_dict(config, args))
    """Run setup actions"""
    run_cli_setup_actions(config, args)
    """Generate parameters with config readers, update parameters with cli parsers """
    parameter_dict = get_jar_parameter_dict(config)

    updated_parameters = get_updated_launch_params(parameter_dict, args)

    updated_parameter_dict = dict(parameter_dict)
    updated_parameter_dict.update(updated_parameters)

    parameter_list = get_formatted_launch_parameters(updated_parameter_dict)

    print_launch_parameters(updated_parameter_dict)
    print_updated_parameters(updated_parameters, parameter_dict)

    jar_file = args.jar_file
    if jar_file is None or not jar_file.strip():
        """Figure out jar file from pom"""
        pom_path = os.path.join(exec_path, config[POM])
        artifact, version = parse_pom(pom_path)
        assert artifact != ''
        assert version != ''
        jar_file = get_jar_filename(args.jar_path, artifact, version)

    return run_with_parameters(parameter_list, args.bypass_prompt, exec_path,
                               jar_file)
Ejemplo n.º 2
0
 def test_project_with_no_version(self):
     with self.assertRaises(PomParseError):
         file = "_testing/pom_with_no_version.xml"
         self.assertEqual(parse_pom(get_absolute_path(file)),
                          ('pom_artifact', ''))
Ejemplo n.º 3
0
 def test_project_with_parent_version(self):
     file = "_testing/pom_with_parent_version.xml"
     self.assertEqual(parse_pom(get_absolute_path(file)),
                      ('pom_artifact', '1.0.3-SNAPSHOT'))
Ejemplo n.º 4
0
 def test_project_with_no_version(self):
     self.assertEqual(
         parse_pom(get_absolute_path("_testing/pom_with_no_version.xml")),
         ('pom_artifact', ''))