Package org.applause.lang.applauseDsl

Examples of org.applause.lang.applauseDsl.Model


 
  private Entity entity(final CharSequence input, final String entityName) {
    try {
      Entity _xblockexpression = null;
      {
        final Model model = this._parseHelper.parse(input);
        EList<NamedElement> _elements = model.getElements();
        Iterable<Entity> _filter = Iterables.<Entity>filter(_elements, Entity.class);
        final Function1<Entity,Boolean> _function = new Function1<Entity,Boolean>() {
          public Boolean apply(final Entity it) {
            String _name = it.getName();
            boolean _equals = Objects.equal(_name, entityName);
View Full Code Here


 
  private DataSource datasource(final CharSequence input, final String datasourceName) {
    try {
      DataSource _xblockexpression = null;
      {
        final Model model = this._parseHelper.parse(input);
        EList<NamedElement> _elements = model.getElements();
        Iterable<DataSource> _filter = Iterables.<DataSource>filter(_elements, DataSource.class);
        final Function1<DataSource,Boolean> _function = new Function1<DataSource,Boolean>() {
          public Boolean apply(final DataSource it) {
            String _name = it.getName();
            boolean _equals = Objects.equal(_name, datasourceName);
View Full Code Here

 
  private Entity entity(final CharSequence input, final String entityName) {
    try {
      Entity _xblockexpression = null;
      {
        final Model model = this._parseHelper.parse(input);
        EList<NamedElement> _elements = model.getElements();
        Iterable<Entity> _filter = Iterables.<Entity>filter(_elements, Entity.class);
        final Function1<Entity,Boolean> _function = new Function1<Entity,Boolean>() {
          public Boolean apply(final Entity it) {
            String _name = it.getName();
            boolean _equals = Objects.equal(_name, entityName);
View Full Code Here

@RunWith(ExampleGroupRunner.class)
@SuppressWarnings("all")
public class RESTURLsRelativeRESTURLsSpec extends RESTURLsSpec {
  public void dataSourceAccessMethodUrlShouldBe(final CharSequence sequence, final String url) {
    try {
      final Model model = this._parseHelper.parse(sequence);
      EList<NamedElement> _elements = model.getElements();
      Iterable<DataSource> _filter = Iterables.<DataSource>filter(_elements, DataSource.class);
      final DataSource datasource = IterableExtensions.<DataSource>head(_filter);
      EList<DataSourceAccessMethod> _methods = datasource.getMethods();
      final DataSourceAccessMethod method = IterableExtensions.<DataSourceAccessMethod>head(_methods);
      RESTSpecification _restSpecification = method.getRestSpecification();
View Full Code Here

  @Extension
  private ParseHelper<Model> _parseHelper;
 
  public void isValidEntity(final CharSequence sequence) {
    try {
      final Model model = this._parseHelper.parse(sequence);
      EList<NamedElement> _elements = model.getElements();
      NamedElement _head = IterableExtensions.<NamedElement>head(_elements);
      final Entity entity = ((Entity) _head);
      String _name = entity.getName();
      Assert.assertNotNull(_name);
    } catch (Throwable _e) {
View Full Code Here

    }
  }
 
  public void hasDuplicateEntity(final CharSequence sequence) {
    try {
      Model _parse = this._parseHelper.parse(sequence);
      EClass _entity = ApplauseDslPackage.eINSTANCE.getEntity();
      this.assertError(_parse, _entity, null, "Duplicate NamedElement \'Person\'");
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
View Full Code Here

    }
  }
 
  public void isValidEntityWithInheritance(final CharSequence sequence) {
    try {
      final Model model = this._parseHelper.parse(sequence);
      EList<NamedElement> _elements = model.getElements();
      NamedElement _head = IterableExtensions.<NamedElement>head(_elements);
      final Entity person = ((Entity) _head);
      EList<NamedElement> _elements_1 = model.getElements();
      NamedElement _last = IterableExtensions.<NamedElement>last(_elements_1);
      final Entity employee = ((Entity) _last);
      Entity _superType = employee.getSuperType();
      Matcher<Entity> _is = CoreMatchers.<Entity>is(person);
      Assert.<Entity>assertThat(_superType, _is);
View Full Code Here

    }
  }
 
  public void isValidAbstractEntityWithInheritance(final CharSequence sequence) {
    try {
      final Model model = this._parseHelper.parse(sequence);
      EList<NamedElement> _elements = model.getElements();
      NamedElement _head = IterableExtensions.<NamedElement>head(_elements);
      final Entity person = ((Entity) _head);
      EList<NamedElement> _elements_1 = model.getElements();
      NamedElement _last = IterableExtensions.<NamedElement>last(_elements_1);
      final Entity employee = ((Entity) _last);
      boolean _isAbstract = person.isAbstract();
      Matcher<Boolean> _is = CoreMatchers.<Boolean>is(Boolean.valueOf(true));
      Assert.<Boolean>assertThat(Boolean.valueOf(_isAbstract), _is);
View Full Code Here

    }
  }
 
  public void isValidEntityWithAttributes(final CharSequence sequence) {
    try {
      final Model model = this._parseHelper.parse(sequence);
      EList<NamedElement> _elements = model.getElements();
      Iterable<Entity> _filter = Iterables.<Entity>filter(_elements, Entity.class);
      final Entity entity = IterableExtensions.<Entity>head(_filter);
      final EList<Attribute> attributes = entity.getAttributes();
      int _size = attributes.size();
      Matcher<Integer> _is = CoreMatchers.<Integer>is(Integer.valueOf(2));
      Assert.<Integer>assertThat(Integer.valueOf(_size), _is);
      EList<NamedElement> _elements_1 = model.getElements();
      final Function1<NamedElement,Boolean> _function = new Function1<NamedElement,Boolean>() {
        public Boolean apply(final NamedElement it) {
          String _name = it.getName();
          boolean _equals = Objects.equal(_name, "Date");
          return Boolean.valueOf(_equals);
        }
      };
      final NamedElement dateType = IterableExtensions.<NamedElement>findFirst(_elements_1, _function);
      EList<NamedElement> _elements_2 = model.getElements();
      final Function1<NamedElement,Boolean> _function_1 = new Function1<NamedElement,Boolean>() {
        public Boolean apply(final NamedElement it) {
          String _name = it.getName();
          boolean _equals = Objects.equal(_name, "String");
          return Boolean.valueOf(_equals);
View Full Code Here

    }
  }
 
  public void isValidEntityWithOneToManyRelationship(final CharSequence sequence) {
    try {
      final Model model = this._parseHelper.parse(sequence);
      EList<NamedElement> _elements = model.getElements();
      Iterable<Entity> _filter = Iterables.<Entity>filter(_elements, Entity.class);
      final Entity person = IterableExtensions.<Entity>head(_filter);
      EList<Attribute> _attributes = person.getAttributes();
      final Attribute friends = IterableExtensions.<Attribute>head(_attributes);
      boolean _isMany = friends.isMany();
View Full Code Here

TOP

Related Classes of org.applause.lang.applauseDsl.Model

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.