Search in sources :

Example 1 with Named

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

the class EntitiesDefiningEntitiesSpec method _entityAttributes.

/**
   * Entities can have any number of attributes. Attribute types refer to `datatype`s or other
   * `entity`s.
   * @filter('''|.isValid.*)
   */
@Test
@Named("Entity attributes")
@Order(5)
public void _entityAttributes() throws Exception {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("datatype String");
    _builder.newLine();
    _builder.append("datatype Date");
    _builder.newLine();
    _builder.append("entity Person {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("String name");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("Date birthdate");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this._entitiesValidationTestHelper.isValidEntityWithAttributes(_builder);
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 2 with Named

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

the class RESTURLsAbsoluteRESTURLsSpec method _simpleAbsoluteRESTURLSWithPort.

/**
   * An absolute REST URL can contain a port.
   * @filter('''|.baseUrlShouldBe.*)
   */
@Test
@Named("Simple absolute REST URLS with port")
@Order(2)
public void _simpleAbsoluteRESTURLSWithPort() 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://localhost:2403/persons");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("resource: Person");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this.baseUrlShouldBe(_builder, "http://localhost:2403/persons");
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 3 with Named

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

the class RESTURLsAbsoluteRESTURLsSpec method _simpleAbsoluteRESTURLS.

/**
   * Absolute REST URLs start with `http://`, continue with a hostname, and end with a resource path
   * @filter('''|.baseUrlShouldBe.*)
   */
@Test
@Named("Simple absolute REST URLS")
@Order(1)
public void _simpleAbsoluteRESTURLS() 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://localhost/persons");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("resource: Person");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this.baseUrlShouldBe(_builder, "http://localhost/persons");
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 4 with Named

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

the class RESTURLsRelativeRESTURLsSpec method _simpleRelativeRESTURL.

/**
   * Relative REST URLs start with `/`, and continue with a resource path
   * @filter('''|.dataSourceAccessMethodUrlShouldBe.*)
   */
@Test
@Named("Simple relative REST URL")
@Order(1)
public void _simpleRelativeRESTURL() 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://localhost/persons");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("resource: Person");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("post(Person person) GET /persons");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this.dataSourceAccessMethodUrlShouldBe(_builder, "/persons");
}
Also used : StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Order(org.jnario.runner.Order) Named(org.jnario.runner.Named) Test(org.junit.Test)

Example 5 with Named

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

the class RESTURLsRelativeRESTURLsSpec method _moreComplexRelativeRESTURL.

/**
   * Relative REST URLs start with `/`, and continue with a resource path
   * @filter('''|.dataSourceAccessMethodUrlShouldBe.*)
   */
@Test
@Named("More complex relative REST URL")
@Order(2)
public void _moreComplexRelativeRESTURL() 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://localhost/persons");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("resource: Person");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("post(Person person) GET /boo/bar/baz/persons");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this.dataSourceAccessMethodUrlShouldBe(_builder, "/boo/bar/baz/persons");
}
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