You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2013/11/05 16:21:07 UTC

svn commit: r1539027 - /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/login/RedirectOnLogoutTest.java

Author: bdelacretaz
Date: Tue Nov  5 15:21:06 2013
New Revision: 1539027

URL: http://svn.apache.org/r1539027
Log:
SLING-3226 - Use JackrabbitOnly category to disable tests that fail on Oak

Modified:
    sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/login/RedirectOnLogoutTest.java

Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/login/RedirectOnLogoutTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/login/RedirectOnLogoutTest.java?rev=1539027&r1=1539026&r2=1539027&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/login/RedirectOnLogoutTest.java (original)
+++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/login/RedirectOnLogoutTest.java Tue Nov  5 15:21:06 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.sling.launchpad.webapp.integrationtest.login;
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -24,32 +26,52 @@ import javax.servlet.http.HttpServletRes
 import org.apache.commons.httpclient.Header;
 import org.apache.commons.httpclient.NameValuePair;
 import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.sling.commons.testing.integration.HttpTestBase;
+import org.apache.sling.commons.testing.integration.HttpTest;
+import org.apache.sling.commons.testing.junit.categories.JackrabbitOnly;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 /** Verify that redirect to resource after logout works */
-public class RedirectOnLogoutTest extends HttpTestBase {
+public class RedirectOnLogoutTest {
+    
+    private final HttpTest H = new HttpTest();
+    
+    @Before
+    public void setup() throws Exception {
+        H.setUp();
+    }
+    
+    @After
+    public void cleanup() throws Exception {
+        H.tearDown();
+    }
+    
     /**
      * Test SLING-1847
      * @throws Exception
      */
+    @Test 
+    @Category(JackrabbitOnly.class) // TODO: fails on Oak
     public void testRedirectToResourceAfterLogout() throws Exception {
     	//login
         List<NameValuePair> params = new ArrayList<NameValuePair>();
         params.add(new NameValuePair("j_username", "admin"));
         params.add(new NameValuePair("j_password", "admin"));
-        assertPostStatus(HTTP_BASE_URL + "/j_security_check", HttpServletResponse.SC_MOVED_TEMPORARILY, params, null);
+        H.assertPostStatus(HttpTest.HTTP_BASE_URL + "/j_security_check", HttpServletResponse.SC_MOVED_TEMPORARILY, params, null);
         
         //...and then...logout with a resource redirect
-        String locationAfterLogout = SERVLET_CONTEXT + "/system/sling/info.sessionInfo.json";
-        final GetMethod get = new GetMethod(HTTP_BASE_URL + "/system/sling/logout");
+        String locationAfterLogout = HttpTest.SERVLET_CONTEXT + "/system/sling/info.sessionInfo.json";
+        final GetMethod get = new GetMethod(HttpTest.HTTP_BASE_URL + "/system/sling/logout");
         NameValuePair [] logoutParams = new NameValuePair[1];
         logoutParams[0] = new NameValuePair("resource", locationAfterLogout);
         get.setQueryString(logoutParams);
         
         get.setFollowRedirects(false);
-        final int status = httpClient.executeMethod(get);
+        final int status = H.getHttpClient().executeMethod(get);
         assertEquals("Expected redirect", HttpServletResponse.SC_MOVED_TEMPORARILY, status);
         Header location = get.getResponseHeader("Location");
-        assertEquals(HTTP_BASE_URL + locationAfterLogout, location.getValue());
+        assertEquals(HttpTest.HTTP_BASE_URL + locationAfterLogout, location.getValue());
     }
-}
+}
\ No newline at end of file