();
+ listeners = new ArrayList<>();
}
listeners.add(listener);
}
diff --git a/integ-kinesis/.gitignore b/integ-kinesis/.gitignore
new file mode 100644
index 0000000..63e2211
--- /dev/null
+++ b/integ-kinesis/.gitignore
@@ -0,0 +1,4 @@
+/target
+/target/
+/target/
+/dependency-reduced-pom.xml
diff --git a/integ-kinesis/pom.xml b/integ-kinesis/pom.xml
new file mode 100644
index 0000000..37d125e
--- /dev/null
+++ b/integ-kinesis/pom.xml
@@ -0,0 +1,41 @@
+
+
+ 4.0.0
+ integ-kinesis
+
+ il.co.topq.integframework
+ integ-parent
+ 1.0.5-SNAPSHOT
+ ../integ-parent
+
+
+
+ com.amazonaws
+ amazon-kinesis-client
+ 1.2.0
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 2.3
+
+
+ package
+ shade
+
+
+
+ org.apache.http
+ org.xapachex.http
+
+
+
+
+
+
+
+
+
diff --git a/integ-parent/pom.xml b/integ-parent/pom.xml
index 137c17a..4a70076 100644
--- a/integ-parent/pom.xml
+++ b/integ-parent/pom.xml
@@ -1,9 +1,9 @@
-
+
+
4.0.0
il.co.topq.integframework
integ-parent
- 1.0.1-SNAPSHOT
+ 1.0.5-SNAPSHOT
pom
UTF-8
@@ -11,14 +11,23 @@
http://maven.top-q.co.il
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.18
+
+
+
org.apache.maven.plugins
maven-compiler-plugin
2.5.1
- 1.6
- 1.6
+ 1.7
+ 1.7
@@ -80,5 +89,11 @@
../integ-hdfs
../integ-support
../integ-rest
+ ../integ-wget
+ ../integ-archetype
+ ../integ-kinesis
-
\ No newline at end of file
+
+ scm:git:https://github.com/aharonha/integ-framework
+
+
diff --git a/integ-rest/.gitignore b/integ-rest/.gitignore
new file mode 100644
index 0000000..d2d9c31
--- /dev/null
+++ b/integ-rest/.gitignore
@@ -0,0 +1,3 @@
+/target
+/target/
+/target/
diff --git a/integ-rest/pom.xml b/integ-rest/pom.xml
index 06af590..dfe76f1 100644
--- a/integ-rest/pom.xml
+++ b/integ-rest/pom.xml
@@ -1,17 +1,18 @@
+
4.0.0
il.co.topq.integframework
integ-parent
- 1.0.1-SNAPSHOT
- ../../integ/integ-parent
+ 1.0.5-SNAPSHOT
+ ../integ-parent
integ-rest
il.co.topq.integframework
integ-testng
- ${project.version}
+ 1.0.5-SNAPSHOT
org.codehaus.jettison
@@ -26,4 +27,4 @@
provided
-
\ No newline at end of file
+
diff --git a/integ-rest/src/main/java/il/co/topq/integframework/rest/RESTClientModule.java b/integ-rest/src/main/java/il/co/topq/integframework/rest/RESTClientModule.java
index bbc01c9..4619c89 100644
--- a/integ-rest/src/main/java/il/co/topq/integframework/rest/RESTClientModule.java
+++ b/integ-rest/src/main/java/il/co/topq/integframework/rest/RESTClientModule.java
@@ -1,10 +1,15 @@
package il.co.topq.integframework.rest;
import static com.sun.jersey.api.client.Client.create;
+
+import javax.ws.rs.core.MediaType;
+
import il.co.topq.integframework.AbstractModuleImpl;
import il.co.topq.integframework.reporting.Reporter;
import il.co.topq.integframework.reporting.Reporter.Color;
+import il.co.topq.integframework.reporting.Reporter.Style;
+import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import com.sun.jersey.api.client.ClientResponse;
@@ -13,8 +18,7 @@ public class RESTClientModule extends AbstractModuleImpl {
String uri;
public ClientResponse post(JSONObject input, String action) throws Exception {
- Reporter.log("Request", Color.BLUE);
- Reporter.log("\n" + input.toString() + "
\n");
+ Reporter.log("Request", action + "\nBody:" + input.toString(3), Style.PLAINTEXT);
StringBuilder builder = new StringBuilder(uri);
if (!uri.endsWith("/")) {
builder.append("/");
@@ -24,8 +28,61 @@ public ClientResponse post(JSONObject input, String action) throws Exception {
.accept("application/json").post(ClientResponse.class, input);
setActual(clientResponse.getEntity(String.class));
- Reporter.log("Response", Color.BLUE);
- Reporter.log("\n" + getActual(String.class) + "
\n");
+ try {
+ JSONObject response = new JSONObject(getActual(String.class));
+ Reporter.log("Response", response.toString(3), Style.PLAINTEXT);
+ } catch (JSONException e) {
+ Reporter.log("Response", getActual(String.class), Style.PLAINTEXT);// should
+ // never
+ // happen!!
+ }
+
+ return clientResponse;
+ }
+
+ public ClientResponse post(String postData,MediaType postDataMediaType, String action) throws Exception {
+ Reporter.log("Request", action + "\nBody:" + postData, Style.PLAINTEXT);
+ StringBuilder builder = new StringBuilder(uri);
+ if (!uri.endsWith("/")) {
+ builder.append("/");
+ }
+ builder.append(action);
+ ClientResponse clientResponse = create().resource(builder.toString()).type(postDataMediaType)
+ .accept("application/json").post(ClientResponse.class, postData);
+
+ setActual(clientResponse.getEntity(String.class));
+ try {
+ JSONObject response = new JSONObject(getActual(String.class));
+ Reporter.log("Response", response.toString(3), Style.PLAINTEXT);
+ } catch (JSONException e) {
+ Reporter.log("Response", getActual(String.class), Style.PLAINTEXT);
+ // should never happen!!
+ }
+
+ return clientResponse;
+ }
+
+
+ public ClientResponse get(String action) throws Exception {
+ Reporter.log("Request", action, Style.PLAINTEXT);
+ StringBuilder builder = new StringBuilder(uri);
+ if (!uri.endsWith("/")) {
+ builder.append("/");
+ }
+ builder.append(action);
+ ClientResponse clientResponse = create().resource(builder.toString()).accept("application/json")
+ .get(ClientResponse.class);
+
+ setActual(clientResponse.getEntity(String.class));
+ try {
+ JSONObject response = new JSONObject(getActual(String.class));
+ Reporter.log("Response", response.toString(3), Style.PLAINTEXT);
+ } catch (JSONException e) {
+ Reporter.log("Response", getActual(String.class), Style.PLAINTEXT);// should
+ // never
+ // happen!!
+ }
+
return clientResponse;
}
@@ -39,7 +96,7 @@ public void setUri(String uri) {
public ClientResponse put(JSONObject input, String action) {
Reporter.log("Request", Color.BLUE);
- Reporter.log("\n" + input.toString() + "
\n");
+ Reporter.log(input.toString(), Style.PLAINTEXT);
StringBuilder builder = new StringBuilder(uri);
if (!uri.endsWith("/")) {
builder.append("/");
@@ -50,7 +107,7 @@ public ClientResponse put(JSONObject input, String action) {
setActual(clientResponse.getEntity(String.class));
Reporter.log("Response", Color.BLUE);
- Reporter.log("\n" + getActual(String.class) + "
\n");
+ Reporter.log(getActual(String.class), Style.PLAINTEXT);
return clientResponse;
}
diff --git a/integ-rest/src/main/java/il/co/topq/integframework/rest/TomcatRESTApplicationContainer.java b/integ-rest/src/main/java/il/co/topq/integframework/rest/TomcatRESTApplicationContainer.java
index 5da7e56..2d4b27d 100644
--- a/integ-rest/src/main/java/il/co/topq/integframework/rest/TomcatRESTApplicationContainer.java
+++ b/integ-rest/src/main/java/il/co/topq/integframework/rest/TomcatRESTApplicationContainer.java
@@ -4,6 +4,7 @@
import static il.co.topq.integframework.utils.StringUtils.isEmpty;
import il.co.topq.integframework.reporting.Reporter;
import il.co.topq.integframework.reporting.Reporter.Color;
+import il.co.topq.integframework.reporting.Reporter.Style;
import il.co.topq.integframework.utils.StringUtils;
import java.net.URI;
@@ -70,7 +71,7 @@ public ClientResponse reload() throws URISyntaxException {
setActual(clientResponse.getEntity(String.class));
Reporter.log("Response", Color.BLUE);
- Reporter.log("\n" + getActual(String.class) + "
\n");
+ Reporter.log(getActual(String.class), Style.PLAINTEXT);
return clientResponse;
}
diff --git a/integ-support/.gitignore b/integ-support/.gitignore
new file mode 100644
index 0000000..d2d9c31
--- /dev/null
+++ b/integ-support/.gitignore
@@ -0,0 +1,3 @@
+/target
+/target/
+/target/
diff --git a/integ-support/pom.xml b/integ-support/pom.xml
index c72a92a..d9eee9a 100644
--- a/integ-support/pom.xml
+++ b/integ-support/pom.xml
@@ -1,9 +1,10 @@
+
4.0.0
il.co.topq.integframework
integ-parent
- 1.0.1-SNAPSHOT
+ 1.0.5-SNAPSHOT
../integ-parent
integ-support
@@ -11,7 +12,7 @@
org.seleniumhq.selenium
selenium-support
- [2.0.0,)
+ 2.48.2
-
\ No newline at end of file
+
diff --git a/integ-support/src/main/java/il/co/topq/integframework/support/FluentWait.java b/integ-support/src/main/java/il/co/topq/integframework/support/FluentWait.java
index 358c1a7..1c16bbb 100644
--- a/integ-support/src/main/java/il/co/topq/integframework/support/FluentWait.java
+++ b/integ-support/src/main/java/il/co/topq/integframework/support/FluentWait.java
@@ -40,7 +40,8 @@ public String toString() {
* on a function.
* @return Nothing will ever be returned; this return type is only specified as a convenience.
*/
- protected RuntimeException timeoutException(String message, Throwable lastException) {
+ @Override
+ protected RuntimeException timeoutException(String message, Throwable lastException) {
throw new TimeoutException(message, lastException);
}
}
diff --git a/integ-support/src/main/java/il/co/topq/integframework/support/guava/Utils.java b/integ-support/src/main/java/il/co/topq/integframework/support/guava/Utils.java
new file mode 100644
index 0000000..ba42883
--- /dev/null
+++ b/integ-support/src/main/java/il/co/topq/integframework/support/guava/Utils.java
@@ -0,0 +1,126 @@
+package il.co.topq.integframework.support.guava;
+
+import static com.google.common.base.Optional.fromNullable;
+import static com.google.common.base.Suppliers.compose;
+import static com.google.common.base.Verify.verifyNotNull;
+
+import java.lang.reflect.Constructor;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.base.Function;
+import com.google.common.base.Supplier;
+import com.google.common.collect.HashBiMap;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+public abstract class Utils {
+ @SuppressWarnings("unused")
+ private final int _;
+
+ private Utils() {
+ _ = 0;
+ }
+
+ public static Supplier