Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00EC217C6B for ; Tue, 3 Feb 2015 11:51:01 +0000 (UTC) Received: (qmail 99469 invoked by uid 500); 3 Feb 2015 11:51:01 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 99406 invoked by uid 500); 3 Feb 2015 11:51:01 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 99396 invoked by uid 99); 3 Feb 2015 11:51:01 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 11:51:01 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 77175AC0016; Tue, 3 Feb 2015 11:51:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1656696 - /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest2.java Date: Tue, 03 Feb 2015 11:51:01 -0000 To: commits@sling.apache.org From: asanso@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150203115101.77175AC0016@hades.apache.org> Author: asanso Date: Tue Feb 3 11:51:01 2015 New Revision: 1656696 URL: http://svn.apache.org/r1656696 Log: SLING-4294 - Servlet Filter Support adding sling.filter.pattern support * added IT Added: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest2.java Added: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest2.java URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest2.java?rev=1656696&view=auto ============================================================================== --- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest2.java (added) +++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/FiltersTest2.java Tue Feb 3 11:51:01 2015 @@ -0,0 +1,38 @@ +package org.apache.sling.launchpad.webapp.integrationtest; + +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.httpclient.HttpMethod; +import org.apache.sling.commons.testing.integration.HttpTestBase; + +public class FiltersTest2 extends HttpTestBase { + + public void testCounters() throws IOException { + HttpMethod get = assertHttpStatus(HTTP_BASE_URL + "/system.json", HttpServletResponse.SC_OK); + final String [] headers = { + "FILTER_COUNTER_HTTPSERVICE", + "FILTER_COUNTER_SLING", + "FILTER_COUNTER_NOPROP", + "FILTER_COUNTER_SLING_WITH_PATTERN" + }; + for(String header : headers) { + assertNotNull("Expecting header '" + header + "'", get.getResponseHeader(header)); + assertEquals("Expecting value 1 for header '" + header + "'", "1", get.getResponseHeader(header).getValue()); + } + } +}