use of com.google.api.services.cloudresourcemanager.v3.model in project xtext-core by eclipse.
the class Bug302128Test method testTheBug2.
@Test
public void testTheBug2() throws Exception {
with(new Bug302128TestLanguageStandaloneSetup());
String text = "VARIABLE += value.val value2.val\n" + "VARIABLE2 += value3.val value4.val\n\n" + "#Comment comment comment\n\n" + "VARIABLE3 += value5.val value6.val\n" + "VARIABLE4 += value.val value2.val\n" + "VARIABLE5 += value3.val value4.val\n\n" + "#Comment comment comment\n\n" + "VARIABLE.varible += value5.val value6.val\n";
XtextResource resource = getResource(new StringInputStream(text));
Model model = (Model) resource.getContents().get(0);
model.getElements().get(2).setValue("+= value5.val value6.val\n");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
resource.save(outputStream, null);
assertEquals(text, new String(outputStream.toByteArray()));
}
use of com.google.api.services.cloudresourcemanager.v3.model in project xtext-core by eclipse.
the class Bug250313Test method testIDConversion_06.
@Test
public void testIDConversion_06() throws Exception {
Model model = (Model) getModel("1+ ^str");
assertEquals("[str]", model.getMultiValue().toString());
assertEquals("org.eclipse.xtext.common.Terminals.ID", lexerRule);
assertTrue(node instanceof ILeafNode);
assertEquals("^str", string);
assertEquals(1, convertCallCount);
}
use of com.google.api.services.cloudresourcemanager.v3.model in project xtext-core by eclipse.
the class Bug250313Test method testDatatypeConversion_01.
@Test
public void testDatatypeConversion_01() throws Exception {
Model model = (Model) getModel("1 foo - bar");
assertEquals("str", model.getValue());
assertEquals("org.eclipse.xtext.valueconverter.Bug250313.Datatype", lexerRule);
assertTrue(node instanceof ICompositeNode);
assertEquals(6, Iterables.size(((ICompositeNode) node).getChildren()));
assertEquals("foo - bar", string);
assertEquals(1, convertCallCount);
}
use of com.google.api.services.cloudresourcemanager.v3.model in project xtext-core by eclipse.
the class Bug250313Test method testNestedDatatypeConversion_10.
@Test
public void testNestedDatatypeConversion_10() throws Exception {
Model model = (Model) getModel("4+ zonk +");
assertEquals("[str]", model.getMultiValue().toString());
assertEquals("org.eclipse.xtext.valueconverter.Bug250313.NestedDatatype", lexerRule);
assertTrue(node instanceof ICompositeNode);
assertEquals(4, Iterables.size(((ICompositeNode) node).getChildren()));
assertEquals("zonk +", string);
assertEquals(1, convertCallCount);
}
use of com.google.api.services.cloudresourcemanager.v3.model in project xtext-core by eclipse.
the class Bug250313Test method testSTRINGConversion_03.
@Test
public void testSTRINGConversion_03() throws Exception {
Model model = (Model) getModel("2 'str'");
assertEquals("str", model.getValue());
assertEquals("org.eclipse.xtext.common.Terminals.STRING", lexerRule);
assertTrue(node instanceof ILeafNode);
assertEquals("'str'", string);
assertEquals(1, convertCallCount);
}
Aggregations