Example #1
0
 @Test
 public void testEscape() throws Exception {
   assertEquals(ESCAPE1, instance.escape(VALUE1));
   assertEquals(ESCAPE2, instance.escape(VALUE2));
   assertEquals(ESCAPE3, instance.escape(VALUE3));
   assertEquals(ESCAPE4, instance.escape(VALUE4));
   assertEquals(ESCAPE5, instance.escape(VALUE5));
 }
Example #2
0
 @Test
 public void testUnescape() throws Exception {
   assertEquals(VALUE1, instance.unescape(ESCAPE1));
   assertEquals(VALUE2, instance.unescape(ESCAPE2));
   assertEquals(VALUE3, instance.unescape(ESCAPE3));
   assertEquals(VALUE4, instance.unescape(ESCAPE4));
   assertEquals(VALUE5, instance.unescape(ESCAPE5));
   assertEquals("=", instance.unescape("\\="));
   assertEquals("xAx", instance.unescape("x\\o101x"));
 }
Example #3
0
 @Test
 public void testInvalidOctal() {
   try {
     instance.unescape(INVALID_OCT);
     missing(IllegalArgumentException.class);
   } catch (IllegalArgumentException x) {
     //
   }
 }
Example #4
0
 @Test
 public void testSingleton() throws Exception {
   assertEquals(WinEscapeTool.class, WinEscapeTool.getInstance().getClass());
 }
Example #5
0
 @Before
 @Override
 public void setUp() throws Exception {
   super.setUp();
   instance = WinEscapeTool.getInstance();
 }