This is an automated email from the ASF dual-hosted git repository.
lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new dca4b1f [NETBEANS-4836] - Added @RandomlyFailure annotation to
timeout and mostly failure test cases of java.hints module
dca4b1f is described below
commit dca4b1f660e06f09a9099c2b102a149a3a3b0906
Author: singhs-akhilesh <[email protected]>
AuthorDate: Tue Oct 6 07:47:37 2020 +0530
[NETBEANS-4836] - Added @RandomlyFailure annotation to timeout and mostly
failure test cases of java.hints module
---
.../java/hints/AssignResultToVariableTest.java | 61 ++--
.../modules/java/hints/HideFieldByVarTest.java | 9 +-
.../java/hints/errors/CreateMethodTest.java | 66 ++--
.../modules/java/hints/errors/ErrorHintsTest.java | 117 +++----
.../java/hints/errors/VarCompDeclarationTest.java | 23 +-
.../java/hints/introduce/IntroduceHintTest.java | 371 +++++++++++----------
6 files changed, 333 insertions(+), 314 deletions(-)
diff --git
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/AssignResultToVariableTest.java
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/AssignResultToVariableTest.java
index 15d8c49..5044cd7 100644
---
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/AssignResultToVariableTest.java
+++
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/AssignResultToVariableTest.java
@@ -27,6 +27,7 @@ import
org.netbeans.modules.java.hints.infrastructure.TreeRuleTestBase;
import org.netbeans.spi.editor.hints.ErrorDescription;
import org.netbeans.spi.editor.hints.Fix;
import org.openide.filesystems.FileObject;
+import org.netbeans.junit.RandomlyFails;
/**
*
@@ -37,15 +38,15 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
public AssignResultToVariableTest(String testName) {
super(testName);
}
-
+ @RandomlyFails
public void testDoNothingForVoidReturnType() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public void t() {get();} public void get() {}}", 51);
}
-
+ @RandomlyFails
public void testProposeHint() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public void t() {get();} public int get() {}}", 51, "0:51-0:51:hint:Assign
Return Value To New Variable");
}
-
+ @RandomlyFails
public void testApplyHintGenericType() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t()
{java.util.List<String> l = null; l.get(0);}}",
@@ -54,7 +55,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t()
{java.util.List<String> l = null; String get = l.get(0); }}");
}
-
+ @RandomlyFails
public void testApplyHintGenericType2() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t()
{java.util.List<? extends String> l = null; l.get(0);}}",
@@ -63,7 +64,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t()
{java.util.List<? extends String> l = null; String get = l.get(0); }}");
}
-
+ @RandomlyFails
public void testApplyHintGenericType3() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test<T> {public void t()
{get();} T get() {return null;}}",
@@ -72,7 +73,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test<T> {public void t() {T
get = get(); } T get() {return null;}}");
}
-
+ @RandomlyFails
public void testApplyHintGenericType4() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t()
{test();} private Iterable<? extends CharSequence> test() {return null;}}",
@@ -81,7 +82,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t()
{Iterable<? extends CharSequence> test = test(); } private Iterable<? extends
CharSequence> test() {return null;}}");
}
-
+ @RandomlyFails
public void testApplyHintGenericType5() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t()
{test();} private Iterable<? super CharSequence> test() {return null;}}",
@@ -90,7 +91,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t()
{Iterable<? super CharSequence> test = test(); } private Iterable<? super
CharSequence> test() {return null;}}");
}
-
+ @RandomlyFails
public void testApplyHintGenericType6() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;l.get(0); } }",
@@ -99,7 +100,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;Object get = l.get(0); } }");
}
-
+ @RandomlyFails
public void testCommentsCopied() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t()
{\n/*t*/get();\n} String get() {return null;}}",
@@ -108,7 +109,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t() {
/*t*/ String get = get(); } String get() {return null;}}");
}
-
+ @RandomlyFails
public void testNewClass1() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t() { new
Te|st(); } private static class Test {} }",
@@ -116,7 +117,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t() {
Test test = new Test(); } private static class Test {} }");
}
-
+ @RandomlyFails
public void testNewClass2() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t() { new
te|st(); } private static class test {} }",
@@ -124,7 +125,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t() {
test test = new test(); } private static class test {} }");
}
-
+ @RandomlyFails
public void testNewClass133825a() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t() { new
Te|st<String>(); } private static class Test<T> {}}",
@@ -132,7 +133,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t() {
Test<String> test = new Test<String>(); } private static class Test<T> {}}");
}
-
+ @RandomlyFails
public void testNewClass133825b() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t() { new
Test.In|ner(); } private static class Inner {} }",
@@ -140,7 +141,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t() {
Inner inner = new Test.Inner(); } private static class Inner {} }");
}
-
+ @RandomlyFails
public void testAnonymousClass138223() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t() { new
Run|nable() { public void run() { } }; } }",
@@ -148,7 +149,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t() { Runnable
runnable = new Runnable() { public void run() { } }; } }");
}
-
+ @RandomlyFails
public void testForgiving1() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;\n l.get(0);|\n } }",
@@ -156,7 +157,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null; Object get = l.get(0); } }");
}
-
+ @RandomlyFails
public void testForgiving2() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;\n l.get(0)|;\n } }",
@@ -164,7 +165,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null; Object get = l.get(0); } }");
}
-
+ @RandomlyFails
public void testForgiving3() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;\n |l.get(0);\n } }",
@@ -172,7 +173,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null; Object get = l.get(0); } }");
}
-
+ @RandomlyFails
public void testForgiving4() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;\n l.get(0); |\n } }",
@@ -180,7 +181,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null; Object get = l.get(0); } }");
}
-
+ @RandomlyFails
public void testForgiving5() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;\n| l.get(0);\n } }",
@@ -188,7 +189,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null; Object get = l.get(0); } }");
}
-
+ @RandomlyFails
public void testForgiving6() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;\n l.get(0); //tttt|\n } }",
@@ -196,7 +197,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null; Object get = l.get(0); //tttt } }");
}
-
+ @RandomlyFails
public void testForgiving7() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;/*\n|*/ l.get(0);\n } }",
@@ -204,22 +205,22 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; import java.util.List; public class Test
{public Test() {List<?> l = null;/* */ Object get = l.get(0); } }");
}
-
+ @RandomlyFails
public void testForgivingNegative1() throws Exception {
performAnalysisTest("test/Test.java",
"package test; import java.util.List; public class
Test {public Test() {int i = 0;i++;| } }");
}
-
+ @RandomlyFails
public void testForgivingNegative2() throws Exception {
performAnalysisTest("test/Test.java",
"package test; import java.util.List; public class
Test {public Test() {List<?> l = null;\n l.get(0);|l.get(0);\n } }");
}
-
+ @RandomlyFails
public void testForgivingNegative3() throws Exception {
performAnalysisTest("test/Test.java",
"package test; import java.util.List; public class
Test {public Test() {List<?> l = null;\n l.get(0); | l.get(0);\n } }");
}
-
+ @RandomlyFails
public void testForgivingNegative188326() throws Exception {
performAnalysisTest("test/Test.java",
"package test;\n" +
@@ -235,7 +236,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
" }\n" +
"}");
}
-
+ @RandomlyFails
public void testAddSemicolon1() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t() { new
Run|nable() { public void run() { } } } }",
@@ -243,7 +244,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t() {
Runnable runnable = new Runnable() { public void run() { } }; } }");
}
-
+ @RandomlyFails
public void testAddSemicolon2() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void t()
{java.util.List<String> l = null; l.ge|t(0) }}",
@@ -251,7 +252,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
"FixImpl",
"package test; public class Test {public void t()
{java.util.List<String> l = null; String get = l.get(0); }}");
}
-
+ @RandomlyFails
public void test197050() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
@@ -271,7 +272,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
" }\n" +
"}").replaceAll("\\s+", " "));
}
-
+ @RandomlyFails
public void test235716NewVariable() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
@@ -292,7 +293,7 @@ public class AssignResultToVariableTest extends
TreeRuleTestBase {
" }\n" +
"}").replaceAll("\\s+", " "));
}
-
+ @RandomlyFails
public void testInferBounds258167() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
diff --git
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/HideFieldByVarTest.java
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/HideFieldByVarTest.java
index 3115b7a..a37c7734 100644
---
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/HideFieldByVarTest.java
+++
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/HideFieldByVarTest.java
@@ -26,7 +26,7 @@ import org.netbeans.api.java.source.SourceUtils;
import org.netbeans.api.java.source.SourceUtilsTestUtil;
import org.netbeans.modules.java.hints.infrastructure.TreeRuleTestBase;
import org.netbeans.spi.editor.hints.ErrorDescription;
-
+import org.netbeans.junit.RandomlyFails;
/**
*
* @author Jaroslav Tulach
@@ -43,7 +43,7 @@ public class HideFieldByVarTest extends TreeRuleTestBase {
SourceUtilsTestUtil.setLookup(new Object[0],
getClass().getClassLoader());
}
-
+ @RandomlyFails
public void testDoesNotHideItself() throws Exception {
String before = "package test; class Test {" +
" protected int va";
@@ -52,7 +52,7 @@ public class HideFieldByVarTest extends TreeRuleTestBase {
performAnalysisTest("test/Test.java", before + after, before.length());
}
-
+ @RandomlyFails
public void testLocaVarAgainsInstanceVar() throws Exception {
String before = "package test; class Test {" +
" protected int value;" +
@@ -67,6 +67,7 @@ public class HideFieldByVarTest extends TreeRuleTestBase {
"0:82-0:87:verifier:Local variable hides a field"
);
}
+ @RandomlyFails
public void testLocaVarInStaticMethod() throws Exception {
String text = "package test; class Test {" +
" protected int value;" +
@@ -82,6 +83,7 @@ public class HideFieldByVarTest extends TreeRuleTestBase {
SourceUtils.waitScanFinished();
}
}
+ @RandomlyFails
public void testLocaVarAgainsInhVar() throws Exception {
String before = "package test; class Test {" +
" protected int value;" +
@@ -98,6 +100,7 @@ public class HideFieldByVarTest extends TreeRuleTestBase {
"0:109-0:114:verifier:Local variable hides a field"
);
}
+ @RandomlyFails
public void testParamIsOkAgainstInhVar() throws Exception {
String before = "package test; class Test {" +
" protected int value;" +
diff --git
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
index 04506d9..73b341d 100644
---
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
+++
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/CreateMethodTest.java
@@ -25,7 +25,7 @@ import java.util.List;
import org.netbeans.api.java.source.CompilationInfo;
import org.netbeans.modules.java.hints.infrastructure.ErrorHintsTestBase;
import org.netbeans.spi.editor.hints.Fix;
-
+import org.netbeans.junit.RandomlyFails;
/**
*
@@ -42,64 +42,64 @@ public class CreateMethodTest extends ErrorHintsTestBase {
protected int timeOut() {
return 30000;
}
-
+ @RandomlyFails
public void testMoreMethods() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public void test() {test(1);}}", 103 - 48, "CreateMethodFix:test(int
i)void:test.Test");
}
-
+ @RandomlyFails
public void testConstructor() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public static void test() {new Test(1);}}", 114 - 48,
"CreateConstructorFix:(int i):test.Test");
}
-
+ @RandomlyFails
public void testNoCreateConstructorForNonExistingClass() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public static void test() {new NonExisting(1);}}", 114 - 48);
}
-
+ @RandomlyFails
public void testFieldLike() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public void test() {Collections.emptyList();}}", 107 - 48);
}
-
+ @RandomlyFails
public void testMemberSelect1() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public void test() {emptyList().doSomething();}}", 107 - 48,
"CreateMethodFix:emptyList()java.lang.Object:test.Test");
}
-
+ @RandomlyFails
public void testMemberSelect2() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public Test test() {test().doSomething();}}", 112 - 48,
"CreateMethodFix:doSomething()void:test.Test");
}
-
+ @RandomlyFails
public void testAssignment() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public void test() {int i = fff();}}", 110 - 48,
"CreateMethodFix:fff()int:test.Test");
}
-
+ @RandomlyFails
public void testNewInAnnonymousInnerclass() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public Test(){} public void test() {new Runnable() {public void run() {new
Test(1);}}}}", 158 - 48, "CreateConstructorFix:(int i):test.Test");
}
-
+ @RandomlyFails
public void testCreateMethodInInterface() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void test()
{Int i = null; i.test(1);} public static interface Int{}}", 96 - 24,
"CreateMethodFix:test(int i)void:test.Test.Int",
"package test; public class Test {public void test()
{Int i = null; i.test(1);} public static interface Int{ public void test(int
i); }}");
}
-
+ @RandomlyFails
public void testCreateMethod106255() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void test()
{test2(null);}}", 82 - 25,
"CreateMethodFix:test2(java.lang.Object
object)void:test.Test",
"package test; public class Test {public void test()
{test2(null);} private void test2(Object object) { throw new
UnsupportedOperationException(\"Not supported yet.\"); //To change body of
generated methods, choose Tools | Templates. } }");
}
-
+ @RandomlyFails
public void testCreateMethod77038() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public void test()
{b(test2() ? true : false);} void t(boolean b){}}", 82 - 25,
"CreateMethodFix:test2()boolean:test.Test",
"package test; public class Test {public void test()
{b(test2() ? true : false);} void t(boolean b){} private boolean test2() {
throw new UnsupportedOperationException(\"Not supported yet.\"); //To change
body of generated methods, choose Tools | Templates. } }");
}
-
+ @RandomlyFails
public void testCreateMethod82923() throws Exception {
performAnalysisTest("test/Test.java", "package test; public class Test
{public void test() {int i = 0; switch (i) {case 1: fff(); break;}}}", 134 -
48, "CreateMethodFix:fff()void:test.Test");
}
-
+ @RandomlyFails
public void testCreateMethod82931() throws Exception {
performFixTest("test/Test.java",
"package test; import java.util.Collection; public
class Test {public static void test() {fff(getStrings());} private static
Collection<String> getStrings() {return null;}}",
@@ -107,7 +107,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
"CreateMethodFix:fff(java.util.Collection<java.lang.String>
strings)void:test.Test",
"package test; import java.util.Collection; public
class Test {public static void test() {fff(getStrings());} private static
Collection<String> getStrings() {return null;} private static void
fff(Collection<String> strings) { throw new UnsupportedOperationException(\"Not
supported yet.\"); //To change body of generated methods, choose Tools |
Templates. } }");
}
-
+ @RandomlyFails
public void testCreateMethod74129() throws Exception {
doRunIndexing = true;
performFixTest("test/Test.java",
@@ -115,7 +115,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
"CreateMethodFix:fff()void:test.TopLevel",
"package test; public class Test {public void test()
{TopLevel.fff();}} class TopLevel { static void fff() { throw new
UnsupportedOperationException(\"Not supported yet.\"); //To change body of
generated methods, choose Tools | Templates. } }");
}
-
+ @RandomlyFails
public void testCreateMethod76498() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {public static class T
extends Test {public void test() {super.fff();}}}",
@@ -123,7 +123,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
"CreateMethodFix:fff()void:test.Test",
"package test; public class Test { private void fff() {
throw new UnsupportedOperationException(\"Not supported yet.\"); //To change
body of generated methods, choose Tools | Templates. } public static class T
extends Test {public void test() {super.fff();}}}");
}
-
+ @RandomlyFails
public void testCreateMethod75069() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test<T> {public void test()
{this.fff();}}",
@@ -131,35 +131,35 @@ public class CreateMethodTest extends ErrorHintsTestBase {
"CreateMethodFix:fff()void:test.Test",
"package test; public class Test<T> {public void test()
{this.fff();} private void fff() { throw new
UnsupportedOperationException(\"Not supported yet.\"); //To change body of
generated methods, choose Tools | Templates. } }");
}
-
+ @RandomlyFails
public void testCreateMethod119037() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test {static {f|ff();}}",
"CreateMethodFix:fff()void:test.Test",
"package test; public class Test {static {fff();}
private static void fff() { throw new UnsupportedOperationException(\"Not
supported yet.\"); //To change body of generated methods, choose Tools |
Templates. } }");
}
-
+ @RandomlyFails
public void testCreateMethodWithAnonymousParameter104820() throws
Exception {
performFixTest("test/Test.java",
"package test;public class Test {public static void
method() {final Test ac = new Test();new Runnable() {public void run()
{ac.a|ction(this);}};}}",
"CreateMethodFix:action(java.lang.Runnable
aThis)void:test.Test",
"package test;public class Test {public static void
method() {final Test ac = new Test();new Runnable() {public void run()
{ac.action(this);}};} private void action(Runnable aThis) { throw new
UnsupportedOperationException(\"Not supported yet.\"); //To change body of
generated methods, choose Tools | Templates. } }");
}
-
+ @RandomlyFails
public void testCreateMethodWithEnumParam() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test { enum Paddle{UP,
DOWN} public void foo() {f|ff(Paddle.UP);}}",
"CreateMethodFix:fff(test.Test.Paddle
paddle)void:test.Test",
"package test; public class Test { private void
fff(Paddle paddle) { throw new UnsupportedOperationException(\"Not supported
yet.\"); //To change body of generated methods, choose Tools | Templates. }
enum Paddle{UP, DOWN} public void foo() {fff(Paddle.UP);}}");
}
-
+ @RandomlyFails
public void testCreateMethodWithParamOfEnumType199793() throws Exception {
performFixTest("test/Test.java",
"package test; public class Test { enum Paddle{UP,
DOWN} public void foo(Paddle test) {f|ff(test);}}",
"CreateMethodFix:fff(test.Test.Paddle
test)void:test.Test",
"package test; public class Test { private void
fff(Paddle test) { throw new UnsupportedOperationException(\"Not supported
yet.\"); //To change body of generated methods, choose Tools | Templates. }
enum Paddle{UP, DOWN} public void foo(Paddle test) {fff(test);}}");
}
-
+ @RandomlyFails
public void test220582() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
@@ -183,7 +183,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void test223011a() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
@@ -205,7 +205,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void test223011b() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
@@ -227,7 +227,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void test223011c() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
@@ -249,7 +249,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void test203476() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
@@ -278,7 +278,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" public static void getName(String param) { }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void test233502() throws Exception {
performFixTest("test/Test.java",
"package test;\n" +
@@ -301,7 +301,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void testMethodRefInstanceRefToInstance() throws Exception {
sourceLevel = "1.8";
performFixTest("test/Test.java",
@@ -323,7 +323,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void testMethodRefStaticRefToStatic() throws Exception {
sourceLevel = "1.8";
performFixTest("test/Test.java",
@@ -345,7 +345,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void testMethodRefStaticRefToInstance() throws Exception {
sourceLevel = "1.8";
performFixTest("test/Test.java",
@@ -375,7 +375,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void testMethodRefStaticRefToStatic2() throws Exception {
sourceLevel = "1.8";
performFixTest("test/Test.java",
@@ -405,7 +405,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void testMethodRefInstanceRefToInstance2() throws Exception {
sourceLevel = "1.8";
performFixTest("test/Test.java",
@@ -435,7 +435,7 @@ public class CreateMethodTest extends ErrorHintsTestBase {
" }\n" +
"}\n").replaceAll("[ \n\t\r]+", " "));
}
-
+ @RandomlyFails
public void testErroneousMethodRef() throws Exception {
sourceLevel = "1.8";
performAnalysisTest("test/Test.java",
diff --git
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java
index 95fb4b6..3dbeb4b 100644
---
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java
+++
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java
@@ -28,6 +28,7 @@ import
org.netbeans.modules.java.hints.infrastructure.HintsTestBase;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.NbBundle;
+import org.netbeans.junit.RandomlyFails;
/**
* @author Jan Lahoda
@@ -52,46 +53,47 @@ public class ErrorHintsTest extends HintsTestBase {
// }
//
+ @RandomlyFails
public void testImplementAbstractMethodsHint1() throws Exception {
performTest("ImplementAbstractMethods1",
"LBL_FIX_Impl_Abstract_Methods", 16, 60);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint2() throws Exception {
performTest("ImplementAbstractMethods2",
"LBL_FIX_Impl_Abstract_Methods", 17, 15);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint3() throws Exception {
performTest("ImplementAbstractMethods3",
"LBL_FIX_Impl_Abstract_Methods", 17, 25);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint4() throws Exception {
performTest("ImplementAbstractMethods4",
"LBL_FIX_Impl_Abstract_Methods", 16, 30);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint5() throws Exception {
performTest("ImplementAbstractMethods5",
"LBL_FIX_Impl_Abstract_Methods", 16, 30);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint6() throws Exception {
performTest("ImplementAbstractMethods6",
"LBL_FIX_Impl_Abstract_Methods", 8, 5);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint7() throws Exception {
performTest("ImplementAbstractMethods7",
"LBL_FIX_Impl_Abstract_Methods", 9, 25);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint8() throws Exception {
performTest("ImplementAbstractMethods8",
"LBL_FIX_Impl_Abstract_Methods", 12, 43);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint9() throws Exception {
performTestDoNotPerform("ImplementAbstractMethods9", 8, 15);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint10() throws Exception {
performTestDoNotPerform("ImplementAbstractMethods10", 8, 15);
}
-
+ @RandomlyFails
public void testImplementAbstractMethodsHint11() throws Exception {
performTest("ImplementAbstractMethods11",
"LBL_FIX_Impl_Abstract_Methods", 8, 15);
}
@@ -106,7 +108,7 @@ public class ErrorHintsTest extends HintsTestBase {
}
return result;
}
-
+ @RandomlyFails
public void testImplementDefaultMethods1() throws Exception {
ImplementGeneratorAccessor.setOverrideSelection((info, type) ->
findElementHandles(info,
@@ -116,7 +118,7 @@ public class ErrorHintsTest extends HintsTestBase {
);
performTest("ImplementDefaultMethods1", "ImplementDefaultMethods1",
"LBL_FIX_Impl_Abstract_Methods", 7, 15, true, "1.8");
}
-
+ @RandomlyFails
public void testImplementDefaultMethods2() throws Exception {
ImplementGeneratorAccessor.setOverrideSelection((info, type) -> {
assertEquals("Wrong number of default overridable methods",
@@ -129,7 +131,7 @@ public class ErrorHintsTest extends HintsTestBase {
});
performTest("ImplementDefaultMethods2", "ImplementDefaultMethods2",
"LBL_FIX_Impl_Abstract_Methods", 7, 15, true, "1.8");
}
-
+ @RandomlyFails
public void testImplementEnumMethods() throws Exception {
performTest("ImplementEnumMethods", "ImplementEnumMethods",
"LBL_FIX_Impl_Methods_Enum_Values2", 8, 11, true, "1.8");
}
@@ -138,49 +140,50 @@ public class ErrorHintsTest extends HintsTestBase {
// performTest("org.netbeans.test.java.hints.AddSemicolon",
"semicolon", 17, 15);
// }
//
+ @RandomlyFails
public void testAddCastHint1() throws Exception {
performTest("org.netbeans.test.java.hints.AddCast1", "Cast", 18, 15);
}
-
+ @RandomlyFails
public void testAddCastHint2() throws Exception {
performTest("org.netbeans.test.java.hints.AddCast2", "Cast", 20, 13);
}
-
+ @RandomlyFails
public void testAddCastHint3() throws Exception {
performTest("org.netbeans.test.java.hints.AddCast3", "Cast", 20, 20);
}
-
+ @RandomlyFails
public void testAddCastHint4() throws Exception {
performTest("org.netbeans.test.java.hints.AddCast4", "Cast", 22, 10);
}
-
+ @RandomlyFails
public void testAddCastHint5() throws Exception {
performTest("org.netbeans.test.java.hints.AddCast5", "Cast", 12, 1);
}
-
+ @RandomlyFails
public void testAddCastHint6() throws Exception {
performTest("org.netbeans.test.java.hints.AddCast6", "Cast", 13, 23);
}
-
+ @RandomlyFails
public void testAddCastHint7() throws Exception {
performTest("org.netbeans.test.java.hints.AddCast7", "Cast", 12, 18);
}
-
+ @RandomlyFails
public void testAddCastHint8() throws Exception {
performTest("org.netbeans.test.java.hints.AddCast8", "Cast", 13, 18);
}
-
+ @RandomlyFails
public void testAddCastHint9() throws Exception {
//should not cause exception
//also tests Create field hint, which should not be proposed in this
case:
performTestDoNotPerform("org.netbeans.test.java.hints.AddCast9", 11,
18);
}
-
+ @RandomlyFails
public void testAddCastHint10() throws Exception {
//should not cause exception
performTest("org.netbeans.test.java.hints.AddCast10", "Cast", 13, 18);
}
-
+ @RandomlyFails
public void testAddCastHint11() throws Exception {
performTestDoNotPerform("org.netbeans.test.java.hints.AddCast11", 12,
18);
}
@@ -191,30 +194,31 @@ public class ErrorHintsTest extends HintsTestBase {
// performTestDoNotPerform("org.netbeans.test.java.hints.AddCast12",
14, 18);
// performTestDoNotPerform("org.netbeans.test.java.hints.AddCast12",
16, 18);
// }
-
+ @RandomlyFails
public void testAddCastHintDoNotPropose() throws Exception {
//should not propose "cast to ..." hint if the actual problem is an
undefined method
performTestDoNotPerform("org.netbeans.test.java.hints.AddCastDoNotPropose", 9,
18);
}
-
+ @RandomlyFails
public void testAddThrowsClauseHint1() throws Exception {
performTest("org.netbeans.test.java.hints.AddThrowsClause1", "throws",
19, 30);
}
-
+ @RandomlyFails
public void testAddThrowsClauseHint2() throws Exception {
performTest("org.netbeans.test.java.hints.AddThrowsClause2", "throws",
22, 30);
}
-
+ @RandomlyFails
public void testAddThrowsClauseHint3() throws Exception {
performTest("org.netbeans.test.java.hints.AddThrowsClause3", "throws",
11, 30);
}
-
+ @RandomlyFails
public void testAddThrowsClauseHint4() throws Exception {
performTest("org.netbeans.test.java.hints.AddThrowsClause4", "throws",
11, 30);
}
/**tests only if an exception is thrown during hints creation of errors
for this file
*/
+ @RandomlyFails
public void testCreateElementException() throws Exception {
performTestDoNotPerform("org.netbeans.test.java.hints.CreateElementException",
10, 27);
}
@@ -229,19 +233,19 @@ public class ErrorHintsTest extends HintsTestBase {
// public void testCreateFieldException2() throws Exception {
//
performTestDoNotPerform("org.netbeans.test.java.hints.CreateFieldException2",
8, 15);
// }
-
+ @RandomlyFails
public void testCreateFieldException3() throws Exception {
performTestDoNotPerform("org.netbeans.test.java.hints.CreateFieldException3",
9, 15);
}
-
+ @RandomlyFails
public void testCreateField1() throws Exception {
performTest("org.netbeans.test.java.hints.CreateField1", "Field", 23,
18);
}
-
+ @RandomlyFails
public void testCreateField2() throws Exception {
performTest("org.netbeans.test.java.hints.CreateField2", "Field", 23,
20);
}
-
+ @RandomlyFails
public void testCreateField3() throws Exception {
performTest("org.netbeans.test.java.hints.CreateField3", "Field", 23,
20);
}
@@ -249,15 +253,15 @@ public class ErrorHintsTest extends HintsTestBase {
// public void testCreateField4() throws Exception {
// performTest("org.netbeans.test.java.hints.CreateField4", "Field",
23, 20);
// }
-
+ @RandomlyFails
public void testCreateField5() throws Exception {
performTest("org.netbeans.test.java.hints.CreateField5", "Field", 23,
18);
}
-
+ @RandomlyFails
public void testCreateField6() throws Exception {
performTest("org.netbeans.test.java.hints.CreateField6", "Field", 25,
18);
}
-
+ @RandomlyFails
public void testCreateField7() throws Exception {
performTestDoNotPerform("org.netbeans.test.java.hints.CreateField7",
9, 18);
}
@@ -266,11 +270,11 @@ public class ErrorHintsTest extends HintsTestBase {
// public void testCreateField8() throws Exception {
// performTest("org.netbeans.test.java.hints.CreateField8", "Field", 6,
18);
// }
-
+ @RandomlyFails
public void testCreateField10() throws Exception {
performTest("org.netbeans.test.java.hints.CreateField10", "Field", 9,
10);
}
-
+ @RandomlyFails
public void testCreateFieldPrimitive() throws Exception {
performTest("org.netbeans.test.java.hints.CreateFieldPrimitive",
"Field", 23, 13);
}
@@ -278,7 +282,7 @@ public class ErrorHintsTest extends HintsTestBase {
// public void testCreateFieldMethod1() throws Exception {
// performTest("org.netbeans.test.java.hints.CreateFieldMethod1",
"Field", 23, 13);
// }
-
+ @RandomlyFails
public void testCreateFieldMethod2() throws Exception {
performTest("org.netbeans.test.java.hints.CreateFieldMethod2",
"Field", 23, 13);
}
@@ -287,6 +291,7 @@ public class ErrorHintsTest extends HintsTestBase {
//
performTestDoNotPerform("org.netbeans.test.java.hints.DoNotProposeCreateField1",9,
18);
// }
//
+ @RandomlyFails
public void testDoNotProposeCreateField2() throws Exception {
performTestDoNotPerform("org.netbeans.test.java.hints.DoNotProposeCreateField2",
7, 10);
}
@@ -330,7 +335,7 @@ public class ErrorHintsTest extends HintsTestBase {
// public void testLocalAndParamIncorrect57990c() throws Exception {
//
performTestDoNotPerform("org.netbeans.test.java.hints.LocalVarParam57990c", 23,
20);
// }
-
+ @RandomlyFails
public void testCreateLocalVariable1() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable1",
"Local Variable", 23, 15);
}
@@ -338,55 +343,55 @@ public class ErrorHintsTest extends HintsTestBase {
// public void testCreateLocalVariable2() throws Exception {
// performTest("org.netbeans.test.java.hints.CreateLocalVariable2",
"Local", 19, 20);
// }
-
+ @RandomlyFails
public void testCreateLocalVariable3() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable3",
"Local Variable ", 20, 20);
}
-
+ @RandomlyFails
public void testCreateLocalVariable4() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable4",
"Local Variable", 8, 18);
}
-
+ @RandomlyFails
public void testCreateLocalVariable5() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable5",
"Local Variable", 8, 18);
}
-
+ @RandomlyFails
public void testCreateLocalVariable6() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable6",
"Local Variable", 8, 18);
}
-
+ @RandomlyFails
public void testCreateLocalVariable7() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable7",
"Local Variable", 10, 18);
}
-
+ @RandomlyFails
public void testCreateLocalVariable8() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable8",
"Local Variable", 9, 18);
}
-
+ @RandomlyFails
public void testCreateLocalVariable9() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable9",
"Local Variable", 11, 18);
}
-
+ @RandomlyFails
public void testCreateLocalVariable10() throws Exception {
performTest("org.netbeans.test.java.hints.CreateLocalVariable10",
"Local Variable", 10, 18);
}
-
+ @RandomlyFails
public void testCreateParam1() throws Exception {
performTest("org.netbeans.test.java.hints.CreateParam1", "Parameter",
23, 15);
}
-
+ @RandomlyFails
public void testCreateParam2() throws Exception {
performTest("org.netbeans.test.java.hints.CreateParam2", "Parameter",
20, 15);
}
-
+ @RandomlyFails
public void testCreateParam3() throws Exception {
performTest("org.netbeans.test.java.hints.CreateParam3", "Parameter",
20, 15);
}
-
+ @RandomlyFails
public void testCreateParam4() throws Exception {
performTest("org.netbeans.test.java.hints.CreateParam4", "Parameter",
9, 15);
}
-
+ @RandomlyFails
public void testCreateParam5() throws Exception {
performTest("org.netbeans.test.java.hints.CreateParam5", "Parameter",
10, 15);
}
@@ -466,19 +471,19 @@ public class ErrorHintsTest extends HintsTestBase {
// public void testInitializeVariable3() throws Exception {
// performTest("org.netbeans.test.java.hints.InitializeVariable3",
"Initialize", 10, 1);
// }
-
+ @RandomlyFails
public void testNonAbstractClass85806() throws Exception {
performTestDoNotPerform("org.netbeans.test.java.hints.AbstractClass4",
8, 1);
}
-
+ @RandomlyFails
public void testMakeClassAbstract1() throws Exception {
performTest("org.netbeans.test.java.hints.MakeClassAbstract1",
"LBL_FIX_Make_Class_Abstract", 3, 1);
}
-
+ @RandomlyFails
public void testMakeClassAbstract2() throws Exception {
performTest("org.netbeans.test.java.hints.MakeClassAbstract2",
"LBL_FIX_Make_Class_Abstract", 3, 1);
}
-
+ @RandomlyFails
public void testMakeClassAbstract3() throws Exception {
performTest("org.netbeans.test.java.hints.MakeClassAbstract3",
"LBL_FIX_Make_Class_Abstract", 3, 1);
}
diff --git
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/VarCompDeclarationTest.java
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/VarCompDeclarationTest.java
index a882087..a99b919 100644
---
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/VarCompDeclarationTest.java
+++
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/VarCompDeclarationTest.java
@@ -26,6 +26,7 @@ import
org.netbeans.modules.java.hints.infrastructure.ErrorHintsTestBase;
import org.netbeans.modules.java.source.parsing.JavacParser;
import org.netbeans.spi.editor.hints.Fix;
import org.openide.util.NbBundle;
+import org.netbeans.junit.RandomlyFails;
/**
* Test cases for handing the 'var' compound declaration errors.
@@ -43,7 +44,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
sourceLevel = "1.10";
JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = true;
}
-
+ @RandomlyFails
public void testCase1() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -62,7 +63,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" } \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase2() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -82,7 +83,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" } \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase3() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -101,7 +102,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" } \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase4() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -121,7 +122,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" } \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase5() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -150,7 +151,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" } \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase6() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -168,7 +169,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" var v1 = 11;} \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase7() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -186,7 +187,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" @DA final var y = 11;} \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase8() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -205,7 +206,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" } \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase9() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -232,7 +233,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" } \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase10() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
@@ -259,7 +260,7 @@ public class VarCompDeclarationTest extends
ErrorHintsTestBase {
" } \n" +
"}").replaceAll("[\\s]+", " "));
}
-
+ @RandomlyFails
public void testCase11() throws Exception {
performFixTest("test/Test.java",
"package test; \n" +
diff --git
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java
index 7cee892..b2169f7 100644
---
a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java
+++
b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java
@@ -60,6 +60,7 @@ import org.openide.filesystems.FileUtil;
import org.openide.loaders.DataObject;
import org.openide.util.NbPreferences;
import org.openide.util.lookup.ServiceProvider;
+import org.netbeans.junit.RandomlyFails;
/**
*
@@ -103,70 +104,70 @@ public class IntroduceHintTest extends NbTestCase {
info = null;
doc = null;
}
-
+ @RandomlyFails
public void testCorrectSelection1() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {int i = 3;}}", 110 - 49, 111 - 49, true);
}
-
+ @RandomlyFails
public void testCorrectSelection2() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test(int i) {|i = 3;|}}", false);
}
-
+ @RandomlyFails
public void testCorrectSelection3() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {int z = 0; int i = z + 2;}}", 121 - 49, 124 - 49,
false);
}
-
+ @RandomlyFails
public void testCorrectSelection4() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {int y = 3; System.err.println((\"x=\" +
y).length());}}", 83, 102, true);
}
-
+ @RandomlyFails
public void testCorrectSelection5() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {int y = 3; System.err.println((\"x=\" +
y).length());}}", 64, 103, false);
}
-
+ @RandomlyFails
public void testCorrectSelection6() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {int y = 3; System.err.println((\"x=\" +
y).length());}}", 64, 104, false);
}
-
+ @RandomlyFails
public void testCorrectSelection7() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {int y = 3; y = 2;}}", 64, 69, false);
}
-
+ @RandomlyFails
public void testCorrectSelection8() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {int y = (int)Math.round(1.2);}}", 111 - 49, 114 - 49,
false);
}
-
+ @RandomlyFails
public void testCorrectSelection9() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {long y = Math.round(1.2);}}", 111 - 49, 126 - 49,
true);
}
-
+ @RandomlyFails
public void testCorrectSelection10() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {String s = \"\"; int y = s.length();}}", 125 - 49,
135 - 49, true);
}
-
+ @RandomlyFails
public void testCorrectSelection11() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {System.err.println();}}", 102 - 49, 120 - 49, false);
}
-
+ @RandomlyFails
public void testCorrectSelection12() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test(|String|[] s) {}}", false);
}
-
+ @RandomlyFails
public void testCorrectSelection13() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {new |Object|();}}", false);
}
-
+ @RandomlyFails
public void test121420() throws Exception {
performFixTest("package test; import java.util.ArrayList; public class
Test {public void test() { |new ArrayList<String>()|; }}", "package test;
import java.util.ArrayList; public class Test {public void test() {
ArrayList<String> arrayList = new ArrayList<String>(); }}", new
DialogDisplayerImpl(null, false, false, true), 5, 0);
}
-
+ @RandomlyFails
public void test142424() throws Exception {
performFixTest("package test; public class Test {private static void
bar(int i) {} public void test() {new Runnable() {public void run() {String foo
= \"foo\";bar(|foo.length()|);}}.run();}}",
"package test; public class Test {private static void
bar(int i) {} public void test() {new Runnable() {public void run() {String foo
= \"foo\";int length = foo.length(); bar(length);}}.run();}}",
new DialogDisplayerImpl(null, false, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix1() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3; int x = y + 9;}}",
72, 77,
@@ -174,7 +175,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, false, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix2() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3; int x = y + 9;}}",
72, 77,
@@ -182,7 +183,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("nueName", false, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix3() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3; int x = y + 9; x = y + 9;}}",
72, 77,
@@ -190,7 +191,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, false, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix4() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3; int x = y + 9; x = y + 9;}}",
72, 77,
@@ -198,7 +199,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix5() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3; int x = y + 9; x = y + 9;}}",
108 - 25, 113 - 25,
@@ -206,7 +207,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix6() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3; int x = y + 9; x = y + 9;}}",
108 - 25, 113 - 25,
@@ -214,7 +215,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, true, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix7() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3; if (true) y = y + 9; y = y + 9;}}",
103 - 25, 108 - 25,
@@ -222,7 +223,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, false, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix8() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3; if (true) y = y + 9; y = y + 9;}}",
114 - 25, 119 - 25,
@@ -230,7 +231,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix9() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 8 + 9;} public void test2() { int y = 8 + 9;}}",
86 - 25, 91 - 25,
@@ -238,7 +239,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, false, true),
5, 0);
}
-
+ @RandomlyFails
public void testFix10() throws Exception {
performFixTest("package test; public class Test {public void test(int
y) {while (y != 7) {y = 3 + 4;} y = 3 + 4;}}",
115 - 25, 120 - 25,
@@ -246,28 +247,28 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, false, true),
5, 0);
}
-
+ @RandomlyFails
public void testFix11() throws Exception {
performFixTest("package test; import java.util.List; public class Test
{public void test1() {List<? extends CharSequence> l = |test()|;} public List<?
extends CharSequence> test() {return null;}}",
"package test; import java.util.List; public class Test
{public void test1() {List<? extends CharSequence> name = test(); List<?
extends CharSequence> l = name;} public List<? extends CharSequence> test()
{return null;}}",
new DialogDisplayerImpl("name", true, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix12() throws Exception {
performFixTest("package test; import java.util.List; public class Test
{public void test1() {List<? extends CharSequence> l = null; CharSequence c =
|l.get(0)|;} }",
"package test; import java.util.List; public class Test
{public void test1() {List<? extends CharSequence> l = null; CharSequence name
= l.get(0); CharSequence c = name;} }",
new DialogDisplayerImpl("name", true, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix126460() throws Exception {
performFixTest("package test; import java.util.List; public class Test
{public void test1() {List<String> l = null; assert |l.get(0)| == null;} }",
"package test; import java.util.List; public class Test
{public void test1() {List<String> l = null; String name = l.get(0); assert
name == null;} }",
new DialogDisplayerImpl("name", true, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix126269() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -296,7 +297,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("name", true, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFix180164() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -320,7 +321,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("name", true, false, true),
4, 0);
}
-
+ @RandomlyFails
public void testFixNewClassTree179766() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -337,7 +338,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("name", true, false, true),
5, 0);
}
-
+ @RandomlyFails
public void testSwitchCase219714() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -363,7 +364,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("name", true, false, true),
4, 0);
}
-
+ @RandomlyFails
//note the comment assignment done for this test in prepareTest
public void testCommentVariable() throws Exception {
performFixTest("package test;\n" +
@@ -394,42 +395,43 @@ public class IntroduceHintTest extends NbTestCase {
// new DialogDisplayerImpl("name", true, null, true),
// 2, 0);
// }
+ @RandomlyFails
public void testSimple4() throws Exception {
performSimpleSelectionVerificationTest("package test; import
java.util.ArrayList; public class Test {public void test() {Object o = new
ArrayList<String>();}}", 141 - 49, 164 - 49, true);
}
-
+ @RandomlyFails
public void testConstant1() throws Exception {
performConstantAccessTest("package test; public class Test {public
void test() {int i = 1 + 2;}}", 97 - 36, 102 - 36, true);
}
-
+ @RandomlyFails
public void testConstant2() throws Exception {
performConstantAccessTest("package test; public class Test {private
int i = 0; public void test() {int x = 1 + i;}}", 116 - 36, 121 - 36, false);
}
-
+ @RandomlyFails
public void testConstant3() throws Exception {
performConstantAccessTest("package test; public class Test {private
static int i = 0; public void test() {int x = 1 + i;}}", 123 - 36, 128 - 36,
false);
}
-
+ @RandomlyFails
public void testConstant4() throws Exception {
performConstantAccessTest("package test; public class Test {private
final int i = 0; public void test() {int x = 1 + i;}}", 122 - 36, 127 - 36,
false);
}
-
+ @RandomlyFails
public void testConstant5() throws Exception {
performConstantAccessTest("package test; public class Test {private
static final int i = 0; public void test() {int x = 1 + i;}}", 129 - 36, 134 -
36, true);
}
-
+ @RandomlyFails
public void testConstant187444a() throws Exception {
performConstantAccessTest("package test; public class Test {private
static final double i = |-2.4|;}", true);
}
-
+ @RandomlyFails
public void testConstant187444b() throws Exception {
performConstantAccessTest("package test; public class Test {private
static final int i = |~(2 + 4)|;}", true);
}
-
+ @RandomlyFails
public void testConstant187444c() throws Exception {
performConstantAccessTest("package test; public class Test {int y = 1;
private final int i = |~(2 + y)|; }", false);
}
-
+ @RandomlyFails
public void testConstantFix1() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3 + 4;}}",
86 - 25, 91 - 25,
@@ -437,7 +439,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, false, null, true),
5, 1);
}
-
+ @RandomlyFails
public void testConstantFixNoVariable() throws Exception {
performFixTest("package test; public class Test { int y = 3 + 4;}",
67 - 25, 72 - 25,
@@ -445,7 +447,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, false, null, true),
1, 0);
}
-
+ @RandomlyFails
public void testConstantFix2() throws Exception {
performFixTest("package test; public class Test { int y = 3 + 4; int z
= 3 + 4;}",
67 - 25, 72 - 25,
@@ -453,7 +455,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, null, true),
1, 0);
}
-
+ @RandomlyFails
public void testConstantFix106490a() throws Exception {
performFixTest("package test; public class Test { int y = 3 + 4; int z
= 3 + 4;}",
67 - 25, 72 - 25,
@@ -462,7 +464,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PUBLIC)),
1, 0);
}
-
+ @RandomlyFails
public void testConstantFix106490b() throws Exception {
performFixTest("package test; public class Test { int y = 3 + 4; int z
= 3 + 4;}",
67 - 25, 72 - 25,
@@ -471,7 +473,7 @@ public class IntroduceHintTest extends NbTestCase {
.noneOf(Modifier.class)),
1, 0);
}
-
+ @RandomlyFails
public void testConstantFix130938() throws Exception {
performFixTest("package test;import java.util.logging.Level;import
java.util.logging.Logger;public class Test {public void foo() {
Logger.getLogger(Test.class.getName()).log(Level.FINEST, \"foo\");}}",
140 - 25,
@@ -481,13 +483,13 @@ public class IntroduceHintTest extends NbTestCase {
.noneOf(Modifier.class)),
5, 1);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix1() throws Exception {
performCheckFixesTest("package test; public class Test {int y = 3 + 4;
int z = 3 + 4;}",
73 - 32, 78 - 32,
"[IntroduceFix:NAME:2:CREATE_CONSTANT]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix2() throws Exception {
performCheckFixesTest("package test; public class Test {public void
test() {int y = 3 + 4; int z = 3 + 4;}}",
93 - 32, 98 - 32,
@@ -497,7 +499,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix3() throws Exception {
performCheckFixesTest("package test; public class Test {public void
test() {int y = 3 + 4; int z = 3 + 4;} public void test2() {int u = 3 + 4;}}",
93 - 32, 98 - 32,
@@ -507,7 +509,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix4() throws Exception {
performCheckFixesTest("package test; public class Test {public void
test() {int u = 0; int y = u + 4; int z = u + 4;} public void test2() {int u =
0; int a = u + 4;}}",
104 - 32, 109 - 32,
@@ -516,7 +518,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix5() throws Exception {
performCheckFixesTest("package test; public class Test {int u = 0;
public void test() {int y = u + 4; int z = u + 4;} public void test2() {int a =
u + 4;}}",
104 - 32, 109 - 32,
@@ -525,7 +527,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix7() throws Exception {
performCheckFixesTest("package test; public class Test {public void
test() {int u = 0; int y = u + 4; int z = u + 4;}}",
104 - 32, 109 - 32,
@@ -534,7 +536,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix8() throws Exception {
performCheckFixesTest("package test; public class Test {int u = 0;
public void test() {int y = u + 4; int z = u + 4;}}",
104 - 32, 109 - 32,
@@ -543,7 +545,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix9() throws Exception {
performCheckFixesTest("package test; public class Test {int u = 0;
public void test() {int y = u + 4; int z = u + 4;} private int i = 4;}",
108 - 32, 109 - 32,
@@ -553,7 +555,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix10() throws Exception {
performCheckFixesTest("package test; public class Test {static int u =
0; public static void test() {int y = u + 4; int z = u + 4;}}",
118 - 32, 123 - 32,
@@ -562,7 +564,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix11() throws Exception {
performCheckFixesTest("package test; public class Test {public Test()
{int y = 3 + 4; int z = 3 + 4;}}",
88 - 32, 93 - 32,
@@ -572,7 +574,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix12() throws Exception {
performCheckFixesTest("package test; public class Test {public Test()
{int y = 3 + 4; int z = 3 + 4;} public Test(int i) {}}",
88 - 32, 93 - 32,
@@ -582,7 +584,7 @@ public class IntroduceHintTest extends NbTestCase {
"[IntroduceExpressionBasedMethodFix]",
"[Introduce Parameter Fix]");
}
-
+ @RandomlyFails
public void testIntroduceFieldFix13() throws Exception {
performFixTest("package test; public class Test {public Test() {int y
= 3 + 4; int z = 3 + 4;} public Test(int i) {}}",
88 - 32, 93 - 32,
@@ -591,7 +593,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix14() throws Exception {
performFixTest("package test; public class Test {public Test() {int y
= 3 + 4; int z = 3 + 4;} public Test(int i) {}}",
88 - 32, 93 - 32,
@@ -600,7 +602,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix15() throws Exception {
performFixTest("package test; public class Test {public Test() {int y
= 3 + 4; int z = 3 + 4;} public Test(int i) {}}",
88 - 32, 93 - 32,
@@ -609,7 +611,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix16() throws Exception {
performFixTest("package test; public class Test {public Test() {int y
= 3 + 4; int z = 3 + 4;} public Test(int i) {}}",
88 - 32, 93 - 32,
@@ -618,7 +620,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix17() throws Exception {
performFixTest("package test; public class Test {public Test() {int y
= 3 + 4; int z = 3 + 4;} public Test(int i) {}}",
88 - 32, 93 - 32,
@@ -627,7 +629,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix18() throws Exception {
performFixTest("package test; public class Test {public Test() {int y
= 3 + 4; int z = 3 + 4;} public Test(int i) {}}",
88 - 32, 93 - 32,
@@ -636,7 +638,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PUBLIC), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix19() throws Exception {
performFixTest("package test; public class Test {public Test() {int y
= 3 + 4; int z = 3 + 4;} public Test(int i) {}}",
88 - 32, 93 - 32,
@@ -645,7 +647,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PUBLIC), true, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix20() throws Exception {
performFixTest("package test; public class Test {public void test() {
int y = 3 + 4; int z = 3 + 4;}}",
87 - 25, 92 - 25,
@@ -654,7 +656,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testFix21() throws Exception {
performFixTest("package test; import java.util.List; public class Test
{public void test1() {List<? extends CharSequence> l = |test()|;} public List<?
extends CharSequence> test() {return null;}}",
"package test; import java.util.List; public class Test
{ private List<? extends CharSequence> name; public void test1() {name =
test(); List<? extends CharSequence> l = name;} public List<? extends
CharSequence> test() {return null;}}",
@@ -662,7 +664,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
4, 1);
}
-
+ @RandomlyFails
public void testFix22() throws Exception {
performFixTest("package test; import java.util.List; public class Test
{public void test1() {List<? extends CharSequence> l = null; CharSequence c =
|l.get(0)|;} }",
"package test; import java.util.List; public class Test
{ private CharSequence name; public void test1() {List<? extends CharSequence>
l = null; name = l.get(0); CharSequence c = name;} }",
@@ -670,7 +672,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
4, 1);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix114350() throws Exception {
performFixTest("package test; public class Test {\n" +
" public Test() {\n" +
@@ -686,7 +688,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix114360() throws Exception {
performFixTest("package test; public enum Test {\n" +
" A;\n" +
@@ -699,7 +701,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix120271() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -718,6 +720,7 @@ public class IntroduceHintTest extends NbTestCase {
*
* @throws java.lang.Exception
*/
+ @RandomlyFails
public void testIntroduceFieldFix106495() throws Exception {
performFixTest("package test; public class Test {public Test() {int y
= 3 + 4; int z = 3 + 4;} public Test(int i) {} public static void a() {int y =
3 + 4;}}",
88 - 32, 93 - 32,
@@ -726,7 +729,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE, Modifier.STATIC), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix213972() throws Exception {
performFixTest("package test; public class Test {public void test1()
{|int i = 3;|} public void test2() {int i = 3;}}",
"package test; public class Test { private int i = 3;
public void test1() {} public void test2() {int i = 3;}}",
@@ -734,7 +737,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
3, 1);
}
-
+ @RandomlyFails
public void testIntroduceFieldFixNewClassTree179766() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -752,31 +755,31 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testCorrectMethodSelection1() throws Exception {
performStatementSelectionVerificationTest("package test; public class
Test {public void test() {int i = 3;}}", 105 - 52, 115 - 52, true, new int[]{0,
0});
}
-
+ @RandomlyFails
public void testCorrectMethodSelection2() throws Exception {
performStatementSelectionVerificationTest("package test; public class
Test {public void test() {int i = 3; i += 2; i += 3;}}", 116 - 52, 123 - 52,
true, new int[]{1, 1});
}
-
+ @RandomlyFails
public void testCorrectMethodSelection3() throws Exception {
performStatementSelectionVerificationTest("package test; public class
Test {public void test() {int i = 3; i += 2; i += 3;}}", 116 - 52, 125 - 52,
true, new int[]{1, 1});
}
-
+ @RandomlyFails
public void testCorrectMethodSelection4() throws Exception {
performStatementSelectionVerificationTest("package test; public class
Test {public void test() {Object o = null;}}", 108 - 52, 121 - 52, false, new
int[]{0, 0});
}
-
+ @RandomlyFails
public void testCorrectMethodSelection5() throws Exception {
performStatementSelectionVerificationTest("package test; public class
Test {public void test() {Object o = null;}}", 105 - 52, 105 - 52, false, new
int[]{0, 0});
}
-
+ @RandomlyFails
public void testCorrectMethodSelection6() throws Exception {
performStatementSelectionVerificationTest("package test; public class
Test {public void test() { Object o = null;}}", 107 - 52, 107 - 52,
false, new int[]{0, 0});
}
-
+ @RandomlyFails
public void testIntroduceMethodFix1() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3 + 4; int z = 3 + 4;}}",
78 - 25, 92 - 25,
@@ -784,7 +787,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
3, 2);
}
-
+ @RandomlyFails
public void testIntroduceMethodFix2() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3 + 4; int z = y + 4;}}",
93 - 25, 107 - 25,
@@ -792,21 +795,21 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
2, 1);
}
-
+ @RandomlyFails
public void testIntroduceMethodFix3() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3 + 4; y += 4; int z = y + 4;}}",
93 - 25, 100 - 25,
"package test; public class Test {public void test()
{int y = 3 + 4; y = name(y); int z = y + 4;} private int name(int y) { y += 4;
return y; } }",
new DialogDisplayerImpl3("name", null, true));
}
-
+ @RandomlyFails
public void testIntroduceMethodFix4() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3 + 4; y += 4; int a = 4; int z = y + a;}}",
93 - 25, 111 - 25,
null,
new DialogDisplayerImpl3("name", null, true), 0, -1);
}
-
+ @RandomlyFails
public void testIntroduceMethodFix5() throws Exception {
performFixTest("package test; public class Test {public void test()
{int y = 3 + 4; int a = y + 4; int z = y + a;}}",
93 - 25, 107 - 25,
@@ -814,14 +817,14 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
2, 1);
}
-
+ @RandomlyFails
public void testIntroduceMethodFix6() throws Exception {
performFixTest("package test; import java.io.IOException; public class
Test {public void test() throws IOException {int y = 3 + 4; throw new
IOException();}}",
140 - 25, 164 - 25,
"package test; import java.io.IOException; public class
Test {public void test() throws IOException {int y = 3 + 4; name(); } private
void name() throws IOException { throw new IOException(); } }",
new DialogDisplayerImpl3("name", null, true));
}
-
+ @RandomlyFails
public void testIntroduceMethodFix7() throws Exception {
performFixTest("package test; import java.io.IOException; public class
Test {public void test() {while (true) {int y = 3 + 4;}}}",
120 - 25, 134 - 25,
@@ -829,42 +832,42 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
3, 2);
}
-
+ @RandomlyFails
public void testIntroduceMethodFix8() throws Exception {
performFixTest("package test; import java.io.IOException; public class
Test {public void test(int y) {while (true) {if (--y <= 0) break;}}}",
125 - 25, 145 - 25,
"package test; import java.io.IOException; public class
Test {public void test(int y) {while (true) {if (name(y)) break;}} private
boolean name(int y) { if (--y <= 0) { return true; } return false; } }",
new DialogDisplayerImpl3("name", null, true));
}
-
+ @RandomlyFails
public void testIntroduceMethodFix9() throws Exception {
performErrorMessageTest("package test; import java.io.IOException;
public class Test {public void test(int y) {while (true) {if (--y <= 0) {y = 3;
break;}} int u = y;}}",
134 - 34, 163 - 34,
IntroduceKind.CREATE_METHOD,
"ERR_Too_Many_Return_Values");
}
-
+ @RandomlyFails
public void testIntroduceMethodFix10() throws Exception {
performFixTest("package test; import java.io.IOException; public class
Test {public void test(int y) {while (true) {if (--y <= 0) { y = 2; break; }
else { y = 3; break; }} int u = y;}}",
125 - 25, 179 - 25,
"package test; import java.io.IOException; public class
Test {public void test(int y) {while (true) {y = name(y); break; } int u = y;}
private int name(int y) { if (--y <= 0) { y = 2; return y; } else { y = 3;
return y; } } }",
new DialogDisplayerImpl3("name", null, true));
}
-
+ @RandomlyFails
public void testIntroduceMethodFix11() throws Exception {
performFixTest("package test; import java.io.IOException; public class
Test {public void test(int y) {while (true) {if (--y <= 0) { break; } else {
break; }}}}",
125 - 25, 165 - 25,
"package test; import java.io.IOException; public class
Test {public void test(int y) {while (true) {name(y); break; }} private void
name(int y) { if (--y <= 0) { return; } else { return; } } }",
new DialogDisplayerImpl3("name", null, true));
}
-
+ @RandomlyFails
public void testIntroduceMethodFix12() throws Exception {
performFixTest("package test; public class Test {public int test(int
y) {while (true) {if (--y <= 0) { return 1; } else { return 2; }}}}",
96 - 25, 142 - 25,
"package test; public class Test {public int test(int
y) {while (true) {return name(y); }} private int name(int y) { if (--y <= 0) {
return 1; } else { return 2; } } }",
new DialogDisplayerImpl3("name", null, true));
}
-
+ @RandomlyFails
public void testIntroduceMethodPosition() throws Exception {
performFixTest("package test; public class Test {public void foo() {
int i = 1; } public void foo1() {}}", 78 - 25, 88 - 25,
"package test; public class Test {public void foo() {
name(); } public void foo1() {} private void name() { int i = 1; } }",
@@ -887,21 +890,21 @@ public class IntroduceHintTest extends NbTestCase {
"package test; public class Test {public void test(int
y) {if (3 != 4) return ;}}",
new DialogDisplayerImpl3("name", null, true));
}
-
+ @RandomlyFails
public void testIntroduceMethodFixNeverEnds1() throws Exception {
performFixTest("package test; public class Test {} ",
60 - 25, 61 - 25,
null,
new DialogDisplayerImpl(null, null, null, false));
}
-
+ @RandomlyFails
public void testIntroduceMethodFixNeverEnds2() throws Exception {
performFixTest(" package test; public class Test {}",
26 - 25, 28 - 25,
null,
new DialogDisplayerImpl(null, null, null, false));
}
-
+ @RandomlyFails
public void testIntroduceMethodFix106490a() throws Exception {
performFixTest("package test; public class Test {public int test(int
y) {while (true) {if (--y <= 0) { return 1; } else { return 2; }}}}",
96 - 25, 142 - 25,
@@ -909,7 +912,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PUBLIC), true));
}
-
+ @RandomlyFails
public void testIntroduceMethodFix106490b() throws Exception {
performFixTest("package test; public class Test {public int test(int
y) {while (true) {if (--y <= 0) { return 1; } else { return 2; }}}}",
96 - 25, 142 - 25,
@@ -917,7 +920,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.noneOf(Modifier.class), true));
}
-
+ @RandomlyFails
public void testIntroduceMethodFixStatic() throws Exception {
performFixTest("package test; public class Test {public static int
test(int y) {y += 5; return y;}}",
89 - 25, 96 - 25,
@@ -929,48 +932,49 @@ public class IntroduceHintTest extends NbTestCase {
/**
* Return statement inside anonymous class should not be considered
*/
+ @RandomlyFails
public void testIntroduceMethodFix132434() throws Exception {
performFixTest("package test;import java.awt.event.MouseAdapter;import
java.awt.event.MouseEvent;import javax.swing.JPanel;public class Test {public
static void main(String[] args) {JPanel p = new
JPanel();|p.addMouseListener(new MouseAdapter() { public void
mousePressed(MouseEvent e) { if (e.getX() > 100) { return; } else {
System.out.println(e.getX()); } } });|}}",
"package test;import java.awt.event.MouseAdapter;import
java.awt.event.MouseEvent;import javax.swing.JPanel;public class Test {public
static void main(String[] args) {JPanel p = new JPanel();foo(p);} private
static void foo(JPanel p) { p.addMouseListener(new MouseAdapter() { public void
mousePressed(MouseEvent e) { if (e.getX() > 100) { return; } else {
System.out.println(e.getX()); } } }); } }",
new DialogDisplayerImpl3("foo", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod109663a() throws Exception {
performErrorMessageTest("package test; public class Test {public
static void test(int y) {while (y < 10) {if (y == 0) break; else y++; int u =
y;}}}",
106 - 25, 134 - 25,
IntroduceKind.CREATE_METHOD,
"ERR_Too_Many_Return_Values");
}
-
+ @RandomlyFails
public void testIntroduceMethod109663b() throws Exception {
performErrorMessageTest("package test; public class Test {public
static void test(int y) {while (y < 10) {if (y == 0) break; else y++;}}}",
106 - 25, 134 - 25,
IntroduceKind.CREATE_METHOD,
"ERR_Too_Many_Return_Values");
}
-
+ @RandomlyFails
public void testIntroduceMethod109663c() throws Exception {
performErrorMessageTest("package test; public class Test {public
static void test(int y) {do {if (y == 0) break; else y++;} while (y < 10); }}",
103 - 34, 131 - 34,
IntroduceKind.CREATE_METHOD,
"ERR_Too_Many_Return_Values");
}
-
+ @RandomlyFails
public void testIntroduceMethod109663d() throws Exception {
performErrorMessageTest("package test; public class Test {public
static void test(int y) {for ( ; y < 10; ) {if (y == 0) break; else y++;}}}",
118 - 34, 146 - 34,
IntroduceKind.CREATE_METHOD,
"ERR_Too_Many_Return_Values");
}
-
+ @RandomlyFails
public void testIntroduceMethod109663e() throws Exception {
performErrorMessageTest("package test; public class Test {public
static void test(int y) {for ( ; ; y++) {if (y == 0) break; else y++;}}}",
115 - 34, 143 - 34,
IntroduceKind.CREATE_METHOD,
"ERR_Too_Many_Return_Values");
}
-
+ @RandomlyFails
public void testIntroduceMethod109663f() throws Exception {
performFixTest("package test; public class Test {public static void
test(int y) {for (int u = y ; ; ) {if (y == 0) break; else y++;}}}",
112 - 25, 140 - 25,
@@ -978,7 +982,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod109663g() throws Exception {
performFixTest("package test; public class Test {public static void
test(int y) {for (Integer i : java.util.Arrays.asList(y)) {if (y == 0) break;
else y++;}}}",
136 - 25, 164 - 25,
@@ -986,12 +990,12 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void test107689() throws Exception {
performSimpleSelectionVerificationTest("package test; import
java.util.List; public class Test {}",
53 - 32, 67 - 32, false);
}
-
+ @RandomlyFails
public void testIntroduceMethod112552a() throws Exception {
performFixTest("package test; public class Test {public static void
t() {boolean first = true; while (true) {if (first) {first = false;} else
{break;}}}}",
130 - 25, 144 - 25,
@@ -999,7 +1003,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod112552b() throws Exception {
performFixTest("package test; public class Test {public static void
t(int a) {boolean first = true; while (true) {if (first) {while (a != 1) {first
= false;}} else {break;}}}}",
151 - 25, 165 - 25,
@@ -1007,7 +1011,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod112552c() throws Exception {
performFixTest("package test; public class Test {public static void
t() {boolean first = true; for (;;) {if (first) {first = false;} else
{break;}}}}",
126 - 25, 140 - 25,
@@ -1015,7 +1019,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod112552d() throws Exception {
performFixTest("package test; public class Test {public static void
t() {boolean first = true; do {if (first) {first = false;} else {break;}} while
(true);}}",
120 - 25, 134 - 25,
@@ -1023,7 +1027,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod112552e() throws Exception {
performFixTest("package test; public class Test {public static void
t() {boolean first = true; while (true) {first = false; while (first)
{System.err.println();}}}}",
148 - 25, 169 - 25,
@@ -1031,7 +1035,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod111896a() throws Exception {
performFixTest("package test; public class Test {public static void
t() {new Runnable() { private int i; public void run() { } };}}",
82 - 25, 139 - 25,
@@ -1039,7 +1043,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod111896b() throws Exception {
performFixTest("package test; public class Test {public static void
t() {final int a = 0; new Runnable() { private int i; public void run() { i =
a; } };}}",
99 - 25, 163 - 25,
@@ -1047,7 +1051,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod111896c() throws Exception {
performFixTest("package test; public class Test {public static void
t() {final int a = 0; new Runnable() { private int i; public void run() { int
a = i; } }; int b = a;}}",
99 - 25, 167 - 25,
@@ -1055,7 +1059,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethodUselessLocalVariable() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1071,7 +1075,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod114371() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1087,7 +1091,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod179258() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1121,7 +1125,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethod116199() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1134,7 +1138,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethodComments170213() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1162,6 +1166,7 @@ public class IntroduceHintTest extends NbTestCase {
// IntroduceKind.CREATE_METHOD,
// "");
// }
+ @RandomlyFails
public void testIntroduceMethodFromExpression1() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1175,7 +1180,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
4, 2);
}
-
+ @RandomlyFails
public void testIntroduceMethodFromExpression2() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1189,7 +1194,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
4, 2);
}
-
+ @RandomlyFails
public void testIntroduceMethodFromExpressionNewClassTree179766() throws
Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1218,6 +1223,7 @@ public class IntroduceHintTest extends NbTestCase {
// "package test; import java.io.IOException; public
class Test { public static void test(int a) throws Exception { name(a); }
private static void name(int a) throws IOException { if (a == 1) { throw new
java.io.IOException(\"\"); } if (a == 2) { throw new
java.io.FileNotFoundException(\"\"); } } }",
// new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true));
// }
+ @RandomlyFails
public void testIntroduceMethodArray162163() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1230,7 +1236,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodReplaceDuplicatesNoRemap() throws Exception
{
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1246,7 +1252,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodReplaceDuplicatesSimpleRemap() throws
Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1265,7 +1271,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true, true),
1, 0);
}
-
+ @RandomlyFails
public void
testIntroduceMethodReplaceDuplicatesSimpleRemapNotUseAfterMethod() throws
Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1282,7 +1288,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodReplaceDuplicates194622() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1299,7 +1305,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodReplaceDuplicatesRemapExpression() throws
Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1318,7 +1324,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodReplaceDuplicatesRemapExpression179515a()
throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1337,7 +1343,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodReplaceDuplicatesRemapExpression179515b()
throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1361,7 +1367,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodFromExpressionDuplicatesAndRemap() throws
Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1375,7 +1381,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true, true),
4, 2);
}
-
+ @RandomlyFails
public void testIntroduceMethodReplaceDuplicates206193() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1412,7 +1418,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name",
EnumSet.of(Modifier.PRIVATE), true, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodFromSingleStatement153399a() throws
Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1425,7 +1431,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodFromSingleStatement153399b() throws
Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1443,13 +1449,13 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodNPE() throws Exception {
performErrorMessageTest("package test; public class Test { |private
static class F { public static void test(int y) {for ( ; ; y++) {if (y == 0)
break; else y++;}}}| }",
IntroduceKind.CREATE_METHOD,
"ERR_Invalid_Selection");
}
-
+ @RandomlyFails
public void testIntroduceMethodTypeParam183435a() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1462,7 +1468,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethodTypeParam183435b() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1476,7 +1482,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", EnumSet
.of(Modifier.PRIVATE), true));
}
-
+ @RandomlyFails
public void testIntroduceMethodTypeParam183435c() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1490,7 +1496,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
4, 2);
}
-
+ @RandomlyFails
public void testIntroduceMethodTypeParam183435d() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1505,7 +1511,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
4, 2);
}
-
+ @RandomlyFails
public void test152705() throws Exception {
performFixTest("package test;\n" +
"import java.util.ArrayList;\n" +
@@ -1541,7 +1547,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testLocalVariableToField1() throws Exception {
performFixTest("package test;\n" +
"import java.util.ArrayList;\n" +
@@ -1562,7 +1568,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), false, true),
3, 1);
}
-
+ @RandomlyFails
public void testLocalVariableToField201759a() throws Exception {
performFixTest("package test;\n" +
"import java.util.ArrayList;\n" +
@@ -1584,7 +1590,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), false, true),
3, 1);
}
-
+ @RandomlyFails
public void testLocalVariableToField201759b() throws Exception {
performFixTest("package test;\n" +
"import java.util.ArrayList;\n" +
@@ -1611,7 +1617,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), false, true),
3, 1);
}
-
+ @RandomlyFails
public void testLocalVariableToField201759c() throws Exception {
performFixTest("package test;\n" +
"import java.util.ArrayList;\n" +
@@ -1635,7 +1641,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), false, true),
3, 1);
}
-
+ @RandomlyFails
public void testLocalVariableToFieldInitMethod270296() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1660,7 +1666,7 @@ public class IntroduceHintTest extends NbTestCase {
EnumSet.of(Modifier.PRIVATE),
false, true),
3, 1);
}
-
+ @RandomlyFails
public void testLocalVariableToConstant1() throws Exception {
performFixTest("package test;\n" +
"import java.util.ArrayList;\n" +
@@ -1681,7 +1687,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE)),
3, 0);
}
-
+ @RandomlyFails
public void test196683() throws Exception {
performFixTest("package test;\n" +
"import java.util.ArrayList;\n" +
@@ -1730,7 +1736,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void test193775() throws Exception {
performCheckFixesTest("package test; import java.util.Collection;
import java.util.Map.Entry; public class Test { public void
test(|Collection<Entry> e|) {} }");
}
@@ -1756,7 +1762,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE)),
5, 1);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix203621a() throws Exception {
performFixTest("package test; public class Test {\n" +
" public void test() {\n" +
@@ -1768,7 +1774,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix203621b() throws Exception {
performFixTest("package test; public class Test {\n" +
" public Test() {\n" +
@@ -1782,7 +1788,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceFieldFix203621c() throws Exception {
performFixTest("package test; public class Test {\n" +
" public void test() {\n" +
@@ -1796,7 +1802,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testFieldLocation233440() throws Exception {
Preferences prefs = CodeStylePreferences.get((FileObject) null,
JavacParser.MIME_TYPE).getPreferences();
prefs.put("classMemberInsertionPoint",
InsertionPoint.CARET_LOCATION.name());
@@ -1813,7 +1819,7 @@ public class IntroduceHintTest extends NbTestCase {
.<Modifier>of(Modifier.PRIVATE), false, true),
5, 2);
}
-
+ @RandomlyFails
public void testIntroduceConstantFix203621() throws Exception {
performFixTest("package test; public class Test {\n" +
" public void test() {\n" +
@@ -1825,11 +1831,11 @@ public class IntroduceHintTest extends NbTestCase {
.noneOf(Modifier.class)),
5, 1);
}
-
+ @RandomlyFails
public void testConstant203499() throws Exception {
performConstantAccessTest("package test; public class Test { static
String g(String s) { return s; } static String d(String s) { return |g(s)|; }
}", false);
}
-
+ @RandomlyFails
public void testIntroduceMethod203254() throws Exception {
performFixTest("package test;\n" +
"class Test {\n" +
@@ -1843,7 +1849,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethod228913() throws Exception {
sourceLevel = "1.8";
performFixTest("package test;\n" +
@@ -1860,7 +1866,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethod203002() throws Exception {
performFixTest("package test;\n" +
"class Test {\n" +
@@ -1884,7 +1890,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testMethodUnprefixedParam() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -1910,7 +1916,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testMethodParamWithLetterPrefix() throws Exception {
codeStylePrefs.put(FmtOptions.parameterNamePrefix, "p");
performFixTest("package test;\n" +
@@ -1945,6 +1951,7 @@ public class IntroduceHintTest extends NbTestCase {
* potential prefix should be ignored
*
*/
+ @RandomlyFails
public void testMethodPrefixedAndUnprefixed() throws Exception {
codeStylePrefs.put(FmtOptions.parameterNamePrefix, "p");
performFixTest("package test;\n" +
@@ -1973,6 +1980,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
+ @RandomlyFails
public void test224512() throws Exception {
performFixTest("package test;\n" +
"class Test {\n" +
@@ -2015,7 +2023,7 @@ public class IntroduceHintTest extends NbTestCase {
.of(Modifier.PRIVATE), true),
1, 0);
}
-
+ @RandomlyFails
public void testConstantFix204373a() throws Exception {
performFixTest("package test;\n" +
"import java.util.logging.Level;\n" +
@@ -2043,7 +2051,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, true, true,
EnumSet.noneOf(Modifier.class)),
5, 1);
}
-
+ @RandomlyFails
public void testConstantFix204373b() throws Exception {
performFixTest("package test;\n" +
"import java.util.logging.Level;\n" +
@@ -2069,7 +2077,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, true, true,
EnumSet.noneOf(Modifier.class)),
5, 1);
}
-
+ @RandomlyFails
public void testConstantFix204373c() throws Exception {
performFixTest("package test;\n" +
"import java.util.logging.Level;\n" +
@@ -2101,7 +2109,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl(null, true, true, true,
EnumSet.noneOf(Modifier.class)),
5, 1);
}
-
+ @RandomlyFails
public void testConstantFix204373d() throws Exception {
performFixTest("package test;\n" +
"import java.util.logging.Level;\n" +
@@ -2133,7 +2141,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl2(null,
IntroduceFieldPanel.INIT_FIELD, true, EnumSet.<Modifier>of(Modifier.PRIVATE),
false, true),
5, 2);
}
-
+ @RandomlyFails
public void testConstantFix204373e() throws Exception {
performFixTest("package test;\n" +
"import java.util.logging.Level;\n" +
@@ -2165,7 +2173,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl2(null,
IntroduceFieldPanel.INIT_FIELD, true, EnumSet.<Modifier>of(Modifier.PRIVATE),
false, true),
5, 2);
}
-
+ @RandomlyFails
public void testConstantFix208072a() throws Exception {
Preferences prefs = CodeStylePreferences.get((FileObject) null,
JavacParser.MIME_TYPE).getPreferences();
prefs.put("classMemberInsertionPoint", "LAST_IN_CATEGORY");
@@ -2185,7 +2193,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("ZZ", true, true, true,
EnumSet.of(Modifier.PRIVATE)),
1, 0);
}
-
+ @RandomlyFails
public void testConstantFix208072b() throws Exception {
Preferences prefs = CodeStylePreferences.get((FileObject) null,
JavacParser.MIME_TYPE).getPreferences();
prefs.put("classMembersOrder", "STATIC_INIT;STATIC
METHOD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC CLASS;CLASS;STATIC FIELD;FIELD");
@@ -2212,7 +2220,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("ZZ", true, true, true,
EnumSet.of(Modifier.PRIVATE)),
5, 1);
}
-
+ @RandomlyFails
public void testConstantFix208072c() throws Exception {
Preferences prefs = CodeStylePreferences.get((FileObject) null,
JavacParser.MIME_TYPE).getPreferences();
prefs.put("classMembersOrder", "STATIC_INIT;STATIC
METHOD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC CLASS;CLASS;STATIC FIELD;FIELD");
@@ -2239,7 +2247,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("ZZ", true, true, true,
EnumSet.of(Modifier.PRIVATE)),
5, 1);
}
-
+ @RandomlyFails
public void testConstantFix219771a() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2259,7 +2267,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("C0", true, true, true,
EnumSet.of(Modifier.PUBLIC)),
5, 1);
}
-
+ @RandomlyFails
public void testConstantFix219771b() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2279,7 +2287,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl2("C0",
IntroduceFieldPanel.INIT_FIELD, true, EnumSet.of(Modifier.PUBLIC), true, true),
4, 1);
}
-
+ @RandomlyFails
public void testConstantFix219771c() throws Exception {
Preferences prefs = CodeStylePreferences.get((FileObject) null,
JavacParser.MIME_TYPE).getPreferences();
prefs.put("classMembersOrder", "STATIC_INIT;FIELD;STATIC
METHOD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC CLASS;CLASS;STATIC FIELD");
@@ -2307,6 +2315,7 @@ public class IntroduceHintTest extends NbTestCase {
* Checks that expressions that instantiate member classes cannot form
constant
* @throws Exception
*/
+ @RandomlyFails
public void testConstantFix236187() throws Exception {
performConstantAccessTest("package test;\n" +
"public class Test {\n" +
@@ -2317,7 +2326,7 @@ public class IntroduceHintTest extends NbTestCase {
" }\n" +
"}", false);
}
-
+ @RandomlyFails
public void testConstantFix236187Static() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2341,7 +2350,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl2("ZZ",
IntroduceFieldPanel.INIT_FIELD, true, EnumSet.<Modifier>of(Modifier.PRIVATE),
true, true),
5, 1);
}
-
+ @RandomlyFails
public void testFieldFix208072d() throws Exception {
Preferences prefs = CodeStylePreferences.get((FileObject) null,
JavacParser.MIME_TYPE).getPreferences();
prefs.put("classMembersOrder", "STATIC_INIT;STATIC
METHOD;INSTANCE_INIT;CONSTRUCTOR;METHOD;STATIC CLASS;CLASS;STATIC FIELD;FIELD");
@@ -2368,11 +2377,11 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl2("ZZ",
IntroduceFieldPanel.INIT_FIELD, false, EnumSet.<Modifier>of(Modifier.PRIVATE),
false, true),
5, 2);
}
-
+ @RandomlyFails
public void testWhitespace216402() throws Exception {
performSimpleSelectionVerificationTest("package test; public class
Test {public void test() {int y = 3; y =| 2 |; }}", true);
}
-
+ @RandomlyFails
public void testVariableNullTypeVariable221440() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2390,7 +2399,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("name", true, false, true),
5, 0);
}
-
+ @RandomlyFails
public void testVariableNullTypeConstant221440() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2408,7 +2417,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl("name", true, null, true),
5, 1);
}
-
+ @RandomlyFails
public void testVariableNullTypeField221440() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2426,7 +2435,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl2("name",
IntroduceFieldPanel.INIT_FIELD, true, null, true, true),
5, 2);
}
-
+ @RandomlyFails
public void testVariableNullTypeMethod221440() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2446,7 +2455,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
5, 3);
}
-
+ @RandomlyFails
public void test213023() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2464,7 +2473,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
1, 0);
}
-
+ @RandomlyFails
public void testNullIntroduceMethod231050a() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2486,7 +2495,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
5, 3);
}
-
+ @RandomlyFails
public void testNullIntroduceMethod231050b() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2508,7 +2517,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
5, 3);
}
-
+ @RandomlyFails
public void testIntroduceMethodLastStatement224168a() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2532,7 +2541,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodLastStatement224168b() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2560,7 +2569,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodLastStatement224168c() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
@@ -2593,7 +2602,7 @@ public class IntroduceHintTest extends NbTestCase {
new DialogDisplayerImpl3("name", null, true),
1, 0);
}
-
+ @RandomlyFails
public void testIntroduceMethodReturn233433() throws Exception {
performFixTest("package test;\n" +
"public class Test {\n" +
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists