From 4ecfd9617a75c1d4685b01fc78e0c20d8f43a303 Mon Sep 17 00:00:00 2001 From: Grace Tang Date: Tue, 16 Jan 2018 10:14:35 -0500 Subject: [PATCH] Test implicit entry point feature (#158) This passing test case has no explicit entry point. --- .../testImplicitEntryPoint/in/A.java | 9 +++++++++ .../ui/tests/ConvertStreamToParallelRefactoringTest.java | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 edu.cuny.hunter.streamrefactoring.tests/resources/ConvertStreamToParallel/testImplicitEntryPoint/in/A.java diff --git a/edu.cuny.hunter.streamrefactoring.tests/resources/ConvertStreamToParallel/testImplicitEntryPoint/in/A.java b/edu.cuny.hunter.streamrefactoring.tests/resources/ConvertStreamToParallel/testImplicitEntryPoint/in/A.java new file mode 100644 index 00000000..200259fd --- /dev/null +++ b/edu.cuny.hunter.streamrefactoring.tests/resources/ConvertStreamToParallel/testImplicitEntryPoint/in/A.java @@ -0,0 +1,9 @@ +package p; + +import java.util.stream.IntStream; + +public class A { + public static void main(String[] args) { + IntStream.of(1).count(); + } +} diff --git a/edu.cuny.hunter.streamrefactoring.tests/test cases/edu/cuny/hunter/streamrefactoring/ui/tests/ConvertStreamToParallelRefactoringTest.java b/edu.cuny.hunter.streamrefactoring.tests/test cases/edu/cuny/hunter/streamrefactoring/ui/tests/ConvertStreamToParallelRefactoringTest.java index 48294f6e..ccabb2d9 100644 --- a/edu.cuny.hunter.streamrefactoring.tests/test cases/edu/cuny/hunter/streamrefactoring/ui/tests/ConvertStreamToParallelRefactoringTest.java +++ b/edu.cuny.hunter.streamrefactoring.tests/test cases/edu/cuny/hunter/streamrefactoring/ui/tests/ConvertStreamToParallelRefactoringTest.java @@ -711,4 +711,11 @@ public void testField() throws Exception { false, EnumSet.of(TransformationAction.CONVERT_TO_PARALLEL), PreconditionSuccess.P1, Refactoring.CONVERT_SEQUENTIAL_STREAM_TO_PARALLEL, RefactoringStatus.OK, Collections.emptySet())); } + + public void testImplicitEntryPoint() throws Exception { + helper(new StreamAnalysisExpectedResult("IntStream.of(1)", EnumSet.of(ExecutionMode.SEQUENTIAL), + EnumSet.of(Ordering.ORDERED), false, false, false, EnumSet.of(TransformationAction.CONVERT_TO_PARALLEL), + PreconditionSuccess.P2, Refactoring.CONVERT_SEQUENTIAL_STREAM_TO_PARALLEL, RefactoringStatus.OK, + Collections.emptySet())); + } }