use of org.junit.Ignore in project che by eclipse.
the class ModifierCorrectionsQuickFixTest method testSuppressNLSWarningAnnotation4.
@Test
@Ignore
public void testSuppressNLSWarningAnnotation4() throws Exception {
Hashtable options = JavaCore.getOptions();
options.put(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.WARNING);
JavaCore.setOptions(options);
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf = new StringBuffer();
buf.append("package test1; \n");
buf.append("public class E {\n");
buf.append(" public void foo() {\n");
buf.append(" @SuppressWarnings(\"unused\") String s = \"\";\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
CompilationUnit astRoot = getASTRoot(cu);
ArrayList proposals = collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 4);
assertCorrectLabels(proposals);
String[] expected = new String[2];
buf = new StringBuffer();
buf.append("package test1; \n");
buf.append("public class E {\n");
buf.append(" public void foo() {\n");
buf.append(" @SuppressWarnings({\"unused\", \"nls\"}) String s = \"\";\n");
buf.append(" }\n");
buf.append("}\n");
expected[0] = buf.toString();
buf = new StringBuffer();
buf.append("package test1; \n");
buf.append("public class E {\n");
buf.append(" @SuppressWarnings(\"nls\")\n");
buf.append(" public void foo() {\n");
buf.append(" @SuppressWarnings(\"unused\") String s = \"\";\n");
buf.append(" }\n");
buf.append("}\n");
expected[1] = buf.toString();
assertExpectedExistInProposals(proposals, expected);
}
use of org.junit.Ignore in project che by eclipse.
the class UnresolvedTypesQuickFixTest method testInnerType.
@Test
@Ignore
public void testInnerType() throws Exception {
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" void foo() {\n");
buf.append(" Object object= new F.Inner() {\n");
buf.append(" };\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu1 = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class F {\n");
buf.append("}\n");
pack1.createCompilationUnit("F.java", buf.toString(), false, null);
CompilationUnit astRoot = getASTRoot(cu1);
ArrayList proposals = collectCorrections(cu1, astRoot);
assertCorrectLabels(proposals);
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" void foo() {\n");
buf.append(" Object object= new Object() {\n");
buf.append(" };\n");
buf.append(" }\n");
buf.append("}\n");
String expected1 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class F {\n");
buf.append("\n");
buf.append(" public class Inner {\n");
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
String expected2 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class F {\n");
buf.append("\n");
buf.append(" public interface Inner {\n");
buf.append("\n");
buf.append(" }\n");
buf.append("}\n");
String expected3 = buf.toString();
assertExpectedExistInProposals(proposals, new String[] { expected1, expected2, expected3 });
}
use of org.junit.Ignore in project che by eclipse.
the class UnresolvedTypesQuickFixTest method testPrimitiveTypeInFieldDecl.
@Test
@Ignore
public void testPrimitiveTypeInFieldDecl() throws Exception {
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" floot vec= 1.0;\n");
buf.append("}\n");
ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
CompilationUnit astRoot = getASTRoot(cu);
ArrayList proposals = collectCorrections(cu, astRoot);
assertCorrectLabels(proposals);
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" double vec= 1.0;\n");
buf.append("}\n");
String expected1 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" Float vec= 1.0;\n");
buf.append("}\n");
String expected2 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" float vec= 1.0;\n");
buf.append("}\n");
String expected3 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public class floot {\n");
buf.append("\n");
buf.append("}\n");
String expected4 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public interface floot {\n");
buf.append("\n");
buf.append("}\n");
String expected5 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public enum floot {\n");
buf.append("\n");
buf.append("}\n");
String expected6 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E<floot> {\n");
buf.append(" floot vec= 1.0;\n");
buf.append("}\n");
String expected7 = buf.toString();
assertExpectedExistInProposals(proposals, new String[] { expected1, expected2, expected3, expected4, expected5, expected6, expected7 });
}
use of org.junit.Ignore in project che by eclipse.
the class UnresolvedTypesQuickFixTest method testAmbiguousTypeInInterface.
@Test
@Ignore
public void testAmbiguousTypeInInterface() throws Exception {
createSomeAmbiguity(true, false);
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import test2.*;\n");
buf.append("import test3.*;\n");
buf.append("public class E implements A {\n");
buf.append(" B b;\n");
buf.append(" C c;\n");
buf.append("}\n");
ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
CompilationUnit astRoot = getASTRoot(cu);
ArrayList proposals = collectCorrections(cu, astRoot);
assertNumberOfProposals(proposals, 2);
assertCorrectLabels(proposals);
CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
String preview1 = getPreviewContent(proposal);
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import test2.*;\n");
buf.append("import test2.A;\n");
buf.append("import test3.*;\n");
buf.append("public class E implements A {\n");
buf.append(" B b;\n");
buf.append(" C c;\n");
buf.append("}\n");
String expected1 = buf.toString();
proposal = (CUCorrectionProposal) proposals.get(1);
String preview2 = getPreviewContent(proposal);
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import test2.*;\n");
buf.append("import test3.*;\n");
buf.append("import test3.A;\n");
buf.append("public class E implements A {\n");
buf.append(" B b;\n");
buf.append(" C c;\n");
buf.append("}\n");
String expected2 = buf.toString();
assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
use of org.junit.Ignore in project che by eclipse.
the class UnresolvedTypesQuickFixTest method testTypeInTypeArguments2.
@Test
@Ignore
public void testTypeInTypeArguments2() throws Exception {
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.Map;\n");
buf.append("public class E<T> {\n");
buf.append(" static class SomeType { }\n");
buf.append(" void foo() {\n");
buf.append(" E<Map<String, ? extends XYX>> list= new E<Map<String, ? extends SomeType>>() {\n");
buf.append(" };\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
CompilationUnit astRoot = getASTRoot(cu);
ArrayList proposals = collectCorrections(cu, astRoot);
assertCorrectLabels(proposals);
String[] expected = new String[6];
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.Map;\n");
buf.append("public class E<T> {\n");
buf.append(" static class SomeType { }\n");
buf.append(" void foo() {\n");
buf.append(" E<Map<String, ? extends SomeType>> list= new E<Map<String, ? extends SomeType>>() {\n");
buf.append(" };\n");
buf.append(" }\n");
buf.append("}\n");
expected[0] = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("import test1.E.SomeType;\n");
buf.append("\n");
buf.append("public class XYX extends SomeType {\n");
buf.append("\n");
buf.append("}\n");
expected[1] = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public interface XYX {\n");
buf.append("\n");
buf.append("}\n");
expected[2] = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public enum XYX {\n");
buf.append("\n");
buf.append("}\n");
expected[3] = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.Map;\n");
buf.append("public class E<T> {\n");
buf.append(" static class SomeType { }\n");
buf.append(" <XYX> void foo() {\n");
buf.append(" E<Map<String, ? extends XYX>> list= new E<Map<String, ? extends SomeType>>() {\n");
buf.append(" };\n");
buf.append(" }\n");
buf.append("}\n");
expected[4] = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.Map;\n");
buf.append("public class E<T, XYX> {\n");
buf.append(" static class SomeType { }\n");
buf.append(" void foo() {\n");
buf.append(" E<Map<String, ? extends XYX>> list= new E<Map<String, ? extends SomeType>>() {\n");
buf.append(" };\n");
buf.append(" }\n");
buf.append("}\n");
expected[5] = buf.toString();
assertExpectedExistInProposals(proposals, expected);
}
Aggregations