Skip to content
Snippets Groups Projects
Commit d076d1e9 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

fix javadoc warnings, issue 15 resolved

parent d4c0bb80
No related branches found
No related tags found
No related merge requests found
Showing
with 101 additions and 11 deletions
......@@ -42,31 +42,36 @@ public class AllPduRoundTripTest
PduFactory pduFactory;
PduRecorder pduRecorder;
/** Prepare */
@BeforeAll
public static void beforeAllTests()
{
System.out.println("AllPduRoundTripTest");
File file = new File("./pduLog");
for (File subFile : file.listFiles()) {
subFile.delete();
}
}
/** Finish */
@AfterAll
public static void afterAllTests()
{
}
@BeforeEach
/** Setup initialization before each test */
@BeforeEach
public void setUp() {
File file = new File("./pduLog");
for (File subFile : file.listFiles()) {
subFile.delete();
}
}
/** Housekeeping after each test */
@AfterEach
public void tearDown()
{
}
/** Check ability to send and receive each DIS PDU */
@Test
public void testRoundTripAllPdus()
{
......@@ -77,6 +82,7 @@ public class AllPduRoundTripTest
pduFactory = new PduFactory(Country.PHILIPPINES_PHL, (byte) 11, (byte) 22, (short) 33, DisTime.TimestampStyle.IEEE_ABSOLUTE);
// 72 total
pdusSent.add(pduFactory.makeAcknowledgePdu());
pdusSent.add(pduFactory.makeAcknowledgeReliablePdu());
pdusSent.add(pduFactory.makeActionRequestPdu());
......@@ -176,7 +182,12 @@ public class AllPduRoundTripTest
System.out.println ("*** AllPduRoundTripTest testRoundTripAllPdus() complete");
}
private void setupSenderRecorder() throws Exception {
/** setup the common send/receive network interface
* @see PduRecorder
* @see DisNetworkInterface
*/
private void setupSenderRecorder() throws Exception
{
pduRecorder = new PduRecorder(); // default network address, port, logfile dir
pduRecorder.setDescriptor(this.getClass().getName() + " unit test");
pduRecorder.start();
......@@ -197,13 +208,13 @@ public class AllPduRoundTripTest
System.out.println("Recorder log at " + pduRecorder.getLogFilePath());
}
/** Will shutdown the common send/receive network interface */
/** shutdown the common send/receive network interface */
private void shutDownSenderRecorder() throws Exception
{
disNetworkInterface.removeListener(pduListener);
pduRecorder.stop();
}
/** comparison test */
private void testForEquals() throws Exception
{
// System.out.println("*** Warning: ensure no prior dislog files are present in pduLog directory or assertion count of replay will fail.");
......@@ -215,7 +226,8 @@ public class AllPduRoundTripTest
assertIterableEquals(pdusSent, pdusReceived, "Sent and received pdus not identical");
System.out.println("... testForEquals() assertIterableEquals() passed");
}
/** not used, legacy code */
@Deprecated
private void getAllFromRecorder(Semaphore sem) throws Exception
{
sem.acquire();
......@@ -233,6 +245,8 @@ public class AllPduRoundTripTest
});
}
/** not used, legacy code */
@Deprecated
private void testRecorderForEquals() throws Exception
{
// TODO this may fail if prior dislog files are present in pduLog directory, ignore them to make it less brittle
......@@ -249,7 +263,7 @@ public class AllPduRoundTripTest
// TODO is this sufficient? has each PDU value been compared as well?
}
/** being careful during threaded operations, also encourage in-order receipt before next send */
private static void sleep(long ms) {
try {
Thread.sleep(ms);
......@@ -258,8 +272,12 @@ public class AllPduRoundTripTest
}
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
System.out.println ("*** AllPduRoundTripTest main() started...");
AllPduRoundTripTest allPduRoundTripTest = new AllPduRoundTripTest(); // create instance
allPduRoundTripTest.testRoundTripAllPdus();
System.out.println ("*** AllPduRoundTripTest main() complete");
......
......@@ -22,17 +22,20 @@ public class CommentPdusTest
Pdu receivedPdu;
DisThreadedNetworkInterface.PduListener pduListener;
/** Setup initialization before each test */
@BeforeAll
public static void setUpClass()
{
System.out.println("CommentPdusTest");
}
/** Housekeeping after each test */
@AfterAll
public static void tearDownClass()
{
}
/** Setup initialization before each test */
@BeforeEach
public void setUp()
{
......@@ -46,6 +49,7 @@ public class CommentPdusTest
disNetworkInterface.addListener(pduListener);
}
/** Housekeeping after each test */
@AfterEach
public void tearDown()
{
......@@ -91,6 +95,7 @@ public class CommentPdusTest
receivedPdu = null; // ensure cleared prior to next test
}
/** send the PDU of interest */
private void sendPdu(Pdu pdu)
{
try {
......@@ -103,6 +108,7 @@ public class CommentPdusTest
}
}
/** comparison test */
private boolean compare(Pdu pdu1, Pdu pdu2)
{
return pdu1.equals(pdu2);
......@@ -113,6 +119,9 @@ public class CommentPdusTest
receivedPdu = newPdu;
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
CommentPdusTest commentPdusTest = new CommentPdusTest();
......
......@@ -19,27 +19,32 @@ import static org.junit.jupiter.api.Assertions.assertNull;
@DisplayName("All Object Types Create")
public class CreateAllObjectTypesTest
{
/** preparation **/
@BeforeAll
public static void beforeAllTests()
{
System.out.println("CreateAllObjectTypesTest");
}
/** housekeeping **/
@AfterAll
public static void afterAllTests()
{
}
/** Setup initialization before each test */
@BeforeEach
public void setUp()
{
}
/** Housekeeping after all tests */
@AfterEach
public void tearDown()
{
}
/** Perform test of interest */
@Test
public void testCreateAllObjectTypes()
{
......@@ -276,6 +281,9 @@ public class CreateAllObjectTypesTest
System.out.println(String.format(formatString, name, domain, kind, objectType.getCategory(), objectType.getSubCategory()));
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
new CreateAllObjectTypesTest().testCreateAllObjectTypes();
......
......@@ -94,26 +94,31 @@ import org.junit.jupiter.api.Test;
*/
public class CreateAllPduTypesTest
{
/** constructor */
public CreateAllPduTypesTest()
{
}
/** preparation **/
@BeforeAll
public static void setUpClass()
{
System.out.println("CreateAllPduTypesTest");
}
/** Housekeeping after all tests */
@AfterAll
public static void tearDownClass()
{
}
/** Setup initialization before each test */
@BeforeEach
public void setUp()
{
}
/** Housekeeping after each test */
@AfterEach
public void tearDown()
{
......@@ -124,6 +129,7 @@ public class CreateAllPduTypesTest
private Throwable throwable;
/** Perform test of interest */
@Test
public void testCreateAll()
{
......@@ -228,6 +234,9 @@ public class CreateAllPduTypesTest
assertNull(throwable, "Exception should be null if successful marshal");
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
new CreateAllPduTypesTest().testCreateAll();
......
......@@ -26,17 +26,20 @@ public class DataQueryPduRoundTripTest
DisThreadedNetworkInterface disNetworkInterface;
DisThreadedNetworkInterface.PduListener pduListener;
/** preparation **/
@BeforeAll
public static void setUpClass()
{
System.out.println("DataQueryPduRoundTripTest");
}
/** Housekeeping after all tests */
@AfterAll
public static void tearDownClass()
{
}
/** Setup initialization before each test */
@BeforeEach
public void setUp()
{
......@@ -50,6 +53,7 @@ public class DataQueryPduRoundTripTest
disNetworkInterface.addListener(pduListener);
}
/** Housekeeping after each test */
@AfterEach
public void tearDown()
{
......@@ -97,6 +101,7 @@ public class DataQueryPduRoundTripTest
// variableDatum2.setVariableDatumLength(variableDatum2Value.length); // should be done automatically
}
/** Perform test of interest */
@Test
public void testRoundTrip()
{
......@@ -132,6 +137,9 @@ public class DataQueryPduRoundTripTest
receivedPdu = pdu;
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
DataQueryPduRoundTripTest drt = new DataQueryPduRoundTripTest();
......
......@@ -47,6 +47,7 @@ import org.junit.jupiter.api.Test;
@DisplayName("Detonation Pdu Test")
public class DetonationPduTest extends PduTest {
/** constructor **/
public DetonationPduTest() {
}
......@@ -94,6 +95,9 @@ public class DetonationPduTest extends PduTest {
testPduFinishingChecks(createdPdu); // shared tests in superclass
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
PduTest detonationPduTest = new DetonationPduTest();
......
......@@ -93,6 +93,9 @@ public class EntityStatePduTest extends PduTest
testPduFinishingChecks(createdPdu); // shared tests in superclass
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
EntityStatePduTest entityStatePduTest = new EntityStatePduTest();
......
......@@ -18,27 +18,32 @@ import static org.junit.jupiter.api.Assertions.assertNull;
@DisplayName("Marshal Enums Test")
public class MarshalEnumsTest
{
/** preparation **/
@BeforeAll
public static void setUpClass()
{
System.out.println("MarshalEnumsTest");
}
/** Housekeeping after all tests */
@AfterAll
public static void tearDownClass()
{
}
/** Setup initialization before each test */
@BeforeEach
public void setUp()
{
}
/** Housekeeping after each test */
@AfterEach
public void tearDown()
{
}
/** Perform test of interest */
@Test
public void testGoodMarshall()
{
......@@ -591,6 +596,9 @@ public class MarshalEnumsTest
System.out.println();
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
new MarshalEnumsTest().testGoodMarshall();
......
......@@ -21,28 +21,33 @@ public class NullFieldsEntityMarshallTest
{
LAV105 lav105;
/** preparation **/
@BeforeAll
public static void beforeAllTests()
{
System.out.println("NullFieldsEntityMarshallTest");
}
/** housekeeping **/
@AfterAll
public static void afterAllTests()
{}
/** Setup initialization before each test */
@BeforeEach
public void setUp()
{
lav105 = new LAV105();
}
/** Housekeeping after each test */
@AfterEach
public void tearDown()
{
lav105 = null;
}
/** Perform test of interest */
@Test
public void testNoSpecificNoExtraMarshal()
{
......@@ -61,6 +66,7 @@ public class NullFieldsEntityMarshallTest
assertEquals(8, byteBuffer.position(), "Marshalled array should be 8 bytes long");
}
/** Perform test of interest */
@Test
public void testGoodMarshall()
{
......@@ -100,6 +106,9 @@ public class NullFieldsEntityMarshallTest
System.out.println("LAV_105 extra: " + entityType.getExtra());
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
NullFieldsEntityMarshallTest inst = new NullFieldsEntityMarshallTest();
......
......@@ -18,18 +18,25 @@ import static org.junit.jupiter.api.Assertions.assertNull;
@DisplayName("Object Type Marshal Test")
public class ObjectTypeMarshallTest
{
/** preparation **/
@BeforeAll
public static void setUpClass()
{
System.out.println("ObjectTypeMarshallTest");
}
/** Housekeeping after all tests */
@AfterAll
public static void tearDownClass(){}
/** Setup initialization before each test */
@BeforeEach
public void setUp(){}
/** Housekeeping after each test */
@AfterEach
public void tearDown(){}
/** Perform test of interest */
@Test
public void testGoodMarshall()
{
......@@ -44,6 +51,7 @@ public class ObjectTypeMarshallTest
assertNull(thr, "Exception should be null if successful marshal");
}
/** Perform test of interest */
@Test
public void testNoSubCategory()
{
......@@ -85,6 +93,9 @@ public class ObjectTypeMarshallTest
System.out.println(String.format(formatStr, nm, dom, kind, ot.getCategory(), ot.getSubCategory()));
}
/** Command-line invocation (CLI) of program, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
ObjectTypeMarshallTest inst = new ObjectTypeMarshallTest();
......
......@@ -50,6 +50,7 @@ import org.junit.jupiter.api.BeforeEach;
abstract public class PduTest
{
/** default thread sleep interval msec */
protected final long THREAD_SLEEP_INTERVAL_MSEC_DEFAULT = 1000l; // e.g. 100 msec, type long
private long threadSleepInterval = THREAD_SLEEP_INTERVAL_MSEC_DEFAULT;
private int maximumRetryAttempts = 10;
......@@ -58,12 +59,14 @@ abstract public class PduTest
DisThreadedNetworkInterface disNetworkInterface;
DisThreadedNetworkInterface.PduListener pduListener;
/** preparation **/
@BeforeAll
public static void setUpClass()
{
System.out.println("EntityStatePduTest");
}
/** housekeeping **/
@AfterAll
public static void tearDownClass()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment