[OLINGO-260] async tests
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/a1050e13 Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/a1050e13 Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/a1050e13 Branch: refs/heads/master Commit: a1050e13060099962d1bf7ce43f6b9f28df0c9a7 Parents: f17482a Author: Francesco Chicchiriccò <--global> Authored: Wed May 14 16:34:19 2014 +0200 Committer: Stephan Klevenz <[email protected]> Committed: Mon May 19 14:34:15 2014 +0200 ---------------------------------------------------------------------- .../olingo/fit/proxy/v3/AsyncTestITCase.java | 25 ++++++++++---------- .../olingo/fit/proxy/v4/AsyncTestITCase.java | 8 +++---- 2 files changed, 16 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1050e13/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java index 70346f7..3cd51bc 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AsyncTestITCase.java @@ -27,7 +27,7 @@ import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import org.apache.olingo.ext.proxy.api.AsyncCall; -import org.apache.olingo.ext.proxy.api.Filter; +import org.apache.olingo.ext.proxy.api.Query; import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Employee; import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types. EmployeeCollection; @@ -45,7 +45,7 @@ public class AsyncTestITCase extends AbstractTestITCase { @Test public void retrieveEntitySet() throws InterruptedException, ExecutionException { final Future<ProductCollection> futureProds = - new AsyncCall<ProductCollection>(containerFactory.getClient().getConfiguration()) { + new AsyncCall<ProductCollection>(containerFactory.getConfiguration()) { @Override public ProductCollection call() { @@ -73,7 +73,7 @@ public class AsyncTestITCase extends AbstractTestITCase { final Product product = container.getProduct().get(-10); product.setDescription("AsyncTest#updateEntity " + random); - final Future<Void> futureFlush = new AsyncCall<Void>(containerFactory.getClient().getConfiguration()) { + final Future<Void> futureFlush = new AsyncCall<Void>(containerFactory.getConfiguration()) { @Override public Void call() { @@ -87,7 +87,7 @@ public class AsyncTestITCase extends AbstractTestITCase { Thread.sleep(1000L); } - final Future<Product> futureProd = new AsyncCall<Product>(containerFactory.getClient().getConfiguration()) { + final Future<Product> futureProd = new AsyncCall<Product>(containerFactory.getConfiguration()) { @Override public Product call() { @@ -100,23 +100,22 @@ public class AsyncTestITCase extends AbstractTestITCase { @Test public void polymorphQuery() throws Exception { - final Future<Filter<Employee, EmployeeCollection>> queryEmployee = - new AsyncCall<Filter<Employee, EmployeeCollection>>(containerFactory.getClient().getConfiguration()) { + final Future<Query<Employee, EmployeeCollection>> queryEmployee = + new AsyncCall<Query<Employee, EmployeeCollection>>(containerFactory.getConfiguration()) { @Override - public Filter<Employee, EmployeeCollection> call() { - return container.getPerson().createFilter(EmployeeCollection.class); + public Query<Employee, EmployeeCollection> call() { + return container.getPerson().createQuery(EmployeeCollection.class); } }; assertFalse(queryEmployee.get().getResult().isEmpty()); - final Future<Filter<SpecialEmployee, SpecialEmployeeCollection>> querySpecialEmployee = - new AsyncCall<Filter<SpecialEmployee, SpecialEmployeeCollection>>( - containerFactory.getClient().getConfiguration()) { + final Future<Query<SpecialEmployee, SpecialEmployeeCollection>> querySpecialEmployee = + new AsyncCall<Query<SpecialEmployee, SpecialEmployeeCollection>>(containerFactory.getConfiguration()) { @Override - public Filter<SpecialEmployee, SpecialEmployeeCollection> call() { - return container.getPerson().createFilter(SpecialEmployeeCollection.class); + public Query<SpecialEmployee, SpecialEmployeeCollection> call() { + return container.getPerson().createQuery(SpecialEmployeeCollection.class); } }; assertFalse(querySpecialEmployee.get().getResult().isEmpty()); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1050e13/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java ---------------------------------------------------------------------- diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java index 3295824..f5f4561 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AsyncTestITCase.java @@ -37,7 +37,7 @@ public class AsyncTestITCase extends AbstractTestITCase { @Test public void retrieveEntitySet() throws InterruptedException, ExecutionException { final Future<CustomerCollection> futureCustomers = - new AsyncCall<CustomerCollection>(containerFactory.getClient().getConfiguration()) { + new AsyncCall<CustomerCollection>(containerFactory.getConfiguration()) { @Override public CustomerCollection call() { @@ -60,12 +60,12 @@ public class AsyncTestITCase extends AbstractTestITCase { @Test public void updateEntity() throws InterruptedException { - final String randomFirstName = RandomStringUtils.random(10, "abcedfghijklmnopqrstuvwxyz"); + final String randomFirstName = RandomStringUtils.random(10); Person person = container.getPeople().get(1); person.setFirstName(randomFirstName); - final Future<Void> futureFlush = new AsyncCall<Void>(containerFactory.getClient().getConfiguration()) { + final Future<Void> futureFlush = new AsyncCall<Void>(containerFactory.getConfiguration()) { @Override public Void call() { @@ -79,7 +79,7 @@ public class AsyncTestITCase extends AbstractTestITCase { Thread.sleep(1000L); } - final Future<Person> futureProd = new AsyncCall<Person>(containerFactory.getClient().getConfiguration()) { + final Future<Person> futureProd = new AsyncCall<Person>(containerFactory.getConfiguration()) { @Override public Person call() {
