cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1210754 - /cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/StringUtilsTest.java
Date Tue, 06 Dec 2011 02:48:13 GMT
Author: aadamchik
Date: Tue Dec  6 02:48:13 2011
New Revision: 1210754

URL: http://svn.apache.org/viewvc?rev=1210754&view=rev
Log:
CAY-1607 [PATCH] add pluralize method to StringUtils for use in templates

missed the unit test from the original commit

Added:
    cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/StringUtilsTest.java

Added: cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/StringUtilsTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/StringUtilsTest.java?rev=1210754&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/StringUtilsTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/test/java/org/apache/cayenne/gen/StringUtilsTest.java
Tue Dec  6 02:48:13 2011
@@ -0,0 +1,49 @@
+/*****************************************************************
+ *   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.cayenne.gen;
+
+import junit.framework.TestCase;
+
+public class StringUtilsTest extends TestCase {
+
+    protected StringUtils stringUtils;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        stringUtils = new StringUtils();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        super.tearDown();
+        stringUtils = null;
+    }
+
+    public void testPluralize() throws Exception {
+        assertEquals("Words", stringUtils.pluralize("Word"));
+        assertEquals("Statuses", stringUtils.pluralize("Status"));
+        assertEquals("Indexes", stringUtils.pluralize("Index"));
+        assertEquals("Factories", stringUtils.pluralize("Factory"));
+        assertEquals("", stringUtils.pluralize(""));
+        assertEquals(null, stringUtils.pluralize(null));
+    }
+
+}



Mime
View raw message