Return-Path:
Delivered-To: apmail-sling-commits-archive@www.apache.org
Received: (qmail 71165 invoked from network); 4 Feb 2011 15:42:54 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3)
by minotaur.apache.org with SMTP; 4 Feb 2011 15:42:54 -0000
Received: (qmail 64010 invoked by uid 500); 4 Feb 2011 15:42:54 -0000
Delivered-To: apmail-sling-commits-archive@sling.apache.org
Received: (qmail 63590 invoked by uid 500); 4 Feb 2011 15:42:51 -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 63583 invoked by uid 99); 4 Feb 2011 15:42:50 -0000
Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Feb 2011 15:42:50 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=5.0
tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4)
by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Feb 2011 15:42:48 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
id 446DB2388A36; Fri, 4 Feb 2011 15:42:28 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r1067200 - in
/sling/whiteboard/bdelacretaz/junit/core/src/main:
java/org/apache/sling/junit/impl/ java/org/apache/sling/junit/impl/servlet/
resources/
Date: Fri, 04 Feb 2011 15:42:28 -0000
To: commits@sling.apache.org
From: bdelacretaz@apache.org
X-Mailer: svnmailer-1.0.8
Message-Id: <20110204154228.446DB2388A36@eris.apache.org>
Author: bdelacretaz
Date: Fri Feb 4 15:42:27 2011
New Revision: 1067200
URL: http://svn.apache.org/viewvc?rev=1067200&view=rev
Log:
SLING-1963 - basic HTML rendering for test servlet
Added:
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlFilter.java (with props)
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java (with props)
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/JUnitServlet.java
- copied, changed from r1067179, sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/JUnitServlet.java
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/PlainTextRenderer.java
- copied, changed from r1067118, sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/PlainTextRunListener.java
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/Renderer.java (with props)
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/RequestInfo.java (with props)
sling/whiteboard/bdelacretaz/junit/core/src/main/resources/
sling/whiteboard/bdelacretaz/junit/core/src/main/resources/junit.css (with props)
Removed:
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/JUnitServlet.java
sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/PlainTextRunListener.java
Added: sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlFilter.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlFilter.java?rev=1067200&view=auto
==============================================================================
--- sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlFilter.java (added)
+++ sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlFilter.java Fri Feb 4 15:42:27 2011
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.apache.sling.junit.impl.servlet;
+
+import java.io.PrintWriter;
+
+/** Simple HTML output filtering */
+public class HtmlFilter {
+ static void escape(PrintWriter w, String str) {
+ for(int i=0 ; i < str.length(); i++) {
+ final char c = str.charAt(i);
+ if(c == '<') {
+ w.write("<");
+ } else if (c == '>') {
+ w.write(">");
+ } else if(c == '&') {
+ w.write("&");
+ } else {
+ w.write(c);
+ }
+ }
+ }
+}
Propchange: sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlFilter.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision Rev URL
Added: sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java?rev=1067200&view=auto
==============================================================================
--- sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java (added)
+++ sling/whiteboard/bdelacretaz/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java Fri Feb 4 15:42:27 2011
@@ -0,0 +1,146 @@
+/*
+ * 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.
+ */
+package org.apache.sling.junit.impl.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.runner.Description;
+import org.junit.runner.Result;
+import org.junit.runner.notification.Failure;
+
+class HtmlRenderer extends Renderer {
+
+ private PrintWriter output;
+
+ public void info(String cssClass, String str) {
+ output.println("