Search in sources :

Example 1 with DataType

use of org.applause.lang.applauseDsl.DataType 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 2 with DataType

use of org.applause.lang.applauseDsl.DataType 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 3 with DataType

use of org.applause.lang.applauseDsl.DataType 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 4 with DataType

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

the class TypeMappingImpl method setType.

/**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
public void setType(DataType newType) {
    DataType oldType = type;
    type = newType;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ApplauseDslPackage.TYPE_MAPPING__TYPE, oldType, type));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) DataType(org.applause.lang.applauseDsl.DataType)

Aggregations

DataType (org.applause.lang.applauseDsl.DataType)4 Model (org.applause.lang.applauseDsl.Model)3 NamedElement (org.applause.lang.applauseDsl.NamedElement)3 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)2 Test (org.junit.Test)2 Platform (org.applause.lang.applauseDsl.Platform)1 PlatformMapping (org.applause.lang.applauseDsl.PlatformMapping)1 TypeMapping (org.applause.lang.applauseDsl.TypeMapping)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1