use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class PrecompiledHeaderGeneratorPrecompiledHeaderSpec method _headerFile.
/**
* @filter('''|.isGenerated.*)
*/
@Test
@Named("Header file")
@Order(1)
public void _headerFile() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("#import <Availability.h>");
_builder.newLine();
_builder.newLine();
_builder.append("#ifndef __IPHONE_3_0");
_builder.newLine();
_builder.append("#warning \"This project uses features only available in iOS SDK 3.0 and later.\"");
_builder.newLine();
_builder.append("#endif");
_builder.newLine();
_builder.newLine();
_builder.append("#ifdef __OBJC__");
_builder.newLine();
_builder.append(" ");
_builder.append("#import <UIKit/UIKit.h>");
_builder.newLine();
_builder.append(" ");
_builder.append("#import <Foundation/Foundation.h>");
_builder.newLine();
_builder.append("#endif\t");
_builder.newLine();
this.isGeneratedModuleFile(_builder);
}
use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class EntitiesDefiningEntitiesSpec method _simpleEntities.
/**
* Entities can be defined using the `entity` keyword.
* @filter('''|.isValid.*)
*/
@Test
@Named("Simple entities")
@Order(1)
public void _simpleEntities() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("entity Person {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this._entitiesValidationTestHelper.isValidEntity(_builder);
}
use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class EntitiesDefiningEntitiesSpec method _entityInheritance.
/**
* Entities can extend other entities.
* @filter('''|.isValid.*)
*/
@Test
@Named("Entity inheritance")
@Order(3)
public void _entityInheritance() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("entity Person {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.append("entity Employee extends Person {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this._entitiesValidationTestHelper.isValidEntityWithInheritance(_builder);
}
use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class EntityDataMappingGeneratorMappingEntitiesDataMappingCodeSpec 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.append("#import \"Person+DataMapping.h\"");
_builder.newLine();
_builder.newLine();
_builder.append("@implementation Person (DataMapping)");
_builder.newLine();
_builder.append("- (id)initWithAttributes:(NSDictionary *)attributes");
_builder.newLine();
_builder.append("{");
_builder.newLine();
_builder.append("\t");
_builder.append("self = [super init];");
_builder.newLine();
_builder.append("\t");
_builder.append("if (self) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("self.name = [attributes valueForKeyPath:@\"name\"];");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("return self;");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("- (NSDictionary *)attributes");
_builder.newLine();
_builder.append("{");
_builder.newLine();
_builder.append("\t");
_builder.append("NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init];");
_builder.newLine();
_builder.append("\t");
_builder.append("if (self.name != nil) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("attributes[@\"name\"] = self.name;");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("return attributes;");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.append("@end");
_builder.newLine();
this.isGeneratedModuleFileFromModel(_builder, "Person", this.simplePersonEntity);
}
use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class EntityGeneratorGeneratingEntitiesEntityInheritanceSpec 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.append("#import \"Creature.h\"");
_builder.newLine();
_builder.newLine();
_builder.append("@implementation Person");
_builder.newLine();
_builder.append("@end");
_builder.newLine();
this.isGeneratedModuleFileFromModel(_builder, "Person", this.inheritedPersonEntity);
}
Aggregations