Search in sources :

Example 81 with StringConcatenation

use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.

the class EntityGeneratorGeneratingEntitiesSimpleEntitiesSpec method _implementationFile.

/**
   * @filter('''|.isGenerated.*)
   */
@Test
@Named("Implementation file")
@Order(2)
public void _implementationFile() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("#import \"Person.h\"");
    _builder.newLine();
    _builder.newLine();
    _builder.append("@implementation Person");
    _builder.newLine();
    _builder.append("@end");
    _builder.newLine();
    this.isGeneratedModuleFileFromModel(_builder, "Person", this.simplePersonEntity);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 82 with StringConcatenation

use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.

the class EntityGeneratorGeneratingEntitiesEntityInheritanceSpec method _headerFile.

/**
   * @filter('''|.isGenerated.*)
   */
@Test
@Named("Header File")
@Order(1)
public void _headerFile() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("#import <Foundation/Foundation.h>");
    _builder.newLine();
    _builder.newLine();
    _builder.append("@class Creature;");
    _builder.newLine();
    _builder.newLine();
    _builder.append("@interface Person : Creature");
    _builder.newLine();
    _builder.append("@end");
    _builder.newLine();
    this.isGeneratedHeaderFileFromModel(_builder, "Person", this.inheritedPersonEntity);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 83 with StringConcatenation

use of org.eclipse.xtend2.lib.StringConcatenation 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 84 with StringConcatenation

use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.

the class APIClientGeneratorEntityAPIClientAPIClientCodeSpec method _headerFile.

/**
   * @filter('''|.isGenerated.*)
   */
@Test
@Named("Header File")
@Order(1)
public void _headerFile() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("#import <Foundation/Foundation.h>");
    _builder.newLine();
    _builder.append("#import \"AFHTTPSessionManager.h\"");
    _builder.newLine();
    _builder.newLine();
    _builder.append("@interface PersonAPIClient : AFHTTPSessionManager");
    _builder.newLine();
    _builder.append("+ (PersonAPIClient *)sharedClient;");
    _builder.newLine();
    _builder.append("@end");
    _builder.newLine();
    this.isGeneratedHeaderFileFromModel(_builder, "Person", this.simplePersonEntity);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 85 with StringConcatenation

use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.

the class ScalarDataTypesPlatformMappingSpec method _definingPlatforms.

/**
   * The `platform` keyword can be used to define a platform.
   * @filter('''|.hasPlatform.*)
   */
@Test
@Named("Defining platforms")
@Order(1)
public void _definingPlatforms() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("platform iOS {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("// platform-specific configurations");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this._scalarDataTypesValidationTestHelper.hasPlatform(_builder, "iOS");
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Aggregations

StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)4966 Test (org.junit.Test)4419 AbstractXtendCompilerTest (org.eclipse.xtend.core.tests.compiler.AbstractXtendCompilerTest)1231 XtendFile (org.eclipse.xtend.core.xtend.XtendFile)372 AbstractXtendFormatterTest (org.eclipse.xtend.core.tests.formatting.AbstractXtendFormatterTest)214 AbstractXtendContentAssistBugTest (org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest)183 ContentAssistProcessorTestBuilder (org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder)182 XtendMember (org.eclipse.xtend.core.xtend.XtendMember)131 CompilationUnitImpl (org.eclipse.xtend.core.macro.declaration.CompilationUnitImpl)130 XtendClass (org.eclipse.xtend.core.xtend.XtendClass)129 IFile (org.eclipse.core.resources.IFile)122 QuickfixTestBuilder (org.eclipse.xtend.ide.tests.quickfix.QuickfixTestBuilder)122 AmbiguityValidationTest (org.eclipse.xtend.core.tests.validation.AmbiguityValidationTest)118 XtendFunction (org.eclipse.xtend.core.xtend.XtendFunction)115 Grammar (org.eclipse.xtext.Grammar)101 EObject (org.eclipse.emf.ecore.EObject)99 MapBasedPreferenceValues (org.eclipse.xtext.preferences.MapBasedPreferenceValues)99 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)99 MutableClassDeclaration (org.eclipse.xtend.lib.macro.declaration.MutableClassDeclaration)97 AbstractRule (org.eclipse.xtext.AbstractRule)96