- Notifications
You must be signed in to change notification settings - Fork 7
Add test cases for issue 122 #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ea30e04 801292a 7b63e48 e7e5306 8326e49 9824bd3 00030e6 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package p; | ||
| | ||
| import java.util.HashSet; | ||
| | ||
| import edu.cuny.hunter.streamrefactoring.annotations.*; | ||
| | ||
| class A { | ||
| @EntryPoint | ||
| void m() { | ||
| HashSet h1 = new HashSet(); | ||
| h1.stream().count(); | ||
| } | ||
| | ||
| @EntryPoint | ||
| void n() { | ||
| HashSet h2 = new HashSet(); | ||
| h2.stream().count(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package p; | ||
| | ||
| import java.util.HashSet; | ||
| import java.util.stream.*; | ||
| | ||
| import edu.cuny.hunter.streamrefactoring.annotations.*; | ||
| | ||
| class A { | ||
| @EntryPoint | ||
| Stream<Object> m() { | ||
| Stream<Object> stream = new HashSet<>().parallelStream(); | ||
| return stream; | ||
| } | ||
| | ||
| @EntryPoint | ||
| void n() { | ||
| Stream<Object> s = m(); | ||
| s.count(); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package p; | ||
| | ||
| import java.util.HashSet; | ||
| | ||
| import edu.cuny.hunter.streamrefactoring.annotations.*; | ||
| | ||
| /** | ||
| * remove an annotation before m() from testMultipleEntryPoint | ||
| */ | ||
| class A { | ||
| | ||
| void m() { | ||
| HashSet h1 = new HashSet(); | ||
| h1.stream().count(); | ||
| } | ||
| | ||
| @EntryPoint | ||
| void n() { | ||
| HashSet h2 = new HashSet(); | ||
| h2.stream().count(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package p; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the purpose of this test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just follow your instruction: " For the case created above, create another case by copying the above but removing one of the @entrypoint annotations." #122 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I don't think we need a case with a dependency between the two methods. I'm unsure as to what that is going to buy us. Please let me know if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. | ||
| | ||
| import java.util.HashSet; | ||
| import java.util.stream.*; | ||
| | ||
| import edu.cuny.hunter.streamrefactoring.annotations.*; | ||
| | ||
| /** | ||
| * remove an entry point before m() from testMultipleEntryPoint1 | ||
| */ | ||
| class A { | ||
| | ||
| Stream<Object> m() { | ||
| Stream<Object> stream = new HashSet<>().parallelStream(); | ||
| return stream; | ||
| } | ||
| | ||
| @EntryPoint | ||
| void n() { | ||
| Stream<Object> s = m(); | ||
| s.count(); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test case, n() has a dependency on m(), but in the first test case, n() and m() are independent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. In an effort to reduce test time, let's keep the file but remove it from the test case.