git commit: Upgrading system tests to use newer HttpClient API

2014-07-10 Thread coheigea
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 940c54a65 - 79c744df1


Upgrading system tests to use newer HttpClient API


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/79c744df
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/79c744df
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/79c744df

Branch: refs/heads/master
Commit: 79c744df1824893331f73f03358c047d7f4f0433
Parents: 940c54a
Author: Colm O hEigeartaigh cohei...@apache.org
Authored: Thu Jul 10 17:44:35 2014 +0100
Committer: Colm O hEigeartaigh cohei...@apache.org
Committed: Thu Jul 10 17:44:35 2014 +0100

--
 .../fediz/integrationtests/AbstractTests.java   | 141 ++-
 .../fediz/integrationtests/HTTPTestUtils.java   | 176 +++
 .../cxf/fediz/integrationtests/BadWReqTest.java | 125 +
 .../cxf/fediz/integrationtests/TomcatTest.java  | 121 +
 .../cxf/fediz/integrationtests/WReqTest.java| 125 +
 5 files changed, 190 insertions(+), 498 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/79c744df/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
--
diff --git 
a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
 
b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
index b2e80f3..f2b715a 100644
--- 
a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
+++ 
b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
@@ -19,33 +19,7 @@
 
 package org.apache.cxf.fediz.integrationtests;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.security.KeyStore;
-import java.util.ArrayList;
-import java.util.List;
-
-import net.htmlparser.jericho.Element;
-import net.htmlparser.jericho.FormField;
-import net.htmlparser.jericho.FormFields;
-import net.htmlparser.jericho.HTMLElementName;
-import net.htmlparser.jericho.Source;
 import org.apache.cxf.fediz.core.ClaimTypes;
-import org.apache.http.Consts;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.NameValuePair;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.conn.scheme.Scheme;
-import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.impl.client.LaxRedirectStrategy;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
 
 public abstract class AbstractTests {
@@ -65,7 +39,8 @@ public abstract class AbstractTests {
 String url = https://localhost:; + getRpHttpsPort() + 
/fedizhelloworld/secure/fedservlet;
 String user = alice;
 String password = ecila;
-String response = sendHttpGet(url, user, password);
+String response = 
+HTTPTestUtils.sendHttpGet(url, user, password, 
Integer.parseInt(getIdpHttpsPort()));
 
 Assert.assertTrue(Principal not  + user, 
response.indexOf(userPrincipal= + user)  0);
 Assert.assertTrue(User  + user +  does not have role Admin, 
response.indexOf(role:Admin=false)  0);
@@ -89,7 +64,8 @@ public abstract class AbstractTests {
 String url = https://localhost:; + getRpHttpsPort() + 
/fedizhelloworld/secure/fedservlet;
 String user = bob;
 String password = bob;
-String response = sendHttpGet(url, user, password);
+String response = 
+HTTPTestUtils.sendHttpGet(url, user, password, 
Integer.parseInt(getIdpHttpsPort()));
 
 Assert.assertTrue(Principal not  + user, 
response.indexOf(userPrincipal= + user)  0);
 Assert.assertTrue(User  + user +  does not have role Admin, 
response.indexOf(role:Admin=true)  0);
@@ -112,7 +88,8 @@ public abstract class AbstractTests {
 String url = https://localhost:; + getRpHttpsPort() + 
/fedizhelloworld/secure/fedservlet;
 String user = ted;
 String password = det;
-String response = sendHttpGet(url, user, password);
+String response = 
+HTTPTestUtils.sendHttpGet(url, user, password, 
Integer.parseInt(getIdpHttpsPort()));
 
 Assert.assertTrue(Principal not  + user, 
response.indexOf(userPrincipal= + user)  0);
 Assert.assertTrue(User  + user +  does not have role Admin, 
response.indexOf(role:Admin=false)  0);
@@ -135,18 +112,17 @@ public abstract class 

git commit: Upgrading system tests to use newer HttpClient API

2014-07-10 Thread coheigea
Repository: cxf-fediz
Updated Branches:
  refs/heads/1.1.x-fixes f9f27c7be - 6637a55d1


Upgrading system tests to use newer HttpClient API


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/6637a55d
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/6637a55d
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/6637a55d

Branch: refs/heads/1.1.x-fixes
Commit: 6637a55d1a152357bf1520daa9039d7373691767
Parents: f9f27c7
Author: Colm O hEigeartaigh cohei...@apache.org
Authored: Thu Jul 10 17:44:35 2014 +0100
Committer: Colm O hEigeartaigh cohei...@apache.org
Committed: Thu Jul 10 17:45:11 2014 +0100

--
 .../fediz/integrationtests/AbstractTests.java   | 141 ++-
 .../fediz/integrationtests/HTTPTestUtils.java   | 176 +++
 .../cxf/fediz/integrationtests/BadWReqTest.java | 125 +
 .../cxf/fediz/integrationtests/TomcatTest.java  | 121 +
 .../cxf/fediz/integrationtests/WReqTest.java| 125 +
 5 files changed, 190 insertions(+), 498 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6637a55d/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
--
diff --git 
a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
 
b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
index b2e80f3..f2b715a 100644
--- 
a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
+++ 
b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
@@ -19,33 +19,7 @@
 
 package org.apache.cxf.fediz.integrationtests;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.security.KeyStore;
-import java.util.ArrayList;
-import java.util.List;
-
-import net.htmlparser.jericho.Element;
-import net.htmlparser.jericho.FormField;
-import net.htmlparser.jericho.FormFields;
-import net.htmlparser.jericho.HTMLElementName;
-import net.htmlparser.jericho.Source;
 import org.apache.cxf.fediz.core.ClaimTypes;
-import org.apache.http.Consts;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.NameValuePair;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.conn.scheme.Scheme;
-import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.impl.client.LaxRedirectStrategy;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
 
 public abstract class AbstractTests {
@@ -65,7 +39,8 @@ public abstract class AbstractTests {
 String url = https://localhost:; + getRpHttpsPort() + 
/fedizhelloworld/secure/fedservlet;
 String user = alice;
 String password = ecila;
-String response = sendHttpGet(url, user, password);
+String response = 
+HTTPTestUtils.sendHttpGet(url, user, password, 
Integer.parseInt(getIdpHttpsPort()));
 
 Assert.assertTrue(Principal not  + user, 
response.indexOf(userPrincipal= + user)  0);
 Assert.assertTrue(User  + user +  does not have role Admin, 
response.indexOf(role:Admin=false)  0);
@@ -89,7 +64,8 @@ public abstract class AbstractTests {
 String url = https://localhost:; + getRpHttpsPort() + 
/fedizhelloworld/secure/fedservlet;
 String user = bob;
 String password = bob;
-String response = sendHttpGet(url, user, password);
+String response = 
+HTTPTestUtils.sendHttpGet(url, user, password, 
Integer.parseInt(getIdpHttpsPort()));
 
 Assert.assertTrue(Principal not  + user, 
response.indexOf(userPrincipal= + user)  0);
 Assert.assertTrue(User  + user +  does not have role Admin, 
response.indexOf(role:Admin=true)  0);
@@ -112,7 +88,8 @@ public abstract class AbstractTests {
 String url = https://localhost:; + getRpHttpsPort() + 
/fedizhelloworld/secure/fedservlet;
 String user = ted;
 String password = det;
-String response = sendHttpGet(url, user, password);
+String response = 
+HTTPTestUtils.sendHttpGet(url, user, password, 
Integer.parseInt(getIdpHttpsPort()));
 
 Assert.assertTrue(Principal not  + user, 
response.indexOf(userPrincipal= + user)  0);
 Assert.assertTrue(User  + user +  does not have role Admin, 
response.indexOf(role:Admin=false)  0);
@@ -135,18 +112,17 @@ public abstract class