Search in sources :

Example 31 with Order

use of org.jnario.runner.Order in project applause by applause.

the class EntitiesDefiningEntitiesSpec method _propertyCardinality.

/**
   * Properties can have an optional cardinality, so you can express 1:n relationships.
   * @filter('''|.isValid.*)
   */
@Test
@Named("Property cardinality")
@Order(6)
public void _propertyCardinality() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("entity Person {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("Person[] friends");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this._entitiesValidationTestHelper.isValidEntityWithOneToManyRelationship(_builder);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 32 with Order

use of org.jnario.runner.Order in project applause by applause.

the class EntitiesDefiningEntitiesSpec method _entitiesMustBeUnique.

/**
   * Entities must be unique. Currently, this means they must be unique across the board and __cannot__
   * be namespaced.
   * @filter('''|.hasDuplicateDatatype)
   */
@Test
@Named("Entities must be unique")
@Order(2)
public void _entitiesMustBeUnique() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("entity Person");
    _builder.newLine();
    _builder.append("entity Person // <-- invalid");
    _builder.newLine();
    this._entitiesValidationTestHelper.hasDuplicateEntity(_builder);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 33 with Order

use of org.jnario.runner.Order in project applause by applause.

the class RESTURLsAbsoluteRESTURLsSpec method _absoluteRESTURLWithFullDomainNamePortAndDeepPath.

/**
   * An absolute REST URL can have a full domain name, a port and a deep path.
   * @filter('''|.baseUrlShouldBe.*)
   */
@Test
@Named("Absolute REST URL with full domain name, port and deep path")
@Order(3)
public void _absoluteRESTURLWithFullDomainNamePortAndDeepPath() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("entity Person {}");
    _builder.newLine();
    _builder.append("datasource PersonDataSource {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("baseUrl: http://www.foobar.com:2403/foo/bar/baz");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("resource: Person");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this.baseUrlShouldBe(_builder, "http://www.foobar.com:2403/foo/bar/baz");
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 34 with Order

use of org.jnario.runner.Order in project applause by applause.

the class ScalarDataTypesDefiningDataTypesSpec method _simpleDataTypes.

/**
   * New data types can be defined using the `datatype` keyword.
   * @filter('''|.isValid)
   */
@Test
@Named("Simple data types")
@Order(1)
public void _simpleDataTypes() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("datatype String");
    _builder.newLine();
    _builder.append("datatype Integer");
    _builder.newLine();
    this._applauseValidationTestHelper.isValid(_builder);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 35 with Order

use of org.jnario.runner.Order in project applause by applause.

the class ScreensDefiningScreensSpec method _screensCanHaveAnOptionalTitle.

/**
   * Screens can have an optional title, which will be displayed in the title area of a screen.
   * @filter('''|.hasTitle.*)
   */
@Test
@Named("Screens can have an optional title")
@Order(3)
public void _screensCanHaveAnOptionalTitle() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("screen DefaultList PersonList {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("title = \"Persons\"");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this._screensValidationTestHelper.hasTitle(_builder, "Person");
}
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