Removed 1.1 compatibility blackbox test.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 29 Aug 2006 19:12:32 +0000 (19:12 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 29 Aug 2006 19:12:32 +0000 (19:12 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2000 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

tests/edu/internet2/middleware/shibboleth/idp/SSOTest.java

index 663a147..f20da8a 100644 (file)
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package edu.internet2.middleware.shibboleth.idp;
 
 import java.io.File;
@@ -32,6 +33,7 @@ public class SSOTest extends IdpTestCase {
         * Initialize SSO request object
         */
        private void initRequest() {
+
                request.setRemoteAddr("127.0.0.1");
                request.setContextPath("/shibboleth-idp");
                request.setProtocol("HTTP/1.1");
@@ -50,24 +52,21 @@ public class SSOTest extends IdpTestCase {
         * @throws Exception
         */
        public void testBasicSsoArtifactFlow() throws Exception {
+
                resetServlet("data/idp/blackbox/conf/standard");
 
                initRequest();
-               request.setupAddParameter("target",
-                               "https://sp.example.org/cgi-bin/login.cgi");
-               request.setupAddParameter("shire",
-                               "https://sp.example.org/Shibboleth.sso/SAML/Artifact");
+               request.setupAddParameter("target", "https://sp.example.org/cgi-bin/login.cgi");
+               request.setupAddParameter("shire", "https://sp.example.org/Shibboleth.sso/SAML/Artifact");
                request.setupAddParameter("providerId", "urn:x-shibtest:SP");
                request.setRemoteUser("gpburdell");
 
                testModule.doGet();
 
-               assertTrue(response
-                               .getHeader("Location")
-                               .matches(
-                                               "https://sp.example.org/Shibboleth.sso/SAML/Artifact?.*"
-                                                               + "TARGET=https%3A%2F%2Fsp.example.org%2Fcgi-bin%2Flogin.cgi"
-                                                               + "&SAMLart=[^&]+" + "&SAMLart=[^&]+"));
+               assertTrue(response.getHeader("Location").matches(
+                               "https://sp.example.org/Shibboleth.sso/SAML/Artifact?.*"
+                                               + "TARGET=https%3A%2F%2Fsp.example.org%2Fcgi-bin%2Flogin.cgi" + "&SAMLart=[^&]+"
+                                               + "&SAMLart=[^&]+"));
        }
 
        /**
@@ -76,49 +75,22 @@ public class SSOTest extends IdpTestCase {
         * @throws Exception
         */
        public void testBasicSsoPostFlow() throws Exception {
+
                resetServlet("data/idp/blackbox/conf/ssoPost");
 
                initRequest();
-               request.setupAddParameter("target",
-                               "https://sp.example.org/cgi-bin/login.cgi");
-               request.setupAddParameter("shire",
-                               "https://sp.example.org/Shibboleth.sso/SAML/POST");
+               request.setupAddParameter("target", "https://sp.example.org/cgi-bin/login.cgi");
+               request.setupAddParameter("shire", "https://sp.example.org/Shibboleth.sso/SAML/POST");
                request.setupAddParameter("providerId", "urn:x-shibtest:SP");
                request.setRemoteUser("gpburdell");
 
                testModule.doGet();
 
                String bin64assertion = (String) request.getAttribute("assertion");
-               String assertion = new String(Base64.decodeBase64(bin64assertion
-                               .getBytes()));
+               String assertion = new String(Base64.decodeBase64(bin64assertion.getBytes()));
 
-               assertTrue(responsesAreEqual(FileUtils.readFileToString(new File(
-                               "data/idp/blackbox/sso/response01.txt"), "utf-8"), assertion));
-       }
-
-       /**
-        * Basic working 1.1 SSO flow
-        * 
-        * @throws Exception
-        */
-       public void testBasic11SsoFlow() throws Exception {
-               resetServlet("data/idp/blackbox/conf/standard");
-
-               initRequest();
-               request.setupAddParameter("target",
-                               "https://sp.example.org/cgi-bin/login.cgi");
-               request.setupAddParameter("shire",
-                               "https://sp.example.org/Shibboleth.shire");
-               request.setRemoteUser("gpburdell");
-
-               testModule.doGet();
-
-               String bin64assertion = (String) request.getAttribute("assertion");
-               String assertion = new String(Base64.decodeBase64(bin64assertion
-                               .getBytes()));
-
-               assertTrue(responsesAreEqual(FileUtils.readFileToString(new File(
-                               "data/idp/blackbox/sso/response02.txt"), "utf-8"), assertion));
+               assertTrue(responsesAreEqual(FileUtils.readFileToString(new File("data/idp/blackbox/sso/response01.txt"),
+                               "utf-8"), assertion));
        }
 
        /**
@@ -127,21 +99,19 @@ public class SSOTest extends IdpTestCase {
         * @throws Exception
         */
        public void testSsoFlowWithInvalidSpAcceptanceUrl() throws Exception {
+
                resetServlet("data/idp/blackbox/conf/standard");
 
                initRequest();
-               request.setupAddParameter("target",
-                               "https://sp.example.org/cgi-bin/login.cgi");
-               request.setupAddParameter("shire",
-                               "https://invalid.edu/Shibboleth.sso/SAML/Artifact");
+               request.setupAddParameter("target", "https://sp.example.org/cgi-bin/login.cgi");
+               request.setupAddParameter("shire", "https://invalid.edu/Shibboleth.sso/SAML/Artifact");
                request.setupAddParameter("providerId", "urn:x-shibtest:SP");
                request.setRemoteUser("gpburdell");
 
                testModule.doGet();
 
-               assertEquals(
-                               "org.opensaml.SAMLException: Invalid assertion consumer service URL.",
-                               request.getAttribute("errorText"));
+               assertEquals("org.opensaml.SAMLException: Invalid assertion consumer service URL.", request
+                               .getAttribute("errorText"));
        }
 
        /**
@@ -150,24 +120,22 @@ public class SSOTest extends IdpTestCase {
         * @throws Exception
         */
        public void testSsoFlowWithSignedAssertions() throws Exception {
+
                resetServlet("data/idp/blackbox/conf/signAssertions");
 
                initRequest();
-               request.setupAddParameter("target",
-                               "https://sp.example.org/cgi-bin/login.cgi");
-               request.setupAddParameter("shire",
-                               "https://sp.example.org/Shibboleth.sso/SAML/POST");
+               request.setupAddParameter("target", "https://sp.example.org/cgi-bin/login.cgi");
+               request.setupAddParameter("shire", "https://sp.example.org/Shibboleth.sso/SAML/POST");
                request.setupAddParameter("providerId", "urn:x-shibtest:SP");
                request.setRemoteUser("gpburdell");
 
                testModule.doGet();
 
                String bin64assertion = (String) request.getAttribute("assertion");
-               String assertion = new String(Base64.decodeBase64(bin64assertion
-                               .getBytes()));
+               String assertion = new String(Base64.decodeBase64(bin64assertion.getBytes()));
 
-               assertTrue(responsesAreEqual(FileUtils.readFileToString(new File(
-                               "data/idp/blackbox/sso/response03.txt"), "utf-8"), assertion));
+               assertTrue(responsesAreEqual(FileUtils.readFileToString(new File("data/idp/blackbox/sso/response03.txt"),
+                               "utf-8"), assertion));
        }
 
 }