Skip to content

Commit 5d98a73

Browse files
yiming-tang-cskhatchad
authored andcommitted
Fix #125 (#135)
Add a test case that includes a field.
1 parent 954dcb9 commit 5d98a73

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package p;
2+
3+
import java.util.HashSet;
4+
import java.util.stream.*;
5+
6+
import edu.cuny.hunter.streamrefactoring.annotations.*;
7+
8+
class A {
9+
10+
Stream<Object> stream;
11+
12+
void m() {
13+
stream = new HashSet<>().stream();
14+
}
15+
16+
@EntryPoint
17+
void n() {
18+
m();
19+
stream.distinct().count();
20+
}
21+
22+
}

edu.cuny.hunter.streamrefactoring.tests/test cases/edu/cuny/hunter/streamrefactoring/ui/tests/ConvertStreamToParallelRefactoringTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,4 +686,14 @@ public void testOneEntryPoint() throws Exception {
686686
EnumSet.of(TransformationAction.CONVERT_TO_PARALLEL), PreconditionSuccess.P1,
687687
Refactoring.CONVERT_SEQUENTIAL_STREAM_TO_PARALLEL, RefactoringStatus.OK, Collections.emptySet()));
688688
}
689+
690+
/**
691+
* Test #125. A test case that includes a field.
692+
*/
693+
public void testField() throws Exception {
694+
helper(new StreamAnalysisExpectedResult("new HashSet<>().stream()",
695+
Collections.singleton(ExecutionMode.SEQUENTIAL), Collections.singleton(Ordering.UNORDERED), false, true,
696+
false, EnumSet.of(TransformationAction.CONVERT_TO_PARALLEL), PreconditionSuccess.P1,
697+
Refactoring.CONVERT_SEQUENTIAL_STREAM_TO_PARALLEL, RefactoringStatus.OK, Collections.emptySet()));
698+
}
689699
}

0 commit comments

Comments
 (0)