Search in sources :

Example 11 with NamedElement

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

the class ScalarDataTypesValidationTestHelper method hasPlatformTypeMapping.

public void hasPlatformTypeMapping(final CharSequence sequence, final String typeName, final String mappedName) {
    try {
        final Model model = this._parseHelper.parse(sequence);
        EList<NamedElement> _elements = model.getElements();
        Iterable<Platform> _filter = Iterables.<Platform>filter(_elements, Platform.class);
        final Platform platform = IterableExtensions.<Platform>head(_filter);
        EList<PlatformMapping> _mappings = platform.getMappings();
        PlatformMapping _head = IterableExtensions.<PlatformMapping>head(_mappings);
        final TypeMapping platformMapping = ((TypeMapping) _head);
        DataType _type = platformMapping.getType();
        String _name = _type.getName();
        Matcher<String> _is = CoreMatchers.<String>is("String");
        Assert.<String>assertThat(_name, _is);
        String _simpleName = platformMapping.getSimpleName();
        Matcher<String> _is_1 = CoreMatchers.<String>is("NSString");
        Assert.<String>assertThat(_simpleName, _is_1);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : Platform(org.applause.lang.applauseDsl.Platform) PlatformMapping(org.applause.lang.applauseDsl.PlatformMapping) Model(org.applause.lang.applauseDsl.Model) TypeMapping(org.applause.lang.applauseDsl.TypeMapping) DataType(org.applause.lang.applauseDsl.DataType) NamedElement(org.applause.lang.applauseDsl.NamedElement)

Example 12 with NamedElement

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

the class EntitiesValidationTestHelper method isValidEntity.

public void isValidEntity(final CharSequence sequence) {
    try {
        final Model model = this._parseHelper.parse(sequence);
        EList<NamedElement> _elements = model.getElements();
        NamedElement _head = IterableExtensions.<NamedElement>head(_elements);
        final Entity entity = ((Entity) _head);
        String _name = entity.getName();
        Assert.assertNotNull(_name);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : Entity(org.applause.lang.applauseDsl.Entity) Model(org.applause.lang.applauseDsl.Model) NamedElement(org.applause.lang.applauseDsl.NamedElement)

Example 13 with NamedElement

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

the class RESTURLsAbsoluteRESTURLsSpec method baseUrlShouldBe.

public void baseUrlShouldBe(final CharSequence sequence, final String url) {
    try {
        final Model model = this._parseHelper.parse(sequence);
        EList<NamedElement> _elements = model.getElements();
        Iterable<DataSource> _filter = Iterables.<DataSource>filter(_elements, DataSource.class);
        final DataSource datasource = IterableExtensions.<DataSource>head(_filter);
        final AbsoluteRESTURL baseUrl = datasource.getBaseUrl();
        String _value = this._rESTURLExtensions.value(baseUrl);
        Matcher<String> _is = CoreMatchers.<String>is(url);
        Assert.<String>assertThat(_value, _is);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : Model(org.applause.lang.applauseDsl.Model) NamedElement(org.applause.lang.applauseDsl.NamedElement) DataSource(org.applause.lang.applauseDsl.DataSource) AbsoluteRESTURL(org.applause.lang.applauseDsl.AbsoluteRESTURL)

Example 14 with NamedElement

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

the class ScreensValidationTestHelper method isValidScreen.

public void isValidScreen(final CharSequence sequence) {
    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 _name = screen.getName();
        Assert.assertNotNull(_name);
    } 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