use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class RESTURLsRelativeRESTURLsSpec method dataSourceAccessMethodUrlShouldBe.
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();
RESTURL _path = _restSpecification.getPath();
String _value = this._rESTURLExtensions.value(_path);
Matcher<String> _is = CoreMatchers.<String>is(url);
Assert.<String>assertThat(_value, _is);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class EntityDataAccessGeneratorSpec method isGeneratedModuleFileFromModel.
public void isGeneratedModuleFileFromModel(final CharSequence expectedGeneratedCode, final String dataSourceName, final CharSequence input) {
final DataSource datasource = this.datasource(input, dataSourceName);
final CharSequence result = this._entityDataAccessModuleFileCompiler.compileModuleFile(datasource);
String _string = result.toString();
String _string_1 = expectedGeneratedCode.toString();
Matcher<String> _equalTo = CoreMatchers.<String>equalTo(_string_1);
Assert.<String>assertThat(_string, _equalTo);
}
use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForCreate.
public String dataAccessMethodNameForCreate(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.POST);
return Boolean.valueOf(_equals);
}
};
DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
String _name = _findFirst.getName();
return _name;
}
use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForUpdate.
public String dataAccessMethodNameForUpdate(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.PUT);
return Boolean.valueOf(_equals);
}
};
DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
String _name = _findFirst.getName();
return _name;
}
use of org.applause.lang.applauseDsl.DataSource in project applause by applause.
the class DataSourceCallImpl method setDatasource.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDatasource(DataSource newDatasource) {
DataSource oldDatasource = datasource;
datasource = newDatasource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ApplauseDslPackage.DATA_SOURCE_CALL__DATASOURCE, oldDatasource, datasource));
}
Aggregations