tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1133816 - in /tomcat/trunk/test/org/apache/juli: ./ TestClassLoaderLogManager.java
Date Thu, 09 Jun 2011 12:03:25 GMT
Author: kkolinko
Date: Thu Jun  9 12:03:25 2011
New Revision: 1133816

URL: http://svn.apache.org/viewvc?rev=1133816&view=rev
Log:
Tests for ClassLoaderLogManager#replace()

Added:
    tomcat/trunk/test/org/apache/juli/   (with props)
    tomcat/trunk/test/org/apache/juli/TestClassLoaderLogManager.java   (with props)

Propchange: tomcat/trunk/test/org/apache/juli/
------------------------------------------------------------------------------
    bugtraq:append = false

Propchange: tomcat/trunk/test/org/apache/juli/
------------------------------------------------------------------------------
    bugtraq:label = Bugzilla ID (optional)

Propchange: tomcat/trunk/test/org/apache/juli/
------------------------------------------------------------------------------
--- bugtraq:message (added)
+++ bugtraq:message Thu Jun  9 12:03:25 2011
@@ -0,0 +1 @@
+Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=%BUGID%

Propchange: tomcat/trunk/test/org/apache/juli/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: tomcat/trunk/test/org/apache/juli/
------------------------------------------------------------------------------
    bugtraq:url = https://issues.apache.org/bugzilla/show_bug.cgi?id=%BUGID%

Propchange: tomcat/trunk/test/org/apache/juli/
------------------------------------------------------------------------------
--- tsvn:logrevregex (added)
+++ tsvn:logrevregex Thu Jun  9 12:03:25 2011
@@ -0,0 +1 @@
+\b(r\d+)|\b(revisions?(\(s\))?\s#?\d+([, ]+(and\s?)?\d+)*)|\b(revs?\.?\s?\d+([, ]+(and\s?)?\d+)*)

Added: tomcat/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/juli/TestClassLoaderLogManager.java?rev=1133816&view=auto
==============================================================================
--- tomcat/trunk/test/org/apache/juli/TestClassLoaderLogManager.java (added)
+++ tomcat/trunk/test/org/apache/juli/TestClassLoaderLogManager.java Thu Jun  9 12:03:25 2011
@@ -0,0 +1,51 @@
+/*
+ *  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.juli;
+
+import junit.framework.TestCase;
+
+/**
+ * Test cases for {@link ClassLoaderLogManager}.
+ */
+public class TestClassLoaderLogManager extends TestCase {
+
+    public void testReplace() {
+        ClassLoaderLogManager logManager = new ClassLoaderLogManager();
+        assertEquals("", logManager.replace(""));
+        assertEquals("${", logManager.replace("${"));
+        assertEquals("${undefinedsystemproperty}",
+                logManager.replace("${undefinedsystemproperty}"));
+        assertEquals(
+                System.getProperty("line.separator")
+                        + System.getProperty("path.separator")
+                        + System.getProperty("file.separator"),
+                logManager
+                        .replace("${line.separator}${path.separator}${file.separator}"));
+        assertEquals(
+                "foo" + System.getProperty("file.separator") + "bar"
+                        + System.getProperty("line.separator")
+                        + System.getProperty("path.separator") + "baz",
+                logManager
+                        .replace("foo${file.separator}bar${line.separator}${path.separator}baz"));
+        // BZ 51249
+        assertEquals(
+                "%{file.separator}" + System.getProperty("file.separator"),
+                logManager.replace("%{file.separator}${file.separator}"));
+    }
+
+}

Propchange: tomcat/trunk/test/org/apache/juli/TestClassLoaderLogManager.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message