站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

JUnitPlugin (JUnit Tests) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.junit/2 2.23

org.netbeans.modules.junit.plugin
Class JUnitPlugin

java.lang.Object
  extended by org.netbeans.modules.junit.plugin.JUnitPlugin

public abstract class JUnitPlugin
extends Object

SPI for custom implementations of support for JUnit. It declares methods for:


Nested Class Summary
static class JUnitPlugin.CreateTestParam
          Enumeration of test creation parameters.
static class JUnitPlugin.Location
          Data structure for storage of specification of a Java element or a Java file.
 
Constructor Summary
protected JUnitPlugin()
          Default constructor for use by subclasses.
 
Method Summary
protected  boolean createTestActionCalled(FileObject[] selectedFiles)
          Called immediately after the Create Test action was called.
protected abstract  FileObject[] createTests(FileObject[] filesToTest, FileObject targetRoot, Map<JUnitPlugin.CreateTestParam,Object> params)
          Creates test classes for given source classes.
protected abstract  JUnitPlugin.Location getTestedLocation(JUnitPlugin.Location testLocation)
          Returns a specification of a Java element or file that is tested by the given test Java element or test file.
protected abstract  JUnitPlugin.Location getTestLocation(JUnitPlugin.Location sourceLocation)
          Returns a specification of a Java element or file representing test for the given source Java element or file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JUnitPlugin

protected JUnitPlugin()
Default constructor for use by subclasses.

Method Detail

getTestLocation

protected abstract JUnitPlugin.Location getTestLocation(JUnitPlugin.Location sourceLocation)
Returns a specification of a Java element or file representing test for the given source Java element or file.

Parameters:
sourceLocation - specification of a Java element or file
Returns:
specification of a corresponding test Java element or file, or null if no corresponding test Java file is available

getTestedLocation

protected abstract JUnitPlugin.Location getTestedLocation(JUnitPlugin.Location testLocation)
Returns a specification of a Java element or file that is tested by the given test Java element or test file.

Parameters:
testLocation - specification of a Java element or file
Returns:
specification of a Java element or file that is tested by the given Java element or file.

createTests

protected abstract FileObject[] createTests(FileObject[] filesToTest,
                                            FileObject targetRoot,
                                            Map<JUnitPlugin.CreateTestParam,Object> params)
Creates test classes for given source classes. If the plugin does not support creating tests, implementation of this method should return null.

Parameters:
filesToTest - source files for which test classes should be created
targetRoot - root folder of the target source root
params - parameters of creating test class - each key is an Integer whose value is equal to some of the constants defined in the class; the value is either a String (for key with value CLASS_NAME) or a Boolean (for other keys)
Returns:
created test files, or null if no test classes were created and/or updated
See Also:
#canCreateTests

createTestActionCalled

protected boolean createTestActionCalled(FileObject[] selectedFiles)
Called immediately after the Create Test action was called. It can be used as a trigger for additional checks and/or for displaying user dialogs etc. It is always called from the event-dispatching thread.

Parameters:
selectedFiles - files and folders/packages that were selected when the action was called
Returns:
true if the action can continue, false if the action should not continue; the default implementation returns always true

org.netbeans.modules.junit/2 2.23

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.