Search in sources :

Example 46 with Ignore

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 });
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 47 with Ignore

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 });
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 48 with Ignore

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);
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 49 with Ignore

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 });
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 50 with Ignore

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 });
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) CUCorrectionProposal(org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Ignore (org.junit.Ignore)5092 Test (org.junit.Test)4807 File (java.io.File)445 ArrayList (java.util.ArrayList)374 IOException (java.io.IOException)217 HashMap (java.util.HashMap)187 List (java.util.List)171 CountDownLatch (java.util.concurrent.CountDownLatch)118 Map (java.util.Map)103 LocalDate (java.time.LocalDate)94 Dataset (org.apache.jena.query.Dataset)93 InputStream (java.io.InputStream)89 Date (java.util.Date)88 Random (java.util.Random)85 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)83 Properties (java.util.Properties)78 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)78 HashSet (java.util.HashSet)71 ByteArrayOutputStream (java.io.ByteArrayOutputStream)70 ExecutorService (java.util.concurrent.ExecutorService)70