<!-- <questionid="arch-overall"when="init"> Describetheoverallarchitecture. <hint> WhatwillbeAPIfor <ahref="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi"> clientsandwhatsupportAPI</a>? Whatpartswillbepluggable? Howwillplug-insberegistered?Pleaseuse<code><apitype="export"/></code> todescribeyourgeneralAPIs. Ifpossiblepleaseprovide simplediagrams. </hint> </question>
-->
<answer id="arch-overall">
<p>
The module supports some aspects of JUnit-based testing.
</p>
<p>
There is no client API.
</p>
<p>
There is a support API (SPI) for a project-type-specific implementation
of JUnit:<br />
<api type="export"
name="org.netbeans.modules.junit.plugin"
group="java"
category="devel">
This SPI describes services provided by the
custom JUnit support plugin which are not desribed by the existing public SPI (<code>UnitTestForSourceQuery</code>). This SPI
represents an additional source of information for the JUnit module
and allows a custom test-skeleton generator to be plugged.
</api>
<api type="export"
name="JUnit-plugin-lookup"
group="lookup"
category="devel" url="org/netbeans/modules/junit/plugin/JUnitPlugin.html">
The object implementing the <code>JUnitPlugin</code> interface
is taken by the JUnit module from the current project's lookup,
the same way as the <code>UnitTestForSourceQuery</code>.
</api>
</p>
<p>
See the diagram:<br />
<img src="JUnitPlugin.png"
alt="diagram – the SPI provides an additional source of information"
width="398" height="441" />
</p>
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonetheworkshouldbe ready. </hint> </question>
-->
<answer id="arch-time">
<p>
It should be done by 6<sup>th</sup> April 2006.
We are two people working on the SPI. One person is working on the default
implementation of the plugin, second person is working on a plugin for J2ME
modules.
</p>
</answer>
<!-- <questionid="arch-usecases"when="init"> Describethemain<ahref="http://openide.netbeans.org/tutorial/api-design.html#usecase"> usecases</a>ofthenewAPI.Whowilluseitat whatcircumstancesandwhatwillbethetypicalcodetowrite tousethemodule. </question>
-->
<answer id="arch-usecases">
<p>
The SPI allows to plug a project-type-specific implementation of JUnit
support into NetBeans. The current NetBeans implementation only supports
JUnit on J2SE project types. The SPI describes services provided by the
custom JUnit support plugin.
</p>
<p>
The functionality to be plugged in comprises:
</p>
<ul>
<li>generation of test skeletons</li>
<li>navigation between source classes and corresponding test
classes</li>
</ul>
<p>
For navigation, the plugin defines mapping between source classes and
the corresponding test classes (both directions). Thus it provides
an additional information to the information provides by
<code>UnitTestForSourceQuery</code>
</p>
<p>
For generation of test skeletons, the plugin actually defines the whole
test skeleton generator - it generates one or more test files for
a given source file.
</p>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
The module makes creating, running and navigation between tests easier.
(Actual test running is typically performed directly by a
project type provider using Ant.)
</p>
</answer>
<!-- <questionid="dep-nb"when="init"> WhatotherNetBeansprojectsandmodulesdoesthisonedependon? <hint> Ifyouwant,describesuchprojectsasimportedAPIusing the<code><apiname="identification"type="importorexport"category="stable"url="whereisthedescription"/></code> </hint> </question>
-->
<answer id="dep-nb">
<defaultanswer generate='none'/>
<p>
These modules are required in project.xml file:
</p>
<ul>
<li><api type='import' group='java' category='stable' name='AntLogger'url='../org-apache-tools-ant-module/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 3.12
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='JavaSupportAPIs'url='../org-netbeans-api-java/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
</api>
</li> <!--retouche:--> <!-- <li><api type='import' group='java' category='stable' name='MDRAPI' url='../org-netbeans-api-mdr/overview-summary.html'> Themoduleisneededforcompilation. Themoduleisusedduringruntime. </api>
</li> -->
<li><api type='import' group='java' category='devel' name='MultiView'url='../org-netbeans-core-multiview/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
</api>
</li> <!--retouche:--> <!-- <li><api type='import' group='java' category='private' name='org.netbeans.jmi.javamodel' url='../org-netbeans-jmi-javamodel/overview-summary.html'> Themoduleisneededforcompilation. Themoduleisusedduringruntime. </api> </li> <li><apitype='import'group='java'category='private'name='javax.jmi.reflect'> Themoduleisneededforcompilation. Themoduleisusedduringruntime. </api> </li> <li><apitype='import'group='java'category='private'name='org.netbeans.modules.mdr'> Themoduleisneededforcompilation. Themoduleisusedduringruntime. </api>
</li> -->
<li><api type='import' group='java' category='official' name='JavaPlatformAPI'url='../org-netbeans-modules-java-platform/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
</api>
</li>
<li><api type='import' group='java' category='official' name='JavaProjectAPI'url='../org-netbeans-modules-java-project/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
</api>
</li> <!--retouche:--> <!-- <li><api type='import' group='java' category='devel' name='JavaCoreAPI' url='../org-netbeans-modules-javacore/overview-summary.html'> Themoduleisneededforcompilation. Themoduleisusedduringruntime. </api>
</li> -->
<li><api type='import' group='java' category='official' name='ProjectAPI'url='../org-netbeans-modules-projectapi/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
</api>
</li>
<li><api type='import' group='java' category='official' name='ProjectUIAPI'url='../org-netbeans-modules-projectuiapi/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
</api>
</li>
<li><api type='import' group='java' category='official' name='FilesystemsAPI'url='../org-openide-filesystems/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.2
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='UtilitiesAPI'url='../org-openide-util/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.4
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='ModulesAPI'url='../org-openide-modules/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.2
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='NodesAPI'url='../org-openide-nodes/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.2
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='ExplorerAPI'url='../org-openide-explorer/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.2
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='org.openide.awt'url='../org-openide-awt/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.5
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='DialogsAPI'url='../org-openide-dialogs/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.2
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='EditorAPI'url='../org-openide-text/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.2
is required.
</api>
</li>
<li><api type='import' group='java' category='official' name='LoadersAPI'url='../org-openide-loaders/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 1.0
is required.
</api>
</li> <!--retouche:--> <!-- <li><api type='import' group='java' category='official' name='JavaHierarchyAPI' url='../org-openide-src/overview-summary.html'> Themoduleisneededforcompilation. Themoduleisusedduringruntime. Specificationversion 1.0 isrequired. </api>
</li> -->
<li><api type='import' group='java' category='official' name='WindowSystemAPI'url='../org-openide-windows/overview-summary.html'>
The module is needed for compilation.
The module is used during runtime.
Specification version 6.2
is required.
</api>
</li>
</ul>
</answer>
<!-- <questionid="dep-non-nb"when="init"> WhatotherprojectsoutsideNetBeansdoesthisonedependon? <hint> Somenon-NetBeansprojectsarepackagedasNetBeansmodules (see<ahref="http://libs.netbeans.org/">libraries</a>)and itispreferredtousethisapproachwhenmoremodulesmay dependonsuchthird-partylibrary. </hint> </question>
-->
<answer id="dep-non-nb">
<p>
JUnit. The library is not used directly at runtime; but registered as a Java
library and inserted into the Ant runtime classpath.
</p>
</answer>
<!-- <questionid="deploy-packages"when="init"> Arepackagesofyourmodulemadeinaccessiblebynotdeclaringthem public? <hint> NetBeansmodulesystemallowsrestrictionofaccessrightsto publicclassesofyourmodulefromothermodules.Thisprevents unwanteddependenciesofothersonyourcodeandshouldbeused wheneverpossible(<ahref="http://www.netbeans.org/download/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.4-public-packages"> publicpackages </a>).Ifyoudonotrestrictaccesstoyourclassesyouare makingittooeasyforotherpeopletomisuseyourimplementation details,thatiswhyyoushouldhavegoodreasonfornot restrictingpackageaccess. </hint> </question>
-->
<answer id="deploy-packages">
<p>
Yes - only package <code>org.netbeans.modules.junit.plugin</code>
is available and it is only available to friend modules.
</p>
</answer>
<!-- <questionid="exec-introspection"when="impl"> Doesyourmoduleuseanykindofruntimetypeinformation(<code>instanceof</code>, workwith<code>java.lang.Class</code>,etc.)? <hint> CheckforcaseswhenyouhaveanobjectoftypeAandyoualso expectitto(possibly)beoftypeBanddosomespecialaction.That shouldbedocumented.Thesameappliesonoperationsinmeta-level (Class.isInstance(...),Class.isAssignableFrom(...),etc.). </hint> </question>
-->
<answer id="exec-introspection">
<p>
Yes. Constructor of class
<code>org.netbeans.modules.junit.plugin.JUnitPlugin.Location</code>
requires that its <code>javaElement</code> argument is either
<code>null</code> or an instance of <code>JavaClass</code> or
<code>Method</code>. This is checked using operator
<code>instanceof</code>.
</p>
<p>
The default implementation of <code>JUnitPlugin</code> uses reflection
heavily in the test skeleton generator.
</p>
<p>
There are several cases of using reflection (<code>instanceof</code>,
<code>Class.getName()</code>) in other parts of the module, too.
</p>
</answer>
<!-- <questionid="lookup-lookup"when="init"> Doesyourmoduleuse<code>org.openide.util.Lookup</code> oranysimilartechnologytofindanycomponentstocommunicatewith?Whichones? <hint> Pleasedescribetheinterfacesyouaresearchingfor,where aredefined,whetheryouaresearchingforjustoneormoreofthem, iftheorderisimportant,etc.Alsoclassifythestabilityofsuch APIcontract. </hint> </question>
-->
<answer id="lookup-lookup">
Yes. It uses lookup to find a custom JUnit plugin implementing the
plugin SPI in the project's lookup.
If there is no such object found, the default implementation (the one
for J2SE projects) is used. If there are multiple implementations
found, an arbitrary one is used. This contract is under development,
like the whole SPI.
</answer>
<!-- <questionid="lookup-register"when="final"> Doyouregisteranythingintolookupforothercodetofind? <hint> Doyouregisterusinglayerfileorusing<code>META-INF/services</code>? Whoissupposedtofindyourcomponent? </hint> </question>
-->
<answer id="lookup-register">
<p>
Registers the JUnit JAR to lookup so that it can be added to Ant's runtime
classpath by the Ant module.
</p>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
XXX no answer for perf-mem
</p>
</answer>
<!-- <questionid="perf-menus"when="final"> Doesyourmoduleusedynamicallyupdatedcontextmenus,or context-sensitiveactionswithcomplicatedenablementlogic? </question>
-->
<answer id="perf-menus">
<p>
Yes.
Actions <em>Create JUnit Tests</em> (in the <em>Tools</em> menu)
and <em>Go To Test/Go To Tested Class</em> (in the <em>Navigate</em> menu)
are context-sensitive and have quite complicated enablement logic.
</p>
</answer>
<!-- <questionid="perf-progress"when="final"> Doesyourmoduleexecuteanylong-runningtasks? <hint>Longrunningtasksshouldneverblock AWTthreadasitbadlyhurtstheUI <ahref="http://performance.netbeans.org/responsiveness/issues.html"> responsiveness</a>. Taskslikeconnectingover network,computinghugeamountofdata,compilation bedoneasynchronously(forexample using<code>RequestProcessor</code>),definitivelyitshould notblockAWTthread. </hint> </question>
-->
<answer id="perf-progress">
<p>
No. (Running unit tests is done by project types using Ant.)
</p>
</answer>
<!-- <questionid="perf-spi"when="init"> Howtheperformanceofthepluggedincodewillbeenforced? <hint> Ifyouallowforeigncodetobepluggedintoyourownmodule,how doyouenforce,thatitwillbehavecorrectlyandfastandwillnot negativelyinfluencetheperformanceofyourownmodule? </hint> </question>
-->
<answer id="perf-spi">
<p>
The SPI allows an external test
skeleton generator to be plugged. The plugin should generate the task
quickly but there is no mechanism that would check the speed or correctness
of the plugin.
</p>
</answer>
<!-- <questionid="resources-preferences"when="final"> DoesyourmoduleusespreferencesviaPreferencesAPI?DoesyourmoduleuseNbPreferencesor orregularJDKPreferences?Doesitread,writeorboth? Doesitsharepreferenceswithothermodules?Ifso,thenwhy? <hint> Youmayuse <apitype="export"group="preferences" name="preferencenodename"category="private"> descriptionofindividualkeys,whereitisused,whatit influences,whetherthemodulereads/writeit,etc. </api> DuetoXMLIDrestrictions,ratherthan/org/netbeans/modules/foogivethe"name"asorg.netbeans.modules.foo. NotethatifyouuseNbPreferencesthisnamewillthenbethesameasthecodenamebaseofthemodule. </hint> </question>
-->
<answer id="resources-preferences">
<p>
<code>NbPreferences</code> is used, both for reading and writing.
The preferences are not shared with other modules.
</p>
</answer>
</api-answers>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.34 Sekunden
(vorverarbeitet am 2026-09-30)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.