Skip to content
Snippets Groups Projects
Commit 17b48a93 authored by Terry D. Norbraten's avatar Terry D. Norbraten
Browse files

refactors

parent 9b8d5063
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.*; ...@@ -34,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.*;
public class AllPduRoundTripTest public class AllPduRoundTripTest
{ {
private PduFactory fact; private PduFactory pduFactory;
@BeforeAll @BeforeAll
public static void beforeAllTests() public static void beforeAllTests()
...@@ -70,80 +70,80 @@ public class AllPduRoundTripTest ...@@ -70,80 +70,80 @@ public class AllPduRoundTripTest
catch (InterruptedException ex2) { catch (InterruptedException ex2) {
} }
fact = new PduFactory(Country.PHILIPPINES_PHL, (byte) 11, (byte) 22, (short) 33, true); pduFactory = new PduFactory(Country.PHILIPPINES_PHL, (byte) 11, (byte) 22, (short) 33, true);
sendOne(fact.makeAcknowledgePdu()); sendOnePdu(pduFactory.makeAcknowledgePdu());
sendOne(fact.makeAcknowledgeReliablePdu()); sendOnePdu(pduFactory.makeAcknowledgeReliablePdu());
sendOne(fact.makeActionRequestPdu()); sendOnePdu(pduFactory.makeActionRequestPdu());
sendOne(fact.makeActionRequestReliablePdu()); sendOnePdu(pduFactory.makeActionRequestReliablePdu());
sendOne(fact.makeActionResponsePdu()); sendOnePdu(pduFactory.makeActionResponsePdu());
sendOne(fact.makeActionResponseReliablePdu()); sendOnePdu(pduFactory.makeActionResponseReliablePdu());
sendOne(fact.makeAggregateStatePdu()); sendOnePdu(pduFactory.makeAggregateStatePdu());
sendOne(fact.makeAppearancePdu()); sendOnePdu(pduFactory.makeAppearancePdu());
sendOne(fact.makeArealObjectStatePdu()); sendOnePdu(pduFactory.makeArealObjectStatePdu());
sendOne(fact.makeArticulatedPartsPdu()); sendOnePdu(pduFactory.makeArticulatedPartsPdu());
sendOne(fact.makeAttributePdu()); sendOnePdu(pduFactory.makeAttributePdu());
sendOne(fact.makeCollisionElasticPdu()); sendOnePdu(pduFactory.makeCollisionElasticPdu());
sendOne(fact.makeCollisionPdu()); sendOnePdu(pduFactory.makeCollisionPdu());
sendOne(fact.makeCommentPdu()); sendOnePdu(pduFactory.makeCommentPdu());
sendOne(fact.makeCommentReliablePdu()); sendOnePdu(pduFactory.makeCommentReliablePdu());
sendOne(fact.makeCreateEntityPdu()); sendOnePdu(pduFactory.makeCreateEntityPdu());
sendOne(fact.makeCreateEntityReliablePdu()); sendOnePdu(pduFactory.makeCreateEntityReliablePdu());
sendOne(fact.makeDataPdu()); sendOnePdu(pduFactory.makeDataPdu());
sendOne(fact.makeDataQueryPdu()); sendOnePdu(pduFactory.makeDataQueryPdu());
sendOne(fact.makeDataQueryReliablePdu()); sendOnePdu(pduFactory.makeDataQueryReliablePdu());
sendOne(fact.makeDataReliablePdu()); sendOnePdu(pduFactory.makeDataReliablePdu());
sendOne(fact.makeDesignatorPdu()); sendOnePdu(pduFactory.makeDesignatorPdu());
sendOne(fact.makeDetonationPdu()); sendOnePdu(pduFactory.makeDetonationPdu());
sendOne(fact.makeDirectedEnergyFirePdu()); sendOnePdu(pduFactory.makeDirectedEnergyFirePdu());
sendOne(fact.makeElectronicEmissionsPdu()); sendOnePdu(pduFactory.makeElectronicEmissionsPdu());
sendOne(fact.makeEntityDamageStatusPdu()); sendOnePdu(pduFactory.makeEntityDamageStatusPdu());
sendOne(fact.makeEntityStatePdu()); sendOnePdu(pduFactory.makeEntityStatePdu());
sendOne(fact.makeEntityStateUpdatePdu()); sendOnePdu(pduFactory.makeEntityStateUpdatePdu());
sendOne(fact.makeEnvironmentalProcessPdu()); sendOnePdu(pduFactory.makeEnvironmentalProcessPdu());
sendOne(fact.makeEventReportPdu()); sendOnePdu(pduFactory.makeEventReportPdu());
sendOne(fact.makeEventReportReliablePdu()); sendOnePdu(pduFactory.makeEventReportReliablePdu());
sendOne(fact.makeFirePdu()); sendOnePdu(pduFactory.makeFirePdu());
sendOne(fact.makeGriddedDataPdu()); sendOnePdu(pduFactory.makeGriddedDataPdu());
sendOne(fact.makeIffPdu()); sendOnePdu(pduFactory.makeIffPdu());
sendOne(fact.makeInformationOperationsReportPdu()); sendOnePdu(pduFactory.makeInformationOperationsReportPdu());
sendOne(fact.makeInformationOperationsActionPdu()); sendOnePdu(pduFactory.makeInformationOperationsActionPdu());
sendOne(fact.makeIntercomControlPdu()); sendOnePdu(pduFactory.makeIntercomControlPdu());
sendOne(fact.makeIntercomSignalPdu()); sendOnePdu(pduFactory.makeIntercomSignalPdu());
sendOne(fact.makeIsGroupOfPdu()); sendOnePdu(pduFactory.makeIsGroupOfPdu());
sendOne(fact.makeIsPartOfPdu()); sendOnePdu(pduFactory.makeIsPartOfPdu());
sendOne(fact.makeLEDetonationPdu()); sendOnePdu(pduFactory.makeLEDetonationPdu());
sendOne(fact.makeLEFirePdu()); sendOnePdu(pduFactory.makeLEFirePdu());
sendOne(fact.makeLinearObjectStatePdu()); sendOnePdu(pduFactory.makeLinearObjectStatePdu());
sendOne(fact.makeMinefieldDataPdu()); sendOnePdu(pduFactory.makeMinefieldDataPdu());
sendOne(fact.makeMinefieldQueryPdu()); sendOnePdu(pduFactory.makeMinefieldQueryPdu());
sendOne(fact.makeMinefieldResponseNackPdu()); sendOnePdu(pduFactory.makeMinefieldResponseNackPdu());
sendOne(fact.makeMinefieldStatePdu()); sendOnePdu(pduFactory.makeMinefieldStatePdu());
sendOne(fact.makePointObjectStatePdu()); sendOnePdu(pduFactory.makePointObjectStatePdu());
sendOne(fact.makeReceiverPdu()); sendOnePdu(pduFactory.makeReceiverPdu());
sendOne(fact.makeRecordQueryReliablePdu()); sendOnePdu(pduFactory.makeRecordQueryReliablePdu());
sendOne(fact.makeRecordReliablePdu()); sendOnePdu(pduFactory.makeRecordReliablePdu());
sendOne(fact.makeRemoveEntityPdu()); sendOnePdu(pduFactory.makeRemoveEntityPdu());
sendOne(fact.makeRemoveEntityReliablePdu()); sendOnePdu(pduFactory.makeRemoveEntityReliablePdu());
sendOne(fact.makeRepairCompletePdu()); sendOnePdu(pduFactory.makeRepairCompletePdu());
sendOne(fact.makeRepairResponsePdu()); sendOnePdu(pduFactory.makeRepairResponsePdu());
sendOne(fact.makeResupplyCancelPdu()); sendOnePdu(pduFactory.makeResupplyCancelPdu());
sendOne(fact.makeResupplyOfferPdu()); sendOnePdu(pduFactory.makeResupplyOfferPdu());
sendOne(fact.makeResupplyReceivedPdu()); sendOnePdu(pduFactory.makeResupplyReceivedPdu());
sendOne(fact.makeSeesPdu()); sendOnePdu(pduFactory.makeSeesPdu());
sendOne(fact.makeServiceRequestPdu()); sendOnePdu(pduFactory.makeServiceRequestPdu());
sendOne(fact.makeSetDataPdu()); sendOnePdu(pduFactory.makeSetDataPdu());
sendOne(fact.makeSetDataReliablePdu()); sendOnePdu(pduFactory.makeSetDataReliablePdu());
sendOne(fact.makeSetRecordReliablePdu()); sendOnePdu(pduFactory.makeSetRecordReliablePdu());
sendOne(fact.makeSignalPdu()); sendOnePdu(pduFactory.makeSignalPdu());
sendOne(fact.makeStartResumePdu()); sendOnePdu(pduFactory.makeStartResumePdu());
sendOne(fact.makeStartResumeReliablePdu()); sendOnePdu(pduFactory.makeStartResumeReliablePdu());
sendOne(fact.makeStopFreezePdu()); sendOnePdu(pduFactory.makeStopFreezePdu());
sendOne(fact.makeStopFreezeReliablePdu()); sendOnePdu(pduFactory.makeStopFreezeReliablePdu());
sendOne(fact.makeTransferOwnershipPdu()); sendOnePdu(pduFactory.makeTransferOwnershipPdu());
sendOne(fact.makeTransmitterPdu()); sendOnePdu(pduFactory.makeTransmitterPdu());
sendOne(fact.makeTspiPdu()); sendOnePdu(pduFactory.makeTspiPdu());
sendOne(fact.makeUnderwaterAcousticPdu()); sendOnePdu(pduFactory.makeUnderwaterAcousticPdu());
//sleep(100L); // go sender/receiver go! is this enough time to receive? //sleep(100L); // go sender/receiver go! is this enough time to receive?
// try { // try {
...@@ -200,7 +200,7 @@ public class AllPduRoundTripTest ...@@ -200,7 +200,7 @@ public class AllPduRoundTripTest
disnetworking.kill(); disnetworking.kill();
} }
private void sendOne(Pdu pdu) private void sendOnePdu(Pdu pdu)
{ {
pduSentMap.put(pdu.getPduType(), pdu); pduSentMap.put(pdu.getPduType(), pdu);
if (pdu.getPduType() == DISPDUType.OTHER) if (pdu.getPduType() == DISPDUType.OTHER)
...@@ -237,7 +237,7 @@ public class AllPduRoundTripTest ...@@ -237,7 +237,7 @@ public class AllPduRoundTripTest
player.sendToNet(false); player.sendToNet(false);
player.addRawListener(ba -> { player.addRawListener(ba -> {
if (ba != null) { if (ba != null) {
Pdu pdu = fact.createPdu(ba); Pdu pdu = pduFactory.createPdu(ba);
pduReadMap.put(pdu.getPduType(), pdu); pduReadMap.put(pdu.getPduType(), pdu);
} }
else { else {
......
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