< prev index next >

test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TestBuilder.java

Print this page

        

*** 66,80 **** TestBuilder::toMethodCalls)).flatMap(s -> s).collect( Collectors.toList())), CMDLINE_ARG_PREFIX + "exclude", arg -> (excludedTests = Optional.ofNullable( ! excludedTests).orElse(new HashSet<String>())).add(arg), CMDLINE_ARG_PREFIX + "include", arg -> (includedTests = Optional.ofNullable( ! includedTests).orElse(new HashSet<String>())).add(arg), CMDLINE_ARG_PREFIX + "space-subst", arg -> spaceSubstitute = arg, CMDLINE_ARG_PREFIX + "group", --- 66,80 ---- TestBuilder::toMethodCalls)).flatMap(s -> s).collect( Collectors.toList())), CMDLINE_ARG_PREFIX + "exclude", arg -> (excludedTests = Optional.ofNullable( ! excludedTests).orElseGet(() -> new HashSet<String>())).add(arg), CMDLINE_ARG_PREFIX + "include", arg -> (includedTests = Optional.ofNullable( ! includedTests).orElseGet(() -> new HashSet<String>())).add(arg), CMDLINE_ARG_PREFIX + "space-subst", arg -> spaceSubstitute = arg, CMDLINE_ARG_PREFIX + "group",
*** 125,136 **** } // Log all matches before returning from the function return tests.filter(test -> { String testDescription = test.createDescription().testFullName(); ! boolean match = filters.stream().anyMatch( ! v -> testDescription.contains(v)); if (match) { trace(String.format(logMsg + ": %s", testDescription)); } return pred.apply(match); }).collect(Collectors.toList()).stream(); --- 125,135 ---- } // Log all matches before returning from the function return tests.filter(test -> { String testDescription = test.createDescription().testFullName(); ! boolean match = filters.stream().anyMatch(testDescription::contains); if (match) { trace(String.format(logMsg + ": %s", testDescription)); } return pred.apply(match); }).collect(Collectors.toList()).stream();
*** 157,178 **** restoreSpaces.apply(excludedTests), x -> !x, "Exclude"); } private void flushTestGroup() { if (testGroup != null) { ! filterTestGroup().forEach(testBody -> createTestInstance(testBody)); clear(); } } private void createTestInstance(MethodCall testBody) { final List<ThrowingConsumer> curBeforeActions; final List<ThrowingConsumer> curAfterActions; Method testMethod = testBody.getMethod(); if (Stream.of(BeforeEach.class, AfterEach.class).anyMatch( ! type -> testMethod.isAnnotationPresent(type))) { curBeforeActions = beforeActions; curAfterActions = afterActions; } else { curBeforeActions = new ArrayList<>(beforeActions); curAfterActions = new ArrayList<>(afterActions); --- 156,177 ---- restoreSpaces.apply(excludedTests), x -> !x, "Exclude"); } private void flushTestGroup() { if (testGroup != null) { ! filterTestGroup().forEach(this::createTestInstance); clear(); } } private void createTestInstance(MethodCall testBody) { final List<ThrowingConsumer> curBeforeActions; final List<ThrowingConsumer> curAfterActions; Method testMethod = testBody.getMethod(); if (Stream.of(BeforeEach.class, AfterEach.class).anyMatch( ! testMethod::isAnnotationPresent)) { curBeforeActions = beforeActions; curAfterActions = afterActions; } else { curBeforeActions = new ArrayList<>(beforeActions); curAfterActions = new ArrayList<>(afterActions);
*** 284,294 **** } // Get the list of all public methods as need to deal with overloads. List<Method> methods = Stream.of(methodClass.getMethods()).filter( (m) -> filterMethod(methodName, m)).collect(Collectors.toList()); if (methods.isEmpty()) { ! new ParseException(String.format( "Method [%s] not found in [%s] class;", methodName, className)); } trace(String.format("%s -> %s", qualifiedMethodName, methods)); --- 283,293 ---- } // Get the list of all public methods as need to deal with overloads. List<Method> methods = Stream.of(methodClass.getMethods()).filter( (m) -> filterMethod(methodName, m)).collect(Collectors.toList()); if (methods.isEmpty()) { ! throw new ParseException(String.format( "Method [%s] not found in [%s] class;", methodName, className)); } trace(String.format("%s -> %s", qualifiedMethodName, methods));
< prev index next >