1 package com.opensymphony.module.sitemesh.html; 2 3 import com.opensymphony.module.sitemesh.html.util.CharArray; 4 5 import junit.framework.TestCase; 6 7 public class HTMLProcessorTest extends TestCase { 8 9 public void testCreatesStateTransitionEvent() { 10 char[] input = "<a></a>".toCharArray(); 11 HTMLProcessor htmlProcessor = new HTMLProcessor(input, new CharArray(128)); 12 13 State defaultState = htmlProcessor.defaultState(); 14 15 final StringBuffer stateLog = new StringBuffer (); 16 17 defaultState.addListener(new StateChangeListener() { 18 public void stateFinished() { 19 stateLog.append("finished"); 20 } 21 }); 22 23 htmlProcessor.process(); 24 assertEquals("finished", stateLog.toString()); 25 } 26 } 27 | Popular Tags |