You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/04/02 19:41:45 UTC

[tomcat] branch 8.5.x updated: Improve code coverage

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 3031d06  Improve code coverage
3031d06 is described below

commit 3031d06fcbcdcd23d72b7b3f4f8ee6c6c892e0a8
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Apr 2 20:40:40 2020 +0100

    Improve code coverage
---
 .../apache/tomcat/util/res/TestStringManager.java    | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/tomcat/util/res/TestStringManager.java b/test/org/apache/tomcat/util/res/TestStringManager.java
index 2a5bb96..7caeead 100644
--- a/test/org/apache/tomcat/util/res/TestStringManager.java
+++ b/test/org/apache/tomcat/util/res/TestStringManager.java
@@ -16,13 +16,15 @@
  */
 package org.apache.tomcat.util.res;
 
+import java.util.Locale;
+
 import org.junit.Assert;
 import org.junit.Test;
 
 public class TestStringManager {
 
-    private static final StringManager sm =
-        StringManager.getManager("org.apache.naming");
+    private static final String PACKAGE_NAME = "org.apache.tomcat.util";
+    private static final StringManager sm = StringManager.getManager(PACKAGE_NAME);
 
     @Test
     public void testNullKey() {
@@ -43,4 +45,18 @@ public class TestStringManager {
         sm.getString("namingContext.nameNotBound", (Object[]) null);
         sm.getString("namingContext.nameNotBound", new Object[1]);
     }
+
+    @Test
+    public void testFrench() {
+        StringManager sm = StringManager.getManager(PACKAGE_NAME, Locale.FRENCH);
+        Assert.assertEquals(Locale.FRENCH, sm.getLocale());
+    }
+
+    @Test
+    public void testMissing() {
+        Thread.currentThread().setContextClassLoader(TestStringManager.class.getClassLoader());
+        StringManager sm = StringManager.getManager("org.does.no.exist");
+        Assert.assertNull(sm.getLocale());
+    }
+
 }


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