package org.netbeans.jellytools.examples; import java.io.File; import org.netbeans.jellytools.JellyTestCase; import org.netbeans.jellytools.NewObjectNameStepOperator; import org.netbeans.jellytools.NewWizardOperator; import org.netbeans.jellytools.actions.FilesystemsViewAction; import org.netbeans.jellytools.nodes.JavaNode; import org.netbeans.jellytools.nodes.FilesystemNode; import org.netbeans.junit.NbTestSuite; //creates a file by wizard //requires that /sampledir/HelloWorld does not exists. public class TestWizard extends JellyTestCase { public TestWizard(java.lang.String testName) { super(testName); } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(suite()); } public static junit.framework.Test suite() { return new NbTestSuite(TestWizard.class); } public void testWizard() { //show Filesystems new FilesystemsViewAction().perform(); //create a node for the sampledir directory FilesystemNode tmpNode = new FilesystemNode( System.getProperty("netbeans.user") + File.separator + "sampledir"); //invoke wizard on the node and select template NewWizardOperator wizard = NewWizardOperator.invoke(tmpNode, "Java Classes|Class"); //type name new NewObjectNameStepOperator().setName("HelloWorld"); //push "Finish" button wizard.finish(); //create node JavaNode clNode = new JavaNode(tmpNode, "HelloWorld"); } }