Search in sources :

Example 51 with Ignore

use of org.junit.Ignore in project che by eclipse.

the class UnresolvedTypesQuickFixTest method testTypeInFieldDecl.

@Test
@Ignore
public void testTypeInFieldDecl() 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("    Vector1 vec;\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.util.Vector;\n");
    buf.append("\n");
    buf.append("public class E {\n");
    buf.append("    Vector vec;\n");
    buf.append("}\n");
    String expected1 = buf.toString();
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("\n");
    buf.append("public class Vector1 {\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 Vector1 {\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 Vector1 {\n");
    buf.append("\n");
    buf.append("}\n");
    String expected4 = buf.toString();
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("public class E<Vector1> {\n");
    buf.append("    Vector1 vec;\n");
    buf.append("}\n");
    String expected5 = buf.toString();
    assertExpectedExistInProposals(proposals, new String[] { expected1, expected2, expected3, expected4, expected5 });
}
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 52 with Ignore

use of org.junit.Ignore in project che by eclipse.

the class UnresolvedTypesQuickFixTest method testParameterizedType2.

@Test
@Ignore
public void testParameterizedType2() 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<S1, S2> { }\n");
    buf.append("    void foo() {\n");
    buf.append("        SomeType<String, String> list= new XXY<String, String>() { };\n");
    buf.append("    }\n");
    buf.append("}\n");
    ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
    CompilationUnit astRoot = getASTRoot(cu);
    IProblem[] problems = astRoot.getProblems();
    assertNumberOfProblems(2, problems);
    ArrayList proposals = collectCorrections(cu, problems[0], null);
    proposals.addAll(collectCorrections(cu, problems[1], null));
    assertCorrectLabels(proposals);
    String[] expected = new String[3];
    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<S1, S2> { }\n");
    buf.append("    void foo() {\n");
    buf.append("        SomeType<String, String> list= new SomeType<String, String>() { };\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 XXY<T1, T2> extends SomeType<String, String> {\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 XXY<T1, T2> {\n");
    buf.append("\n");
    buf.append("}\n");
    expected[2] = 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) IProblem(org.eclipse.jdt.core.compiler.IProblem) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 53 with Ignore

use of org.junit.Ignore in project che by eclipse.

the class UnresolvedTypesQuickFixTest method testTypeInMethodArguments.

@Test
@Ignore
public void testTypeInMethodArguments() 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(Vect1or[] vec) {\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.util.Vector;\n");
    buf.append("\n");
    buf.append("public class E {\n");
    buf.append("    void foo(Vector[] vec) {\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 Vect1or {\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 Vect1or {\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 Vect1or {\n");
    buf.append("\n");
    buf.append("}\n");
    String expected4 = buf.toString();
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("public class E<Vect1or> {\n");
    buf.append("    void foo(Vect1or[] vec) {\n");
    buf.append("    }\n");
    buf.append("}\n");
    String expected5 = buf.toString();
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("public class E {\n");
    buf.append("    <Vect1or> void foo(Vect1or[] vec) {\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 54 with Ignore

use of org.junit.Ignore in project che by eclipse.

the class UnresolvedTypesQuickFixTest method testTypeInCatchBlock.

@Test
@Ignore
public void testTypeInCatchBlock() 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("        try {\n");
    buf.append("        } catch (XXX x) {\n");
    buf.append("        }\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("\n");
    buf.append("public class XXX extends Exception {\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 55 with Ignore

use of org.junit.Ignore in project hbase by apache.

the class TestClientNoCluster method testTimeoutAndRetries.

/**
   * Remove the @Ignore to try out timeout and retry asettings
   * @throws IOException
   */
@Ignore
@Test
public void testTimeoutAndRetries() throws IOException {
    Configuration localConfig = HBaseConfiguration.create(this.conf);
    // This override mocks up our exists/get call to throw a RegionServerStoppedException.
    localConfig.set("hbase.client.connection.impl", RpcTimeoutConnection.class.getName());
    Connection connection = ConnectionFactory.createConnection(localConfig);
    Table table = connection.getTable(TableName.META_TABLE_NAME);
    Throwable t = null;
    LOG.info("Start");
    try {
        // An exists call turns into a get w/ a flag.
        table.exists(new Get(Bytes.toBytes("abc")));
    } catch (SocketTimeoutException e) {
        // I expect this exception.
        LOG.info("Got expected exception", e);
        t = e;
    } catch (RetriesExhaustedException e) {
        // This is the old, unwanted behavior.  If we get here FAIL!!!
        fail();
    } finally {
        table.close();
    }
    connection.close();
    LOG.info("Stop");
    assertTrue(t != null);
}
Also used : SocketTimeoutException(java.net.SocketTimeoutException) Configuration(org.apache.hadoop.conf.Configuration) HBaseConfiguration(org.apache.hadoop.hbase.HBaseConfiguration) 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