1 26 27 package net.sourceforge.groboutils.uicapture.v1; 28 29 import java.awt.Robot ; 30 import java.awt.Frame ; 31 import java.awt.Rectangle ; 32 import java.awt.Color ; 33 import java.awt.Graphics2D ; 34 import java.awt.image.BufferedImage ; 35 import net.sourceforge.groboutils.uicapture.v1.event.*; 36 37 import net.sourceforge.groboutils.autodoc.v1.AutoDoc; 38 import junit.framework.Test; 39 import junit.framework.TestCase; 40 import junit.framework.TestSuite; 41 import org.easymock.EasyMock; 42 import org.easymock.MockControl; 43 44 45 52 public class ScriptGeneratorUTest extends TestCase 53 { 54 57 private static final Class THIS_CLASS = ScriptGeneratorUTest.class; 58 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 59 60 public ScriptGeneratorUTest( String name ) 61 { 62 super( name ); 63 } 64 65 66 private MockControl scriptmakerControl; 67 private IScriptMaker mockScriptmaker; 68 69 70 71 75 protected void setUp() throws Exception 76 { 77 super.setUp(); 78 79 this.scriptmakerControl = EasyMock.controlFor( IScriptMaker.class ); 81 this.mockScriptmaker = (IScriptMaker)this.scriptmakerControl.getMock(); 82 } 83 84 85 88 public void testInstantiation() 89 { 90 new ScriptGenerator( null, null, null, null ); 91 } 92 93 94 public void testMouseWheelMovedNotStarted() 95 { 96 DOC.getIT().testsIssue( 618314 ); 97 98 102 this.scriptmakerControl.activate(); 103 ScriptGenerator sg = new ScriptGenerator( null, null, 104 this.mockScriptmaker, "base" ); 105 MouseWheelCaptureEvent mwce = new MouseWheelCaptureEvent( 10 ); 106 107 108 sg.mouseWheelMoved( mwce ); 109 110 111 this.scriptmakerControl.verify(); 112 } 113 114 115 116 117 118 119 122 123 124 127 128 public static Test suite() 129 { 130 TestSuite suite = new TestSuite( THIS_CLASS ); 131 132 return suite; 133 } 134 135 public static void main( String [] args ) 136 { 137 String [] name = { THIS_CLASS.getName() }; 138 139 142 junit.textui.TestRunner.main( name ); 143 } 144 145 146 150 protected void tearDown() throws Exception 151 { 152 154 super.tearDown(); 155 } 156 } 157 158 | Popular Tags |