本文整理汇总了Java中org.eclipse.xtext.xbase.lib.Exceptions.sneakyThrow方法的典型用法代码示例。如果您正苦于以下问题:Java Exceptions.sneakyThrow方法的具体用法?Java Exceptions.sneakyThrow怎么用?Java Exceptions.sneakyThrow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xbase.lib.Exceptions
的用法示例。
在下文中一共展示了Exceptions.sneakyThrow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doTest
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
protected void doTest(final String fileName, final Position position) {
try {
TextDocumentIdentifier _textDocumentIdentifier = new TextDocumentIdentifier(fileName);
final RenameParams params = new RenameParams(_textDocumentIdentifier, position, "Tescht");
final WorkspaceEdit workspaceEdit = this.languageServer.rename(params).get();
StringConcatenation _builder = new StringConcatenation();
_builder.append("changes :");
_builder.newLine();
_builder.append("\t");
_builder.append("MyType1.testlang : Tescht [[0, 5] .. [0, 9]]");
_builder.newLine();
_builder.append("\t");
_builder.append("Tescht [[1, 4] .. [1, 8]]");
_builder.newLine();
_builder.append("\t");
_builder.append("MyType2.testlang : Tescht [[1, 4] .. [1, 8]]");
_builder.newLine();
_builder.append("documentChanges : ");
_builder.newLine();
this.assertEquals(_builder.toString(), this.toExpectation(workspaceEdit));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例2: testDuplicateCases_int_8
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testDuplicateCases_int_8() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("{");
_builder.newLine();
_builder.append("\t");
_builder.append("switch x : 1 {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("case x: \'\'");
_builder.newLine();
_builder.append("\t\t");
_builder.append("case x: \'1\'");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this._validationTestHelper.assertError(this.expression(_builder), XbasePackage.Literals.XFEATURE_CALL, IssueCodes.DUPLICATE_CASE);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例3: testDuplicateCases_int_2
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testDuplicateCases_int_2() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("switch x : 1 {");
_builder.newLine();
_builder.append("\t");
_builder.append("case 1: 1");
_builder.newLine();
_builder.append("\t");
_builder.append("case 2: 2");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this._validationTestHelper.assertNoErrors(this.expression(_builder));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例4: testUnreachableCase_6
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testUnreachableCase_6() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("switch new java.util.ArrayList<String> {");
_builder.newLine();
_builder.append("\t");
_builder.append("java.util.List<Integer>: \"list of integers\"");
_builder.newLine();
_builder.append("\t");
_builder.append("java.util.List<String>: \"list of strings\"");
_builder.newLine();
_builder.append("\t");
_builder.append("default: \"something else\"");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this._validationTestHelper.assertError(this.expression(_builder), TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE, IssueCodes.UNREACHABLE_CASE);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例5: testDeleteElement
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testDeleteElement() {
try {
this._parseHelper.parse("foo", this.fooURI, this.rs1).eResource().getContents().clear();
final Function1<IEObjectDescription, String> _function = (IEObjectDescription it) -> {
return it.getQualifiedName().toString();
};
Assert.assertEquals("", IterableExtensions.join(IterableExtensions.<IEObjectDescription, String>map(this.fooContainer.getExportedObjects(), _function), ","));
Assert.assertEquals(1, IterableExtensions.size(this.fooContainer.getResourceDescriptions()));
Assert.assertEquals(1, this.fooContainer.getResourceDescriptionCount());
Assert.assertEquals(0, IterableExtensions.size(this.fooContainer.getExportedObjects()));
Assert.assertEquals(1, IterableExtensions.size(this.barContainer.getResourceDescriptions()));
Assert.assertEquals(1, this.barContainer.getResourceDescriptionCount());
this.assertGlobalDescriptionsAreUnaffected();
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例6: testIntegerAnnotation
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testIntegerAnnotation() {
try {
final XAnnotationsFactory f = XAnnotationsFactory.eINSTANCE;
final XExpression e = this.expression("\'Foo\'");
final XAnnotation anno = f.createXAnnotation();
JvmType _findDeclaredType = this.references.findDeclaredType(TestAnnotation3.class, e);
final JvmAnnotationType annotatiomType = ((JvmAnnotationType) _findDeclaredType);
anno.setAnnotationType(annotatiomType);
final XAnnotationElementValuePair pair = f.createXAnnotationElementValuePair();
pair.setElement(IterableExtensions.<JvmOperation>head(annotatiomType.getDeclaredOperations()));
pair.setValue(this.expression("10"));
EList<XAnnotationElementValuePair> _elementValuePairs = anno.getElementValuePairs();
this._jvmTypesBuilder.<XAnnotationElementValuePair>operator_add(_elementValuePairs, pair);
final JvmGenericType type = this.typesFactory.createJvmGenericType();
this._jvmTypesBuilder.addAnnotation(type, anno);
Assert.assertEquals(anno.getAnnotationType(), IterableExtensions.<JvmAnnotationReference>head(type.getAnnotations()).getAnnotation());
Assert.assertEquals(1, IterableExtensions.<JvmAnnotationReference>head(type.getAnnotations()).getValues().size());
JvmAnnotationValue _head = IterableExtensions.<JvmAnnotationValue>head(IterableExtensions.<JvmAnnotationReference>head(type.getAnnotations()).getValues());
final JvmCustomAnnotationValue value = ((JvmCustomAnnotationValue) _head);
EObject _head_1 = IterableExtensions.<EObject>head(value.getValues());
Assert.assertTrue((_head_1 instanceof XNumberLiteral));
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例7: testQuickRandomEdgeCoverage
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testQuickRandomEdgeCoverage() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=quick_random(edge_coverage(100));I;"));
Assert.assertNotNull(result);
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例8: testWeightedRandomRequirementCoverage
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testWeightedRandomRequirementCoverage() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=weighted_random(requirement_coverage(100));I;"));
Assert.assertNotNull(result);
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例9: testAStartReachedEdge
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testAStartReachedEdge() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=a_star(reached_edge(v_VerifyAppRunning));I;"));
Assert.assertNotNull(result);
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例10: testQuickRandomDependencyEdgeCoverage
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testQuickRandomDependencyEdgeCoverage() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=quick_random(dependency_edge_coverage(100));I;"));
Assert.assertNotNull(result);
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例11: testNocheck
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testNocheck() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=nocheck"));
Assert.assertNotNull(result);
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例12: testQuickRandomRequirementCoverage
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testQuickRandomRequirementCoverage() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=quick_random(requirement_coverage(100));I;"));
Assert.assertNotNull(result);
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例13: testMultipleGeneratorStopConditionSpaceSeparated
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testMultipleGeneratorStopConditionSpaceSeparated() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=random(reached_vertex(v_VerifyAppRunning)) a_star(reached_edge(e_enterSearchedWord));I;a_star(reached_edge(e_enterSearchedWord));I;"));
Assert.assertNotNull(result);
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例14: testRandomReachedVertex
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testRandomReachedVertex() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=random(reached_vertex(v_VerifyAppRunning));I;"));
Assert.assertNotNull(result);
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
示例15: testQuickRandomReachedVertex
import org.eclipse.xtext.xbase.lib.Exceptions; //导入方法依赖的package包/类
@Test
public void testQuickRandomReachedVertex() {
try {
final Model result = this.parseHelper.parse(("\n" + "Simple.json=quick_random(reached_vertex(v_VerifyAppRunning));I;"));
Assert.assertNotNull(result);
InputOutput.<EList<Resource.Diagnostic>>print(result.eResource().getErrors());
Assert.assertTrue(result.eResource().getErrors().isEmpty());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}