Search in sources :

Example 11 with Order

use of org.jnario.runner.Order 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);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 12 with Order

use of org.jnario.runner.Order 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);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 13 with Order

use of org.jnario.runner.Order 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);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 14 with Order

use of org.jnario.runner.Order 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);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 15 with Order

use of org.jnario.runner.Order 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)

Aggregations

StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)35 Named (org.jnario.runner.Named)35 Order (org.jnario.runner.Order)35 Test (org.junit.Test)35