[jbosstools-commits] JBoss Tools SVN: r43451 - trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Wed Sep 5 20:50:50 EDT 2012
Author: dgolovin
Date: 2012-09-05 20:50:50 -0400 (Wed, 05 Sep 2012)
New Revision: 43451
Added:
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/StringUtilTest.java
Log:
code cleanup and tests for common classes
Added: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/StringUtilTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/StringUtilTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/StringUtilTest.java 2012-09-06 00:50:50 UTC (rev 43451)
@@ -0,0 +1,24 @@
+package org.jboss.tools.common.util.test;
+
+import static org.junit.Assert.*;
+import junit.framework.TestCase;
+
+import org.jboss.tools.common.util.StringUtil;
+import org.junit.Test;
+
+public class StringUtilTest extends TestCase{
+
+ @Test
+ public void testTrimQuotes() {
+ String text = "text";
+ final String[] OPTIONS = new String[] {"","'","\""};
+ for(int i = 0;i<OPTIONS.length;i++) {
+ for(int j = 0;j<OPTIONS.length;j++) {
+ String target = OPTIONS[i] + text + OPTIONS[j];
+ System.out.println(target);
+ assertTrue(StringUtil.trimQuotes(target).equals(text));
+ }
+ }
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/util/test/StringUtilTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
More information about the jbosstools-commits
mailing list