use of org.junit.Ignore in project che by eclipse.
the class UnresolvedTypesQuickFixTest method testTypeInExceptionType.
@Test
@Ignore
public void testTypeInExceptionType() 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() throws IOExcpetion {\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);
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("import java.io.IOException;\n");
buf.append("\n");
buf.append("public class E {\n");
buf.append(" void foo() throws IOException {\n");
buf.append(" }\n");
buf.append("}\n");
String expected1 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public class IOExcpetion extends Exception {\n");
buf.append("\n");
buf.append("}\n");
String expected2 = buf.toString();
assertExpectedExistInProposals(proposals, new String[] { expected1, expected2 });
}
use of org.junit.Ignore in project che by eclipse.
the class UnresolvedTypesQuickFixTest method testTypeInVarDeclWithWildcard.
@Test
@Ignore
public void testTypeInVarDeclWithWildcard() throws Exception {
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.ArrayList;\n");
buf.append("public class E {\n");
buf.append(" void foo(ArrayList<? extends Runnable> a) {\n");
buf.append(" XY v= a.get(0);\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu1 = pack1.createCompilationUnit("E.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("import java.util.ArrayList;\n");
buf.append("public class E {\n");
buf.append(" void foo(ArrayList<? extends Runnable> a) {\n");
buf.append(" Runnable v= a.get(0);\n");
buf.append(" }\n");
buf.append("}\n");
String expected1 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public class XY {\n");
buf.append("\n");
buf.append("}\n");
String expected2 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public interface XY {\n");
buf.append("\n");
buf.append("}\n");
String expected3 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public enum XY {\n");
buf.append("\n");
buf.append("}\n");
String expected4 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.ArrayList;\n");
buf.append("public class E {\n");
buf.append(" <XY> void foo(ArrayList<? extends Runnable> a) {\n");
buf.append(" XY v= a.get(0);\n");
buf.append(" }\n");
buf.append("}\n");
String expected5 = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.ArrayList;\n");
buf.append("public class E<XY> {\n");
buf.append(" void foo(ArrayList<? extends Runnable> a) {\n");
buf.append(" XY v= a.get(0);\n");
buf.append(" }\n");
buf.append("}\n");
String expected6 = buf.toString();
assertExpectedExistInProposals(proposals, new String[] { expected1, expected2, expected3, expected4, expected5, expected6 });
}
use of org.junit.Ignore in project che by eclipse.
the class UnresolvedTypesQuickFixTest method testParameterizedType1.
@Test
@Ignore
public void testParameterizedType1() throws Exception {
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public class E {\n");
buf.append(" void foo(XXY<String> b) {\n");
buf.append(" b.foo();\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[2];
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public class XXY<T> {\n");
buf.append("\n");
buf.append("}\n");
expected[0] = buf.toString();
buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("\n");
buf.append("public interface XXY<T> {\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 testTypeInSuperInterface.
@Test
@Ignore
public void testTypeInSuperInterface() throws Exception {
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf = new StringBuffer();
buf.append("package test1;\n");
buf.append("public interface E extends XXX {\n");
buf.append("}\n");
ICompilationUnit cu1 = pack1.createCompilationUnit("E.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("\n");
buf.append("public interface XXX {\n");
buf.append("\n");
buf.append("}\n");
String expected1 = buf.toString();
assertExpectedExistInProposals(proposals, new String[] { expected1 });
}
use of org.junit.Ignore in project che by eclipse.
the class UnresolvedTypesQuickFixTest method testAmbiguousTypeInArgument.
@Test
@Ignore
public void testAmbiguousTypeInArgument() 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 {\n");
buf.append(" B b;\n");
buf.append(" C c;\n");
buf.append(" public void foo(A a) {");
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, 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 {\n");
buf.append(" B b;\n");
buf.append(" C c;\n");
buf.append(" public void foo(A a) {");
buf.append(" }\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 {\n");
buf.append(" B b;\n");
buf.append(" C c;\n");
buf.append(" public void foo(A a) {");
buf.append(" }\n");
buf.append("}\n");
String expected2 = buf.toString();
assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
Aggregations