示例#1
0
  /* (non-Javadoc)
   * @see caarray.client.test.suite.SearchByExampleTestSuite#populateSearch(java.lang.String[], caarray.client.test.search.ExampleSearch)
   */
  @Override
  protected void populateSearch(String[] input, ExampleSearch exampleSearch) {
    FileTypeSearch search = (FileTypeSearch) exampleSearch;
    FileType example = new FileType();
    if (headerIndexMap.get(API) < input.length && !input[headerIndexMap.get(API)].equals("")) {
      search.setApi(input[headerIndexMap.get(API)].trim());
    }

    if (headerIndexMap.get(NAME) < input.length && !input[headerIndexMap.get(NAME)].equals(""))
      example.setName(input[headerIndexMap.get(NAME)].trim());

    search.setFileType(example);
    if (headerIndexMap.get(TEST_CASE) < input.length
        && !input[headerIndexMap.get(TEST_CASE)].equals(""))
      search.setTestCase(Float.parseFloat(input[headerIndexMap.get(TEST_CASE)].trim()));
    if (headerIndexMap.get(EXPECTED_RESULTS) < input.length
        && !input[headerIndexMap.get(EXPECTED_RESULTS)].equals(""))
      search.setExpectedResults(
          Integer.parseInt(input[headerIndexMap.get(EXPECTED_RESULTS)].trim()));
    if (headerIndexMap.get(MIN_RESULTS) < input.length
        && !input[headerIndexMap.get(MIN_RESULTS)].equals(""))
      search.setMinResults(Integer.parseInt(input[headerIndexMap.get(MIN_RESULTS)].trim()));
    if (headerIndexMap.get(EXPECTED_NAME) < input.length
        && !input[headerIndexMap.get(EXPECTED_NAME)].equals(""))
      search.addExpectedName(input[headerIndexMap.get(EXPECTED_NAME)].trim());
    if (headerIndexMap.get(EXPECTED_CATEGORY) < input.length
        && !input[headerIndexMap.get(EXPECTED_CATEGORY)].equals(""))
      search.addExpectedCategory(input[headerIndexMap.get(EXPECTED_CATEGORY)].trim());
  }