本文整理匯總了Java中org.eclipse.xtext.testing.serializer.SerializerTestHelper類的典型用法代碼示例。如果您正苦於以下問題:Java SerializerTestHelper類的具體用法?Java SerializerTestHelper怎麽用?Java SerializerTestHelper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SerializerTestHelper類屬於org.eclipse.xtext.testing.serializer包,在下文中一共展示了SerializerTestHelper類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getResourceAndExpect
import org.eclipse.xtext.testing.serializer.SerializerTestHelper; //導入依賴的package包/類
public final XtextResource getResourceAndExpect(InputStream in, URI uri, int expectedErrors) throws Exception {
XtextResource resource = doGetResource(in, uri);
checkNodeModel(resource);
if (expectedErrors != UNKNOWN_EXPECTATION) {
if (expectedErrors == EXPECT_ERRORS)
assertFalse(Joiner.on('\n').join(resource.getErrors()), resource.getErrors().isEmpty());
else
assertEquals(Joiner.on('\n').join(resource.getErrors()), expectedErrors, resource.getErrors().size());
}
for(Diagnostic d: resource.getErrors()) {
if (d instanceof ExceptionDiagnostic)
fail(d.getMessage());
}
if (expectedErrors == 0 && resource.getContents().size() > 0 && shouldTestSerializer(resource)) {
SerializerTestHelper tester = get(SerializerTestHelper.class);
EObject obj = resource.getContents().get(0);
tester.assertSerializeWithNodeModel(obj);
tester.assertSerializeWithoutNodeModel(obj);
}
return resource;
}
示例2: PositiveAnalyser
import org.eclipse.xtext.testing.serializer.SerializerTestHelper; //導入依賴的package包/類
/***/
// TODO after java update bring back null analysis
// public PositiveAnalyser(final @Nonnull Logger logger) {
public PositiveAnalyser(final Logger logger, SerializerTestHelper serializerTester) {
super(logger);
this.serializerTester = serializerTester;
}