KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > modules > html > EditorSessionTest


1 /*
2  * Created on Aug 3, 2004
3  */

4 package com.openedit.modules.html;
5
6 import junit.framework.TestCase;
7
8 /**
9  * @author Matthew Avery, mavery@einnovation.com
10  */

11 public class EditorSessionTest extends TestCase
12 {
13
14     public EditorSessionTest( String JavaDoc arg0 )
15     {
16         super( arg0 );
17         // TODO Auto-generated constructor stub
18
}
19     
20     public void testCreateVariable()
21     {
22         EditorSession session = new EditorSession();
23         String JavaDoc variable = session.createVariable( "\\blah" );
24         assertEquals( "\\\\blah", variable );
25         System.out.println( variable );
26     }
27     public void testReplace()
28     {
29         EditorSession session = new EditorSession();
30         String JavaDoc content = session.removeBaseHrefAndFixQuotes("<p>Some&quot;Junk&quot; <a HREF=\"sdfdsf\" _base_href=\"dsfdf\" target=\"_parent\" >Junk</a>\nNew Line");
31         assertEquals("<p>Some\"Junk\" <a HREF=\"sdfdsf\" target=\"_parent\" >Junk</a>\nNew Line", content);
32     }
33 }
34
Popular Tags