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 });
}
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);
}
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 });
}
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 });
}
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);
}
Aggregations