Skip to content

Commit

Permalink
apidoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarboni committed Mar 2, 2023
1 parent aa6c56b commit d16aa78
Show file tree
Hide file tree
Showing 61 changed files with 375 additions and 90 deletions.
4 changes: 2 additions & 2 deletions harness/nbjunit/apichanges.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<compatibility addition="yes"/>
<description>
<p>
Add support for JUnit <a href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</a> annotation on NbTestCase test case extension.
Add support for JUnit <a href="https://junit.org/junit4/javadoc/latest/org/junit/Ignore.html">@Ignore</a> annotation on NbTestCase test case extension.
</p>
</description>
<class package="org.netbeans.junit" name="NbTestCase"/>
Expand Down Expand Up @@ -389,7 +389,7 @@
Methods <code>enableInstances</code> and
<code>assertInstances</code> added to <code>Log</code> class to
simplify writing memory leaks tests integrated with
<a href="http://wiki.netbeans.org/wiki/view/FitnessViaTimersCounters">timers/counters</a> infastructure.
<a href="https://netbeans.apache.org/wiki/FitnessViaTimersCounter">timers/counters</a> infastructure.
</p>
</description>
<class package="org.netbeans.junit" name="Log"/>
Expand Down
6 changes: 3 additions & 3 deletions harness/nbjunit/src/org/netbeans/junit/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public String toString() {
* the use of additional log messages inserted into the code.
* <p>
* The best example showing usage of this method is real life test.
* Read <a href="http://hg.netbeans.org/main/raw-file/tip/nbjunit/test/unit/src/org/netbeans/junit/FlowControlTest.java">FlowControlTest.java</a> to know everything
* Read <a href="https://github.com/apache/netbeans/tree/master/harness/nbjunit/test/unit/src/org/netbeans/junit/FlowControlTest.java">FlowControlTest.java</a> to know everything
* about the expected usage of this method.
* <p>
* The method does listen on output send to a logger <code>listenTo</code>
Expand All @@ -156,7 +156,7 @@ public String toString() {
* </pre>
* which define the order saying that at this time a thread with a given name
* is expected to send given message. Both the name of the thread and
* the message are regular expressions so one can shorten them by using <q>.*</q>
* the message are regular expressions so one can shorten them by using <code>.*</code>
* or any other trick. Btw. the format of the <code>order</code> is similar
* to the one logged by the {@link Log#enable} or {@link NbTestCase#logLevel} methods,
* so when one gets a test failure with enabled logging,
Expand All @@ -179,7 +179,7 @@ public static void controlFlow(Logger listenTo, Logger reportTo, String order, i
/** Starts to listen on given log and collect parameters of messages that
* were send to it. This is supposed to be called at the beginning of a test,
* to get messages from the programs that use
* <a href="http://wiki.netbeans.org/wiki/view/FitnessViaTimersCounters">timers/counters</a>
* <a href="https://netbeans.apache.org/wiki/FitnessViaTimersCounter">timers/counters</a>
* infrastructure. At the end one should call {@link #assertInstances}.
*
*
Expand Down
2 changes: 1 addition & 1 deletion harness/nbjunit/src/org/netbeans/junit/MemoryFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface MemoryFilter {
* JVM heap and it must return the same result if
* it gets some instance multiple times. And
* it must be very fast.
*
* @param obj instance to check
* @return <code>true</code> if passed instance is not accepted.
*
* <p>E.g.:
Expand Down
6 changes: 3 additions & 3 deletions harness/nbjunit/src/org/netbeans/junit/MockServices.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@

/**
* Lets you register mock implementations of global services.
* You might for example do this in {@link junit.framework.TestCase#setUp}.
* You might for example do this in {@link junit.framework.TestCase#setUp()}.
* <p>If you need to register individual instances, and are using the <code>Lookup</code>
* framework, try <code>org.openide.util.test.MockLookup</code>.
* @see <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-util/org/openide/util/Lookup.html"><code>Lookup</code></a>
* @see <a href="http://download.java.net/jdk6/docs/api/java/util/ServiceLoader.html"><code>ServiceLoader</code></a>
* @see <a href="https://github.com/apache/netbeans/tree/master/platform/openide.util.lookup/src/org/openide/util/Lookup.java"><code>Lookup</code></a>
* @see java.util.ServiceLoader
* @since org.netbeans.modules.nbjunit/1 1.30
* @author Jesse Glick, Jaroslav Tulach
*/
Expand Down
1 change: 1 addition & 0 deletions harness/nbjunit/src/org/netbeans/junit/MultiTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public MultiTestCase() {

/**
* Creates a new instance of MultiTestCase with the given name.
* @param name name of test case
*/
public MultiTestCase(String name) {
super(name);
Expand Down
4 changes: 4 additions & 0 deletions harness/nbjunit/src/org/netbeans/junit/MultiTestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public MultiTestSuite() {

/**
* Constructs a MultiTestSuite with the given name.
* @param name name of the test suite
*/
public MultiTestSuite(String name){
super(name);
Expand All @@ -44,11 +45,13 @@ public MultiTestSuite(String name){
/**
* Factory method returns a new instance of a testcases.
* Should return null if there are no more testcases to be executed.
* @return test case
*/
protected abstract MultiTestCase nextTestCase();

/**
* Runs the tests and collects their result in a TestResult.
* @param result collector for result
*/
public void run(TestResult result) {
if(isPrepared()){
Expand All @@ -61,6 +64,7 @@ public void run(TestResult result) {

/**
* Creates all testcases and runs them.
* @param result collector for result
*/
protected void runAllTests(TestResult result){
MultiTestCase testCase = null;
Expand Down
4 changes: 2 additions & 2 deletions harness/nbjunit/src/org/netbeans/junit/NbModuleSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
* For more advanced configuration see {@link #emptyConfiguration()} and {@link Configuration}.
*
* @since 1.46
* @author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
* @author Jaroslav Tulach &lt;jaroslav.tulach@netbeans.org&gt;
*/
public class NbModuleSuite {
private static final Logger LOG;
Expand Down Expand Up @@ -273,7 +273,7 @@ Configuration classLoader(ClassLoader parent) {
/** Adds new test name, or array of names into the configuration. By
* default the suite executes all <code>testXYZ</code>
* methods present in the test class
* (the one passed into {@link Configuration#create(java.lang.Class)}
* (the one passed into {@link NbModuleSuite#createConfiguration(java.lang.Class)}
* method). However if there is a need to execute just some of them,
* one can use this method to explicitly enumerate them by subsequent
* calls to <code>addTest</code> method.
Expand Down
3 changes: 1 addition & 2 deletions harness/nbjunit/src/org/netbeans/junit/NbTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ private Throwable noteRandomness(Throwable t) {
/** Parses the test name to find out whether it encodes a number. The
* testSomeName1343 represents number 1343.
* @return the number
* @exception may throw AssertionFailedError if the number is not found in the test name
*/
protected final int getTestNumber() {
try {
Expand Down Expand Up @@ -1409,7 +1408,7 @@ public static void assertGC(String text, Reference<?> ref) {
* rootset for this scan. This is useful if you want to verify that one structure
* (usually long living in real application) is not holding another structure
* in memory, without setting a static reference to the former structure.
* <h3>Example:</h3>
* <p><strong>Example:</strong></p>
* <pre>
* // test body
* WeakHashMap map = new WeakHashMap();
Expand Down
161 changes: 139 additions & 22 deletions harness/nbjunit/src/org/netbeans/junit/NbTestDecorator.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
*/
public class NbTestDecorator extends TestDecorator implements NbTest {

/**
*/
/**
* @param test junit test instance
*/
public NbTestDecorator(Test test) {
super(test);
}
Expand Down Expand Up @@ -91,65 +92,181 @@ public boolean canRun() {
// please see more documentatino in this file.


/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param message the detail message for this assertion
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
* @param diff file, where differences will be stored, when null differences
* will not be stored. In case it points to directory the result file name
* is constructed from the <b>pass</b> argument and placed to that
* directory. Constructed file name consists from the name of pass file
* (without extension and path) appended by the '.diff'.
* @param externalDiff instance of class implementing the
* {@link org.netbeans.junit.diff.Diff} interface, it has to be already
* initialized, when passed in this assertFile function.
*/
public static void assertFile(String message, String test, String pass, String diff, Diff externalDiff) {
NbTestCase.assertFile(message,test,pass,diff,externalDiff);
}

/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
* @param diff file, where differences will be stored, when null differences
* will not be stored. In case it points to directory the result file name
* is constructed from the <b>pass</b> argument and placed to that
* directory. Constructed file name consists from the name of pass file
* (without extension and path) appended by the '.diff'.
* @param externalDiff instance of class implementing the
* {@link org.netbeans.junit.diff.Diff} interface, it has to be already
* initialized, when passed in this assertFile function.
*/
public static void assertFile(String test, String pass, String diff, Diff externalDiff) {
NbTestCase.assertFile(test, pass, diff, externalDiff);
}

/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param message the detail message for this assertion
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
* @param diff file, where differences will be stored, when null differences
* will not be stored. In case it points to directory the result file name
* is constructed from the <b>pass</b> argument and placed to that
* directory. Constructed file name consists from the name of pass file
* (without extension and path) appended by the '.diff'.
*/
public static void assertFile(String message, String test, String pass, String diff) {
NbTestCase.assertFile(message, test, pass, diff);
}

/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
* @param diff file, where differences will be stored, when null differences
* will not be stored. In case it points to directory the result file name
* is constructed from the <b>pass</b> argument and placed to that
* directory. Constructed file name consists from the name of pass file
* (without extension and path) appended by the '.diff'.
*/
public static void assertFile(String test, String pass, String diff) {
NbTestCase.assertFile(test, pass, diff);
}

/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
*/
public static void assertFile(String test, String pass) {
NbTestCase.assertFile(test, pass);
}


/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param message the detail message for this assertion
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
* @param diff file, where differences will be stored, when null differences
* will not be stored. In case it points to directory the result file name
* is constructed from the <b>pass</b> argument and placed to that
* directory. Constructed file name consists from the name of pass file
* (without extension and path) appended by the '.diff'.
* @param externalDiff instance of class implementing the
* {@link org.netbeans.junit.diff.Diff} interface, it has to be already
* initialized, when passed in this assertFile function.
*/
public static void assertFile(String message, File test, File pass, File diff, Diff externalDiff) {
NbTestCase.assertFile(message,test,pass,diff,externalDiff);
}


/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
* @param diff file, where differences will be stored, when null differences
* will not be stored. In case it points to directory the result file name
* is constructed from the <b>pass</b> argument and placed to that
* directory. Constructed file name consists from the name of pass file
* (without extension and path) appended by the '.diff'.
* @param externalDiff instance of class implementing the
* {@link org.netbeans.junit.diff.Diff} interface, it has to be already
* initialized, when passed in this assertFile function.
*/
public static void assertFile(File test, File pass, File diff, Diff externalDiff) {
NbTestCase.assertFile(test, pass, diff, externalDiff);
}


/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param message the detail message for this assertion
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
* @param diff file, where differences will be stored, when null differences
* will not be stored. In case it points to directory the result file name
* is constructed from the <b>pass</b> argument and placed to that
* directory. Constructed file name consists from the name of pass file
* (without extension and path) appended by the '.diff'.
*/
public static void assertFile(String message, File test, File pass, File diff) {
NbTestCase.assertFile(message, test, pass, diff);
}

/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
* @param diff file, where differences will be stored, when null differences
* will not be stored. In case it points to directory the result file name
* is constructed from the <b>pass</b> argument and placed to that
* directory. Constructed file name consists from the name of pass file
* (without extension and path) appended by the '.diff'.
*/
public static void assertFile(File test, File pass, File diff) {
NbTestCase.assertFile(test,pass,diff);
}

/** for description, see this method in NbTestCase class
*/
/**
* for description, see this method in NbTestCase class.
*
* @param test first file to be compared, by the convention this should be
* the test-generated file
* @param pass second file to be compared, it should be so called 'golden'
* file, which defines the correct content for the test-generated file.
*/
public static void assertFile(File test, File pass) {
NbTestCase.assertFile(test, pass);
}
Expand Down
2 changes: 2 additions & 0 deletions harness/nbjunit/src/org/netbeans/junit/NbTestSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ public void protect() throws Exception {
/**
* Sets up the fixture. Override to set up additional fixture
* state.
* @throws Exception if an exception occurs
*/
protected void setUp() throws Exception {
}
/**
* Tears down the fixture. Override to tear down the additional
* fixture state.
* @throws Exception if an exception occurs
*/
protected void tearDown() throws Exception {
}
Expand Down
Loading

0 comments on commit d16aa78

Please sign in to comment.