Examples of Argument


Examples of org.apache.jmeter.config.Argument

        ModificationItem[] mods = new ModificationItem[getArguments().getArguments().size()];
        BasicAttribute attr;
        PropertyIterator iter = getArguments().iterator();
        int count = 0;
        while (iter.hasNext()) {
            Argument item = (Argument) iter.next().getObjectValue();
            attr = getBasicAttribute(item.getName(), item.getValue());
            mods[count] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attr);
            count = +1;
        }
        return mods;
    }
View Full Code Here

Examples of org.apache.jmeter.config.Argument

                }

                if (testParams != null) {
                    PropertyIterator i = testParams.getArguments().iterator();
                    while (i.hasNext()) {
                        Argument arg = (Argument) i.next().getObjectValue();
                        String name = arg.getName();
                        String value = arg.getValue();

                        // If a user has set parameters in one test, and then
                        // selects a different test which supports the same
                        // parameters, those parameters should have the same
                        // values that they did in the original test.
View Full Code Here

Examples of org.apache.jsieve.Argument

        List<Argument> args = arguments.getArgumentList();
        if (args.size() != 1)
            throw context.getCoordinate().syntaxException(
                    "Exactly 1 argument permitted. Found " + args.size());

        Argument argument = args.get(0);
        if (!(argument instanceof StringListArgument))
            throw context.getCoordinate().syntaxException(
                    "Expecting a string-list");

        if (1 != ((StringListArgument) argument).getList().size())
View Full Code Here

Examples of org.apache.karaf.shell.api.action.Argument

                        for (String alias : aliases) {
                            options.put(alias, option);
                        }
                    }
                }
                Argument argument = field.getAnnotation(Argument.class);
                if (argument != null) {
                    Integer key = argument.index();
                    if (arguments.containsKey(key)) {
                        LOGGER.warn("Duplicate @Argument annotations on class " + type.getName() + " for index: " + key + " see: " + field);
                    } else {
                        arguments.put(key, field);
                    }
                }
            }
        }
        options.put(HelpOption.HELP.name(), HelpOption.HELP);

        argsCompleters = new ArrayList<>();
        optionsCompleter = new StringsCompleter(options.keySet());

        boolean multi = false;
        for (int key = 0; key < arguments.size(); key++) {
            Completer completer = null;
            Field field = arguments.get(key);
            if (field != null) {
                Argument argument = field.getAnnotation(Argument.class);
                multi = (argument != null && argument.multiValued());
                Completion ann = field.getAnnotation(Completion.class);
                if (ann != null) {
                    Class<?> clazz = ann.value();
                    String[] value = ann.values();
                    if (clazz != null) {
View Full Code Here

Examples of org.apache.karaf.shell.commands.Argument

                        for (String alias : aliases) {
                            options.put(alias, option);
                        }
                    }
                }
                Argument argument = field.getAnnotation(Argument.class);
                if (argument != null) {
                    Integer key = argument.index();
                    if (arguments.containsKey(key)) {
                        LOGGER.warn("Duplicate @Argument annotations on class " + type.getName() + " for index: " + key + " see: " + field);
                    } else {
                        arguments.put(key, field);
                    }
View Full Code Here

Examples of org.apache.tools.ant.gui.util.Argument

     *
     * @param args String of textual arguments to parse.
     */
    public Args(String[] args) {
        GetArgs _getArgs = new GetArgs(args);
        Argument a;

        for (int i = 0; i < _getArgs.optionCount() ; i++) {
            a = _getArgs.nthOption(i);
            if (a.option.equals("-h"))
               {
View Full Code Here

Examples of org.apache.tools.ant.types.Commandline.Argument

   * Copy the classpath to the command line with access rules included.
   * @param cmd the given command line
   * @param classpath the given classpath entry
   */
  private void createClasspathArgument(Commandline cmd, Path classpath) {
    Argument arg = cmd.createArgument();
    final String[] pathElements = classpath.list();

    // empty path return empty string
    if (pathElements.length == 0) {
      arg.setValue(Util.EMPTY_STRING);
      return;
    }

    // no access rules, can set the path directly
    if (accessRules == null) {
      arg.setPath(classpath);
      return;
    }

    int rulesLength = accessRules.size();
    String[] rules = (String[]) accessRules.toArray(new String[rulesLength]);
    int nextRule = 0;
    final StringBuffer result = new StringBuffer();

    //access rules are expected in the same order as the classpath, but there could
    //be elements in the classpath not in the access rules or access rules not in the classpath
    for (int i = 0, max = pathElements.length; i < max; i++) {
      if (i > 0)
        result.append(File.pathSeparatorChar);
      String pathElement = pathElements[i];
      result.append(pathElement);
      //the rules list is [path, rule, path, rule, ...]
      for (int j = nextRule; j < rulesLength; j += 2) {
        String rule = rules[j];
        if (pathElement.endsWith(rule)) {
          result.append(rules[j + 1]);
          nextRule = j + 2;
          break;
        }
        // if the path doesn't match, it could be due to a trailing file separatorChar in the rule
        if (rule.endsWith(File.separator)) {
          // rule ends with the File.separator, but pathElement might not
          // otherwise it would match on the first endsWith
          int ruleLength = rule.length();
          if (pathElement.regionMatches(false, pathElement.length() - ruleLength + 1, rule, 0, ruleLength - 1)) {
            result.append(rules[j + 1]);
            nextRule = j + 2;
            break;
          }
        } else if (pathElement.endsWith(File.separator)) {
          // rule doesn't end with the File.separator, but pathElement might
          int ruleLength = rule.length();
          if (pathElement.regionMatches(false, pathElement.length() - ruleLength - 1, rule, 0, ruleLength)) {
            result.append(rules[j + 1]);
            nextRule = j + 2;
            break;
          }
        }
      }
    }

    arg.setValue(result.toString());
  }
View Full Code Here

Examples of org.apache.tools.ant.types.Commandline.Argument

      task.setJar(new File(mxmlcPath));
      task.setProject(project);
      task.setDir(project.getBaseDir());
      task.setOutputproperty(outputProperty);
     
      Argument versionArgument = task.createArg();
      versionArgument.setValue("--version");
     
      task.execute();
     
      //Parse version number and return as int
      String output = project.getProperty(outputProperty);
View Full Code Here

Examples of org.apache.tools.ant.types.Commandline.Argument

      task.setProject(project);
      task.setDir(project.getBaseDir());
      task.setMaxmemory("256M"); //MXMLC needs to eat
      task.setErrorProperty("MXMLC_ERROR");
     
      Argument flexLibArgument = task.createArg();
      flexLibArgument.setLine("+flexlib \"" + frameworksPath + "\"");
     
      if(configuration.getPlayer().equals("air"))
      {
         Argument airConfigArgument = task.createArg();
         airConfigArgument.setValue("+configname=air");
      }
     
      Argument outputFile = task.createArg();
      outputFile.setLine("-output \"" + finalFile.getAbsolutePath() + "\"");
     
      Argument sourcePath = task.createArg();
      sourcePath.setLine("-source-path " + configuration.getSources().getPathElements(" ") + " " + configuration.getTestSources().getPathElements(" "));
     
      determineLibraryPath( task );
    
      determineLoadConfigArgument( task );
      
      Argument debug = task.createArg();
      debug.setLine( "-debug=" + configuration.getDebug() );

      Argument headlessServer = task.createArg();
      headlessServer.setLine("-headless-server=true");
     
     
      Argument mainFile = task.createArg();
      mainFile.setValue(runnerFile.getAbsolutePath());
     
      return task;
   }
View Full Code Here

Examples of org.apache.tools.ant.types.Commandline.Argument

  
   private void determineLoadConfigArgument(Java java)
   {
       if(configuration.getLoadConfig() != null)
       {
           Argument argument = java.createArg();
           argument.setLine(configuration.getLoadConfig().getCommandLineArgument());
       }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.