예제 #1
0
 private Builder addRawSelector(String rawSelector) {
   if (rawSelector.charAt(0) == '@') {
     try {
       String pathString = rawSelector.substring(1);
       if (pathString.isEmpty()) {
         throw new TestSelectorParseException("Doesn't mention a path!");
       }
       File file = new File(pathString);
       loadFromFile(file);
     } catch (TestSelectorParseException | IOException e) {
       String message =
           String.format("Error with test-selector '%s': %s", rawSelector, e.getMessage());
       throw new RuntimeException(message, e);
     }
     return this;
   } else {
     TestSelector testSelector = TestSelector.buildFromSelectorString(rawSelector);
     this.testSelectors.add(testSelector);
   }
   return this;
 }