1   package com.eviware.soapui.support;
2   
3   import junit.framework.TestCase;
4   
5   public class StringUtilsTestCase extends TestCase
6   {
7   	public void testUnquote() throws Exception
8   	{
9   		assertEquals( "test", StringUtils.unquote( "\"test\"" ));
10  		assertNull( StringUtils.unquote( null ) );
11  		assertEquals( "", StringUtils.unquote( "" ) );
12  		assertEquals( "\"test", StringUtils.unquote( "\"test" ));
13  		assertEquals( "test\"", StringUtils.unquote( "test\"" ));
14  		assertEquals( "test", StringUtils.unquote( "test" ));
15  	}
16  	
17  	public void testQuote() throws Exception
18  	{
19  		assertNull( StringUtils.quote( null ));
20  		assertEquals( "\"\"", StringUtils.quote( "" ) );
21  		assertEquals( "\"test\"", StringUtils.quote( "test" ) );
22  		assertEquals( "\"\"test\"", StringUtils.quote( "\"test" ) );
23  		assertEquals( "\"test\"\"", StringUtils.quote( "test\"" ) );
24  		assertEquals( "\"\"\"", StringUtils.quote( "\"" ) );
25  	}
26  	
27  	public void testReplaceAll() throws Exception
28  	{
29  		assertEquals( "<a>\n\n</a>", "<a>\n<test>--remove--</test>\n</a>".replaceAll( "<(.+)>--remove--</(//1)>", "" ));
30  	}
31  }