1 19 20 25 26 package org.netbeans.test.java.generating.MethodElem; 27 28 import org.netbeans.test.java.Common; 29 import java.util.EnumSet ; 30 import javax.lang.model.element.Modifier; 31 import org.netbeans.api.java.source.JavaSource; 32 import org.netbeans.junit.*; 33 import org.openide.filesystems.FileObject; 34 35 58 59 60 public class MethodElem extends org.netbeans.test.java.XRunner { 61 62 public static void main(java.lang.String [] args) { 63 junit.textui.TestRunner.run(suite()); 64 } 65 66 public MethodElem() { 67 super(""); 68 } 69 70 public MethodElem(java.lang.String testName) { 71 super(testName); 72 } 73 74 public static NbTest suite() { 75 return new NbTestSuite(MethodElem.class); 76 } 77 78 85 public boolean go(Object o, java.io.PrintWriter log) throws Exception { 86 87 boolean passed = true; 89 FileObject fo = (FileObject) o; 90 JavaSource js = JavaSource.forFileObject(fo); 91 92 Common.addMethod(js, "method1",Common.PARS1,"void", EnumSet.of(Modifier.PUBLIC,Modifier.STATIC)); 93 Common.addMethod(js, "method1",Common.PARS2,"int", EnumSet.of(Modifier.PRIVATE,Modifier.SYNCHRONIZED)); 94 Common.addMethod(js, "method1",Common.PARS3,"float", EnumSet.of(Modifier.PRIVATE,Modifier.FINAL)); 95 Common.addMethod(js, "method2",Common.PARS1,"double", EnumSet.of(Modifier.PUBLIC,Modifier.STATIC)); 96 Common.addMethod(js, "method2",Common.PARS2,"boolean", EnumSet.of(Modifier.PUBLIC,Modifier.STATIC)); 97 Common.addMethod(js, "method2",Common.PARS3,"void", EnumSet.of(Modifier.PUBLIC,Modifier.STATIC)); 98 99 return passed; 100 } 101 102 104 protected void setUp() { 105 super.setUp(); 106 name = "JavaTestSourceMethodElem"; 107 packageName = "org.netbeans.test.java.testsources"; 108 } 109 110 } 111 | Popular Tags |