You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@batchee.apache.org by rm...@apache.org on 2015/03/22 16:11:02 UTC
incubator-batchee git commit: assert for start properties
Repository: incubator-batchee
Updated Branches:
refs/heads/master 9868a839d -> e2db9619b
assert for start properties
Project: http://git-wip-us.apache.org/repos/asf/incubator-batchee/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-batchee/commit/e2db9619
Tree: http://git-wip-us.apache.org/repos/asf/incubator-batchee/tree/e2db9619
Diff: http://git-wip-us.apache.org/repos/asf/incubator-batchee/diff/e2db9619
Branch: refs/heads/master
Commit: e2db9619bb389e23a8740a94c722df361d95fa55
Parents: 9868a83
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Sun Mar 22 16:10:53 2015 +0100
Committer: Romain Manni-Bucau <rm...@apache.org>
Committed: Sun Mar 22 16:10:53 2015 +0100
----------------------------------------------------------------------
gui/jaxrs/jaxrs-client/pom.xml | 2 +-
.../apache/batchee/jaxrs/client/ClientTestBase.java | 16 ++++++++++++++--
2 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/e2db9619/gui/jaxrs/jaxrs-client/pom.xml
----------------------------------------------------------------------
diff --git a/gui/jaxrs/jaxrs-client/pom.xml b/gui/jaxrs/jaxrs-client/pom.xml
index 72ce2f8..b99734f 100644
--- a/gui/jaxrs/jaxrs-client/pom.xml
+++ b/gui/jaxrs/jaxrs-client/pom.xml
@@ -61,7 +61,7 @@
<dependency>
<groupId>com.github.rmannibucau</groupId>
<artifactId>featured-mock</artifactId>
- <version>0.3</version>
+ <version>0.4</version>
<scope>test</scope>
</dependency>
<dependency> <!-- cxf is not yet compatible with JAXRS 2.0 API (final) -->
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/e2db9619/gui/jaxrs/jaxrs-client/src/test/java/org/apache/batchee/jaxrs/client/ClientTestBase.java
----------------------------------------------------------------------
diff --git a/gui/jaxrs/jaxrs-client/src/test/java/org/apache/batchee/jaxrs/client/ClientTestBase.java b/gui/jaxrs/jaxrs-client/src/test/java/org/apache/batchee/jaxrs/client/ClientTestBase.java
index d7c0cec..4fd671d 100644
--- a/gui/jaxrs/jaxrs-client/src/test/java/org/apache/batchee/jaxrs/client/ClientTestBase.java
+++ b/gui/jaxrs/jaxrs-client/src/test/java/org/apache/batchee/jaxrs/client/ClientTestBase.java
@@ -18,6 +18,8 @@ package org.apache.batchee.jaxrs.client;
import com.github.rmannibucau.featuredmock.http.FeaturedHttpServer;
import com.github.rmannibucau.featuredmock.http.FeaturedHttpServerBuilder;
+import com.github.rmannibucau.featuredmock.http.RequestObserver;
+import io.netty.handler.codec.http.FullHttpRequest;
import org.apache.batchee.jaxrs.client.impl.JobInstanceImpl;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
@@ -45,7 +47,15 @@ public abstract class ClientTestBase {
@BeforeClass
public static void startServer() throws IOException {
- mockServer = new FeaturedHttpServerBuilder().port(-1).build().start();
+ mockServer = new FeaturedHttpServerBuilder().port(-1).observer(new RequestObserver() {
+ @Override
+ public void onRequest(final FullHttpRequest request) {
+ if (request.getUri().endsWith("start/simple")) {
+ final String actual = new String(request.content().array());
+ assertEquals(actual, "{\"entries\":[{\"key\":\"a\",\"value\":\"b\"}]}");
+ }
+ }
+ }).build().start();
port = mockServer.getPort();
RuntimeDelegate.setInstance(null); // reset
}
@@ -64,7 +74,9 @@ public abstract class ClientTestBase {
@Test
public void start() {
- assertEquals(1L, client.start("simple", new Properties()));
+ assertEquals(1L, client.start("simple", new Properties() {{
+ setProperty("a", "b");
+ }}));
}
@Test