maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r683450 - /maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
Date Wed, 06 Aug 2008 23:57:34 GMT
Author: bentmann
Date: Wed Aug  6 16:57:34 2008
New Revision: 683450

URL: http://svn.apache.org/viewvc?rev=683450&view=rev
Log:
o Made unit test insensitive to quoting char to guard against platform-dependency, making
it finally on Windows

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java?rev=683450&r1=683449&r2=683450&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
Wed Aug  6 16:57:34 2008
@@ -119,15 +119,23 @@
     public void testCreateTask()
         throws Exception
     {
+        /*
+         * NOTE: Quoting of arguments can differ for Windows/Unix, hence we normalize to
single quotes for the purpose
+         * of testing.
+         */
+
         Commandline cl = SynergyCCM.createTask( "the synopsis", "release", true, "CCM_ADDR"
);
         assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(),
"CCM_ADDR=CCM_ADDR" ) );
+        String actual = cl.toString().replace( '\"', '\'' );
         String expected = "ccm task -create -synopsis 'the synopsis' -release release";
-        assertTrue( "[" + cl.toString() + "] do not contain [" + expected + "]",
-                    cl.toString().indexOf( expected ) > -1 );
+        assertTrue( "[" + actual + "] does not contain [" + expected + "]",
+                    actual.indexOf( expected ) > -1 );
+
         cl = SynergyCCM.createTask( "the synopsis", null, true, "CCM_ADDR" );
+        actual = cl.toString().replace( '\"', '\'' );
         expected = "ccm task -create -synopsis 'the synopsis'";
-        assertTrue( "[" + cl.toString() + "] do not contain [" + expected + "]",
-                    cl.toString().indexOf( expected ) > -1 );
+        assertTrue( "[" + actual + "] does not contain [" + expected + "]",
+                    actual.indexOf( expected ) > -1 );
     }
 
     public void testCheckinTask()



Mime
View raw message