1 19 package org.netbeans.api.java.source.gen; 20 21 import com.sun.source.tree.VariableTree; 22 import java.io.IOException ; 23 import junit.textui.TestRunner; 24 import org.netbeans.api.java.source.transform.Transformer; 25 import org.netbeans.junit.NbTestSuite; 26 27 31 public class FieldTest2 extends GeneratorTest { 32 33 34 public FieldTest2(String name) { 35 super(name); 36 } 37 38 public static NbTestSuite suite() { 39 NbTestSuite suite = new NbTestSuite(FieldTest2.class); 40 return suite; 41 } 42 43 protected void setUp() throws Exception { 44 super.setUp(); 45 testFile = getFile(getSourceDir(), getSourcePckg() + "FieldTest2.java"); 46 } 47 48 51 public void testMoveField() throws IOException { 52 System.err.println("testMoveField"); 53 process( 54 new Transformer<Void , Object >() { 55 public Void visitVariable(VariableTree node, Object p) { 56 if ("nerudova".contentEquals(node.getName())) { 57 System.err.println(node); 58 } 59 71 return null; 72 } 73 } 74 ); 75 assertFiles("FieldTest2.pass"); 76 } 77 78 81 public static void main(String [] args) { 82 TestRunner.run(suite()); 83 } 84 85 String getSourcePckg() { 86 return "org/netbeans/test/codegen/"; 87 } 88 89 String getGoldenPckg() { 90 return "org/netbeans/jmi/javamodel/codegen/FieldTest2/"; 91 } 92 } 93 | Popular Tags |