Search in sources :

Example 6 with NamedElement

use of org.applause.lang.applauseDsl.NamedElement in project applause by applause.

the class ParserTest method parseDomainModel.

@Test
public void parseDomainModel() {
    try {
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("datatype String");
        _builder.newLine();
        _builder.append("datatype Integer");
        _builder.newLine();
        final Model model = this.parser.parse(_builder);
        EList<NamedElement> _elements = model.getElements();
        NamedElement _head = IterableExtensions.<NamedElement>head(_elements);
        final DataType dtString = ((DataType) _head);
        String _name = dtString.getName();
        Assert.assertEquals("String", _name);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Model(org.applause.lang.applauseDsl.Model) DataType(org.applause.lang.applauseDsl.DataType) NamedElement(org.applause.lang.applauseDsl.NamedElement) Test(org.junit.Test)

Example 7 with NamedElement

use of org.applause.lang.applauseDsl.NamedElement in project applause by applause.

the class ParserTest method parseDomainModel.

@Test
public void parseDomainModel() {
    try {
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("datatype String");
        _builder.newLine();
        _builder.append("datatype Integer");
        _builder.newLine();
        final Model model = this.parser.parse(_builder);
        EList<NamedElement> _elements = model.getElements();
        NamedElement _head = IterableExtensions.<NamedElement>head(_elements);
        final DataType dtString = ((DataType) _head);
        String _name = dtString.getName();
        Assert.assertEquals("String", _name);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Model(org.applause.lang.applauseDsl.Model) DataType(org.applause.lang.applauseDsl.DataType) NamedElement(org.applause.lang.applauseDsl.NamedElement) Test(org.junit.Test)

Example 8 with NamedElement

use of org.applause.lang.applauseDsl.NamedElement in project applause by applause.

the class ScalarDataTypesValidationTestHelper method hasPlatform.

public void hasPlatform(final CharSequence sequence, final String platformName) {
    try {
        final Model model = this._parseHelper.parse(sequence);
        EList<NamedElement> _elements = model.getElements();
        final NamedElement platform = IterableExtensions.<NamedElement>head(_elements);
        String _name = platform.getName();
        Matcher<String> _is = CoreMatchers.<String>is(platformName);
        Assert.<String>assertThat(_name, _is);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : Model(org.applause.lang.applauseDsl.Model) NamedElement(org.applause.lang.applauseDsl.NamedElement)

Example 9 with NamedElement

use of org.applause.lang.applauseDsl.NamedElement in project applause by applause.

the class ScreensValidationTestHelper method hasDataSource.

public void hasDataSource(final CharSequence sequence) {
    try {
        final Model model = this._parseHelper.parse(sequence);
        EList<NamedElement> _elements = model.getElements();
        Iterable<Screen> _filter = Iterables.<Screen>filter(_elements, Screen.class);
        final Screen screen = IterableExtensions.<Screen>head(_filter);
        DataSourceCall _datasource = screen.getDatasource();
        Assert.assertNotNull(_datasource);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : DataSourceCall(org.applause.lang.applauseDsl.DataSourceCall) Screen(org.applause.lang.applauseDsl.Screen) Model(org.applause.lang.applauseDsl.Model) NamedElement(org.applause.lang.applauseDsl.NamedElement)

Example 10 with NamedElement

use of org.applause.lang.applauseDsl.NamedElement in project applause by applause.

the class ScreensValidationTestHelper method hasTitle.

public void hasTitle(final CharSequence sequence, final String expectedTitle) {
    try {
        final Model model = this._parseHelper.parse(sequence);
        EList<NamedElement> _elements = model.getElements();
        NamedElement _head = IterableExtensions.<NamedElement>head(_elements);
        final Screen screen = ((Screen) _head);
        String _title = screen.getTitle();
        Assert.assertNotNull(_title);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : Screen(org.applause.lang.applauseDsl.Screen) Model(org.applause.lang.applauseDsl.Model) NamedElement(org.applause.lang.applauseDsl.NamedElement)

Aggregations

Model (org.applause.lang.applauseDsl.Model)14 NamedElement (org.applause.lang.applauseDsl.NamedElement)14 Entity (org.applause.lang.applauseDsl.Entity)5 DataType (org.applause.lang.applauseDsl.DataType)3 Screen (org.applause.lang.applauseDsl.Screen)3 Attribute (org.applause.lang.applauseDsl.Attribute)2 DataSource (org.applause.lang.applauseDsl.DataSource)2 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)2 Test (org.junit.Test)2 AbsoluteRESTURL (org.applause.lang.applauseDsl.AbsoluteRESTURL)1 DataSourceAccessMethod (org.applause.lang.applauseDsl.DataSourceAccessMethod)1 DataSourceCall (org.applause.lang.applauseDsl.DataSourceCall)1 Platform (org.applause.lang.applauseDsl.Platform)1 PlatformMapping (org.applause.lang.applauseDsl.PlatformMapping)1 RESTSpecification (org.applause.lang.applauseDsl.RESTSpecification)1 RESTURL (org.applause.lang.applauseDsl.RESTURL)1 Type (org.applause.lang.applauseDsl.Type)1 TypeMapping (org.applause.lang.applauseDsl.TypeMapping)1 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)1