From f7c284213d623d5dd14ef0d6cdc379a888512023 Mon Sep 17 00:00:00 2001 From: Mike Bailey <jmbailey@nps.edu> Date: Thu, 5 Sep 2019 14:02:45 -0700 Subject: [PATCH] Test classes now working with junit 5 --- .../moves/dis7/CreateAllObjectTypesTest.java | 9 +- .../nps/moves/dis7/CreateAllPduTypesTest.java | 264 ++-- .../nps/moves/dis7/DataQueryPduRoundTrip.java | 151 --- .../moves/dis7/DataQueryPduRoundTripTest.java | 141 +++ .../nps/moves/dis7/EntityStatePduTest.java | 69 +- ...> FixedAndVariableDatumRoundTripTest.java} | 161 ++- test/edu/nps/moves/dis7/MarshalEnumsTest.java | 1102 ++++++++--------- ...java => NullFieldsEntityMarshallTest.java} | 24 +- .../moves/dis7/ObjectTypeMarshallTest.java | 15 +- ...stPduFactory1.java => PduFactoryTest.java} | 10 +- test/edu/nps/moves/dis7/SignalPdusTest.java | 26 +- 11 files changed, 980 insertions(+), 992 deletions(-) delete mode 100644 test/edu/nps/moves/dis7/DataQueryPduRoundTrip.java create mode 100644 test/edu/nps/moves/dis7/DataQueryPduRoundTripTest.java rename test/edu/nps/moves/dis7/{FixedAndVariableDatumRoundTrip.java => FixedAndVariableDatumRoundTripTest.java} (56%) rename test/edu/nps/moves/dis7/{NullFieldsMarshallTest.java => NullFieldsEntityMarshallTest.java} (78%) rename test/edu/nps/moves/dis7/{TestPduFactory1.java => PduFactoryTest.java} (93%) diff --git a/test/edu/nps/moves/dis7/CreateAllObjectTypesTest.java b/test/edu/nps/moves/dis7/CreateAllObjectTypesTest.java index 84fd82203d..1d573e0828 100644 --- a/test/edu/nps/moves/dis7/CreateAllObjectTypesTest.java +++ b/test/edu/nps/moves/dis7/CreateAllObjectTypesTest.java @@ -1,3 +1,7 @@ +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html + */ package edu.nps.moves.dis7; /** @@ -16,6 +20,7 @@ public class CreateAllObjectTypesTest @BeforeAll public static void beforeAllTests() { + System.out.println("CreateAllObjectTypesTest"); } @AfterAll @@ -251,7 +256,7 @@ public class CreateAllObjectTypesTest ex = t; } - //temp assertNull(ex, "Exception should be null if successful creation of all objects"); + assertNull(ex, "Exception should be null if successful creation of all objects"); } String formatStr = "Name: %s\tDomain: %s\tKind: %s\tCategory: %s\tSubcategory: %s"; @@ -266,7 +271,7 @@ public class CreateAllObjectTypesTest String dom = ot.getDomain().toString(); String kind = ot.getObjectKind().toString();; String nm = ot.getClass().getName(); - System.out.println(String.format(formatStr, nm, dom, kind, ot.getCategory(), ot.getSubCategory())); + //System.out.println(String.format(formatStr, nm, dom, kind, ot.getCategory(), ot.getSubCategory())); } public static void main(String[] args) diff --git a/test/edu/nps/moves/dis7/CreateAllPduTypesTest.java b/test/edu/nps/moves/dis7/CreateAllPduTypesTest.java index cd59f150bf..9ef31e4c11 100644 --- a/test/edu/nps/moves/dis7/CreateAllPduTypesTest.java +++ b/test/edu/nps/moves/dis7/CreateAllPduTypesTest.java @@ -1,7 +1,10 @@ +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html + */ package edu.nps.moves.dis7; import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; import java.io.DataOutputStream; import java.nio.ByteBuffer; import java.util.HashSet; @@ -12,140 +15,145 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; -/** - * - * @author mike - */ public class CreateAllPduTypesTest { + public CreateAllPduTypesTest() + { + } - public CreateAllPduTypesTest() - { - } + @BeforeAll + public static void setUpClass() + { + System.out.println("CreateAllPduTypesTest"); + } - @BeforeAll - public static void setUpClass() - { - } + @AfterAll + public static void tearDownClass() + { + } - @AfterAll - public static void tearDownClass() - { - } + @BeforeEach + public void setUp() + { + } - @BeforeEach - public void setUp() - { - } + @AfterEach + public void tearDown() + { + } - @AfterEach - public void tearDown() - { - } + HashSet<Object> pdus = new HashSet<>(); + ByteBuffer buff = ByteBuffer.allocate(20000); + DataOutputStream dos = new DataOutputStream(new ByteArrayOutputStream()); + + private Throwable throwable; - HashSet<Object> pdus = new HashSet<>(); - ByteBuffer buff = ByteBuffer.allocate(20000); - DataOutputStream dos = new DataOutputStream(new ByteArrayOutputStream()); - @Test - public void testCreateAll() - { - Object o; - //0 == "other" - pdus.add(new EntityStatePdu()); //1 - pdus.add(new FirePdu()); //2 - pdus.add(new DetonationPdu()); //3 - pdus.add(new CollisionPdu()); //4 - pdus.add(new ServiceRequestPdu()); //5 - pdus.add(new ResupplyOfferPdu()); //6 - pdus.add(new ResupplyReceivedPdu()); //7 - pdus.add(new ResupplyCancelPdu()); //8 - pdus.add(new RepairCompletePdu()); //9 - - pdus.add(new RepairResponsePdu()); //10 - pdus.add(new CreateEntityPdu()); //11 - pdus.add(new RemoveEntityPdu()); //12 - pdus.add(new StartResumePdu()); //13 - pdus.add(new StopFreezePdu()); //14 - pdus.add(new AcknowledgePdu()); //15 - pdus.add(new ActionRequestPdu()); //16 - pdus.add(new ActionResponsePdu()); //17 - pdus.add(new DataQueryPdu()); //18 - pdus.add(new SetDataPdu()); //19 - - pdus.add(new DataPdu()); //20 - pdus.add(new EventReportPdu()); //21 - pdus.add(new CommentPdu()); //22 - pdus.add(new ElectromagneticEmissionPdu()); //23 - pdus.add(new DesignatorPdu()); //24 - pdus.add(new TransmitterPdu()); //25 - pdus.add(new SignalPdu()); //26 - pdus.add(new ReceiverPdu()); //27 - pdus.add(new IFFPdu()); //28 - pdus.add(new UnderwaterAcousticPdu()); //29 - - pdus.add(new SEESPdu()); //30 - pdus.add(new IntercomSignalPdu()); //31 - pdus.add(new IntercomControlPdu()); //32 - pdus.add(new AggregateStatePdu()); //33 - pdus.add(new IsGroupOfPdu()); //34 - pdus.add(new TransferOwnershipPdu()); //35 - pdus.add(new IsPartOfPdu()); //36 - pdus.add(new MinefieldStatePdu()); //37 - pdus.add(new MinefieldQueryPdu()); //38 - pdus.add(new MinefieldDataPdu()); //39 - - pdus.add(new MinefieldResponseNACKPdu()); //40 - pdus.add(new EnvironmentalProcessPdu()); //41 - pdus.add(new GriddedDataPdu()); //42 - pdus.add(new PointObjectStatePdu()); //43 - pdus.add(new LinearObjectStatePdu()); //44 - pdus.add(new ArealObjectStatePdu()); //45 - pdus.add(new TSPIPdu()); //46 - pdus.add(new AppearancePdu()); //47 - pdus.add(new ArticulatedPartsPdu()); //48 - pdus.add(new LEFirePdu()); //49 - - pdus.add(new LEDetonationPdu()); //50 - pdus.add(new CreateEntityReliablePdu()); //51 - pdus.add(new RemoveEntityReliablePdu()); //52 - pdus.add(new StartResumeReliablePdu()); //53 - pdus.add(new StopFreezeReliablePdu()); //54 - pdus.add(new AcknowledgeReliablePdu()); //55 - pdus.add(new ActionRequestReliablePdu()); //56 - pdus.add(new ActionResponseReliablePdu()); //57 - pdus.add(new DataQueryReliablePdu()); //58 - pdus.add(new SetDataReliablePdu()); //59 - - pdus.add(new DataReliablePdu()); //60 - pdus.add(new EventReportReliablePdu()); //61 - pdus.add(new CommentReliablePdu()); //62 - pdus.add(new RecordReliablePdu()); //63 - pdus.add(new SetRecordReliablePdu()); //64 - pdus.add(new RecordQueryReliablePdu()); //65 - pdus.add(new CollisionElasticPdu()); //66 - pdus.add(new EntityStateUpdatePdu()); //67 - pdus.add(new DirectedEnergyFirePdu()); //68 - pdus.add(new EntityDamageStatusPdu()); //69 - - pdus.add(new InformationOperationsActionPdu()); //70 - pdus.add(new InformationOperationsReportPdu()); //71 - pdus.add(new AttributePdu()); //72 - - /* marshal all */ - System.out.println("marshalling"); - pdus.stream().forEach(ob->{ - try{ - ((Marshaller)ob).marshal(dos); - System.out.println("marshalled "+ob.getClass().getSimpleName()); - } - catch(Exception ex) { - System.out.println("Error marshalling "+ob.getClass().getSimpleName() + ex.getClass().getSimpleName()+": "+ex.getLocalizedMessage()); - } - }); + @Test + public void testCreateAll() + { + try { + Object o; + //0 == "other" + pdus.add(new EntityStatePdu()); //1 + pdus.add(new FirePdu()); //2 + pdus.add(new DetonationPdu()); //3 + pdus.add(new CollisionPdu()); //4 + pdus.add(new ServiceRequestPdu()); //5 + pdus.add(new ResupplyOfferPdu()); //6 + pdus.add(new ResupplyReceivedPdu()); //7 + pdus.add(new ResupplyCancelPdu()); //8 + pdus.add(new RepairCompletePdu()); //9 + + pdus.add(new RepairResponsePdu()); //10 + pdus.add(new CreateEntityPdu()); //11 + pdus.add(new RemoveEntityPdu()); //12 + pdus.add(new StartResumePdu()); //13 + pdus.add(new StopFreezePdu()); //14 + pdus.add(new AcknowledgePdu()); //15 + pdus.add(new ActionRequestPdu()); //16 + pdus.add(new ActionResponsePdu()); //17 + pdus.add(new DataQueryPdu()); //18 + pdus.add(new SetDataPdu()); //19 + + pdus.add(new DataPdu()); //20 + pdus.add(new EventReportPdu()); //21 + pdus.add(new CommentPdu()); //22 + pdus.add(new ElectromagneticEmissionPdu()); //23 + pdus.add(new DesignatorPdu()); //24 + pdus.add(new TransmitterPdu()); //25 + pdus.add(new SignalPdu()); //26 + pdus.add(new ReceiverPdu()); //27 + pdus.add(new IFFPdu()); //28 + pdus.add(new UnderwaterAcousticPdu()); //29 + + pdus.add(new SEESPdu()); //30 + pdus.add(new IntercomSignalPdu()); //31 + pdus.add(new IntercomControlPdu()); //32 + pdus.add(new AggregateStatePdu()); //33 + pdus.add(new IsGroupOfPdu()); //34 + pdus.add(new TransferOwnershipPdu()); //35 + pdus.add(new IsPartOfPdu()); //36 + pdus.add(new MinefieldStatePdu()); //37 + pdus.add(new MinefieldQueryPdu()); //38 + pdus.add(new MinefieldDataPdu()); //39 + + pdus.add(new MinefieldResponseNACKPdu()); //40 + pdus.add(new EnvironmentalProcessPdu()); //41 + pdus.add(new GriddedDataPdu()); //42 + pdus.add(new PointObjectStatePdu()); //43 + pdus.add(new LinearObjectStatePdu()); //44 + pdus.add(new ArealObjectStatePdu()); //45 + pdus.add(new TSPIPdu()); //46 + pdus.add(new AppearancePdu()); //47 + pdus.add(new ArticulatedPartsPdu()); //48 + pdus.add(new LEFirePdu()); //49 + + pdus.add(new LEDetonationPdu()); //50 + pdus.add(new CreateEntityReliablePdu()); //51 + pdus.add(new RemoveEntityReliablePdu()); //52 + pdus.add(new StartResumeReliablePdu()); //53 + pdus.add(new StopFreezeReliablePdu()); //54 + pdus.add(new AcknowledgeReliablePdu()); //55 + pdus.add(new ActionRequestReliablePdu()); //56 + pdus.add(new ActionResponseReliablePdu()); //57 + pdus.add(new DataQueryReliablePdu()); //58 + pdus.add(new SetDataReliablePdu()); //59 + + pdus.add(new DataReliablePdu()); //60 + pdus.add(new EventReportReliablePdu()); //61 + pdus.add(new CommentReliablePdu()); //62 + pdus.add(new RecordReliablePdu()); //63 + pdus.add(new SetRecordReliablePdu()); //64 + pdus.add(new RecordQueryReliablePdu()); //65 + pdus.add(new CollisionElasticPdu()); //66 + pdus.add(new EntityStateUpdatePdu()); //67 + pdus.add(new DirectedEnergyFirePdu()); //68 + pdus.add(new EntityDamageStatusPdu()); //69 + + pdus.add(new InformationOperationsActionPdu()); //70 + pdus.add(new InformationOperationsReportPdu()); //71 + pdus.add(new AttributePdu()); //72 + + /* marshal all */ + pdus.stream().forEach(ob -> { + try { + ((Marshaller) ob).marshal(dos); + //System.out.println("marshalled " + ob.getClass().getSimpleName()); + } + catch (Throwable t) { + throw new RuntimeException(t); + } + }); } - - public static void main(String[] args) - { - new CreateAllPduTypesTest().testCreateAll(); - } + catch (Throwable t) { + throwable = t; + t.printStackTrace(); + } + assertNull(throwable, "Exception should be null if successful marshal"); + } + + public static void main(String[] args) + { + new CreateAllPduTypesTest().testCreateAll(); + } } diff --git a/test/edu/nps/moves/dis7/DataQueryPduRoundTrip.java b/test/edu/nps/moves/dis7/DataQueryPduRoundTrip.java deleted file mode 100644 index f7f26f8c82..0000000000 --- a/test/edu/nps/moves/dis7/DataQueryPduRoundTrip.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package edu.nps.moves.dis7; - -import edu.nps.moves.dis7.enumerations.ActionResponseRequestStatus; -import edu.nps.moves.dis7.enumerations.VariableRecordType; -import edu.nps.moves.dis7.util.DisNetworking; -import edu.nps.moves.dis7.util.PduFactory; -import java.io.IOException; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -/** - * - * @author mike - */ -public class DataQueryPduRoundTrip -{ - - public DataQueryPduRoundTrip() - { - } - - @BeforeAll - public static void setUpClass() - { - } - - @AfterAll - public static void tearDownClass() - { - } - - @BeforeEach - public void setUp() - { - } - - @AfterEach - public void tearDown() - { - } - - private static int REQUEST_ID = 0x00112233; - private static int TIME_INTERVAL = 0x15151515; - - private static FixedDatum fixedDatum1 = new FixedDatum(); - private static int fixedDatum1Value = 0x111111FF; - private static VariableRecordType fixedDatum1VarRecordType = VariableRecordType.$120_MM_HEAT_QUANTITY; - private static FixedDatum fixedDatum2 = new FixedDatum(); - private static int fixedDatum2Value = 0x222222FF; - private static VariableRecordType fixedDatum2VarRecordType = VariableRecordType.ACCELERATION; - private static FixedDatum fixedDatum3 = new FixedDatum(); - private static int fixedDatum3Value = 0x333333FF; - private static VariableRecordType fixedDatum3VarRecordType = VariableRecordType.NUMBER_OF_INTERCEPTORS_FIRED; - - private static VariableDatum variableDatum1 = new VariableDatum(); - private static VariableRecordType variableDatum1Type = VariableRecordType.ADA_SHOOTING_STATUS; - private static byte[] variableDatum1Value = new String("varDatum1Value111").getBytes(); - - private static VariableDatum variableDatum2 = new VariableDatum(); - private static VariableRecordType variableDatum2Type = VariableRecordType.ORDER_STATUS; - private static byte[] variableDatum2Value = new String("222varDatum1Value222").getBytes(); - - static { - fixedDatum1.setFixedDatumValue(fixedDatum1Value); - fixedDatum1.setFixedDatumID(fixedDatum1VarRecordType); - - fixedDatum2.setFixedDatumValue(fixedDatum2Value); - fixedDatum2.setFixedDatumID(fixedDatum2VarRecordType); - - fixedDatum3.setFixedDatumValue(fixedDatum3Value); - fixedDatum3.setFixedDatumID(fixedDatum3VarRecordType); - - variableDatum1.setVariableDatumID(variableDatum1Type); - variableDatum1.setVariableDatumValue(variableDatum1Value); - // variableDatum1.setVariableDatumLength(variableDatum1Value.length); // should be done automatically - - variableDatum2.setVariableDatumID(variableDatum2Type); - variableDatum2.setVariableDatumValue(variableDatum2Value); - // variableDatum2.setVariableDatumLength(variableDatum2Value.length); // should be done automatically - } - - private Pdu receivedPdu; - private Object waiter = new Object(); - - @Test - public void TestRoundTrip() - { - PduFactory factory = new PduFactory(); - - DataQueryPdu sendingPdu = factory.makeDataQueryPdu(); - sendingPdu.setRequestID(REQUEST_ID); - sendingPdu.setTimeInterval(TIME_INTERVAL); - - sendingPdu.getFixedDatums().add(fixedDatum1); - sendingPdu.getFixedDatums().add(fixedDatum2); - sendingPdu.getFixedDatums().add(fixedDatum3); - - sendingPdu.getVariableDatums().add(variableDatum1); - sendingPdu.getVariableDatums().add(variableDatum2); - - setUpReceiver(); - - try { - Thread.sleep(250l); // make sure receiver is listening - new DisNetworking().sendPdu(sendingPdu); - Thread.sleep(1000l); //(180*1000l));//waiter.wait(); - } - catch(Exception ex) { - System.err.println("Error sending Multicast: "+ex.getLocalizedMessage()); - System.exit(1); - } - - // Compare - // If we made it this far, we've sent and received. Now compare. - if(receivedPdu.equalsImpl(sendingPdu)) - System.out.println("passed test"); - else - System.err.println("failed test"); - } - - private void setUpReceiver() - { - Thread rcvThread = new Thread( ()->{ - try { - receivedPdu = new DisNetworking().receivePdu(); // blocks - } - catch(IOException ex) { - System.err.println("Error receiving Multicast: "+ex.getLocalizedMessage()); - System.exit(1); - } - // waiter.notify(); - }); - - rcvThread.setPriority(Thread.NORM_PRIORITY); - rcvThread.setDaemon(true); - rcvThread.start(); - } - - public static void main(String[] args) - { - new DataQueryPduRoundTrip().TestRoundTrip(); - } -} diff --git a/test/edu/nps/moves/dis7/DataQueryPduRoundTripTest.java b/test/edu/nps/moves/dis7/DataQueryPduRoundTripTest.java new file mode 100644 index 0000000000..a48f476e35 --- /dev/null +++ b/test/edu/nps/moves/dis7/DataQueryPduRoundTripTest.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html + */ +package edu.nps.moves.dis7; + +import edu.nps.moves.dis7.enumerations.VariableRecordType; +import edu.nps.moves.dis7.util.DisNetworking; +import edu.nps.moves.dis7.util.PduFactory; +import java.io.IOException; +import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.assertTrue; + +@DisplayName("Data Query Pdu Round Test") +public class DataQueryPduRoundTripTest +{ + + public DataQueryPduRoundTripTest() + { + } + + @BeforeAll + public static void setUpClass() + { + System.out.println("DataQueryPduRoundTripTest"); + } + + @AfterAll + public static void tearDownClass() + { + } + + @BeforeEach + public void setUp() + { + } + + @AfterEach + public void tearDown() + { + } + + private static int REQUEST_ID = 0x00112233; + private static int TIME_INTERVAL = 0x15151515; + + private static FixedDatum fixedDatum1 = new FixedDatum(); + private static int fixedDatum1Value = 0x111111FF; + private static VariableRecordType fixedDatum1VarRecordType = VariableRecordType.$120_MM_HEAT_QUANTITY; + private static FixedDatum fixedDatum2 = new FixedDatum(); + private static int fixedDatum2Value = 0x222222FF; + private static VariableRecordType fixedDatum2VarRecordType = VariableRecordType.ACCELERATION; + private static FixedDatum fixedDatum3 = new FixedDatum(); + private static int fixedDatum3Value = 0x333333FF; + private static VariableRecordType fixedDatum3VarRecordType = VariableRecordType.NUMBER_OF_INTERCEPTORS_FIRED; + + private static VariableDatum variableDatum1 = new VariableDatum(); + private static VariableRecordType variableDatum1Type = VariableRecordType.ADA_SHOOTING_STATUS; + private static byte[] variableDatum1Value = new String("varDatum1Value111").getBytes(); + + private static VariableDatum variableDatum2 = new VariableDatum(); + private static VariableRecordType variableDatum2Type = VariableRecordType.ORDER_STATUS; + private static byte[] variableDatum2Value = new String("222varDatum1Value222").getBytes(); + + static { + fixedDatum1.setFixedDatumValue(fixedDatum1Value); + fixedDatum1.setFixedDatumID(fixedDatum1VarRecordType); + + fixedDatum2.setFixedDatumValue(fixedDatum2Value); + fixedDatum2.setFixedDatumID(fixedDatum2VarRecordType); + + fixedDatum3.setFixedDatumValue(fixedDatum3Value); + fixedDatum3.setFixedDatumID(fixedDatum3VarRecordType); + + variableDatum1.setVariableDatumID(variableDatum1Type); + variableDatum1.setVariableDatumValue(variableDatum1Value); + // variableDatum1.setVariableDatumLength(variableDatum1Value.length); // should be done automatically + + variableDatum2.setVariableDatumID(variableDatum2Type); + variableDatum2.setVariableDatumValue(variableDatum2Value); + // variableDatum2.setVariableDatumLength(variableDatum2Value.length); // should be done automatically + } + + private Pdu receivedPdu; + private Object waiter = new Object(); + + @Test + public void testRoundTrip() + { + PduFactory factory = new PduFactory(); + + DataQueryPdu sendingPdu = factory.makeDataQueryPdu(); + sendingPdu.setRequestID(REQUEST_ID); + sendingPdu.setTimeInterval(TIME_INTERVAL); + + sendingPdu.getFixedDatums().add(fixedDatum1); + sendingPdu.getFixedDatums().add(fixedDatum2); + sendingPdu.getFixedDatums().add(fixedDatum3); + + sendingPdu.getVariableDatums().add(variableDatum1); + sendingPdu.getVariableDatums().add(variableDatum2); + + setUpReceiver(); + + try { + Thread.sleep(250l); // make sure receiver is listening + new DisNetworking().sendPdu(sendingPdu); + Thread.sleep(1000l); + } + catch (Exception ex) { + System.err.println("Error sending Multicast: " + ex.getLocalizedMessage()); + System.exit(1); + } + + // Compare + // If we made it this far, we've sent and received. Now compare. + assertTrue(receivedPdu.equals(sendingPdu), "Sent and received pdu not the same"); + } + + private void setUpReceiver() + { + Thread rcvThread = new Thread(() -> { + try { + receivedPdu = new DisNetworking().receivePdu(); // blocks + } + catch (IOException ex) { + System.err.println("Error receiving Multicast: " + ex.getLocalizedMessage()); + System.exit(1); + } + // waiter.notify(); + }); + + rcvThread.setPriority(Thread.NORM_PRIORITY); + rcvThread.setDaemon(true); + rcvThread.start(); + } + + public static void main(String[] args) + { + new DataQueryPduRoundTripTest().testRoundTrip(); + } +} diff --git a/test/edu/nps/moves/dis7/EntityStatePduTest.java b/test/edu/nps/moves/dis7/EntityStatePduTest.java index 0581c703e6..8b24ad3922 100644 --- a/test/edu/nps/moves/dis7/EntityStatePduTest.java +++ b/test/edu/nps/moves/dis7/EntityStatePduTest.java @@ -1,49 +1,48 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html */ package edu.nps.moves.dis7; import edu.nps.moves.dis7.enumerations.LandPlatformCapabilities; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; import static org.junit.jupiter.api.Assertions.*; -/** - * - * @author mike - */ +@DisplayName("Entity State Pdu Test") public class EntityStatePduTest { - @BeforeAll - public static void setUpClass() - { - } - - @AfterAll - public static void tearDownClass() - { - } - - @BeforeEach - public void setUp() - { - } - - @AfterEach - public void tearDown() - { - } + @BeforeAll + public static void setUpClass() + { + System.out.println("EntityStatePduTest"); + } + + @AfterAll + public static void tearDownClass() + { + } + @BeforeEach + public void setUp() + { + } - @Test - public void testEntityCapabilities() - { + @AfterEach + public void tearDown() + { + } + + @Test + public void testEntityCapabilities() + { + Throwable thr = null; + try { EntityStatePdu espdu = new EntityStatePdu(); espdu.setCapabilities(new LandPlatformCapabilities()); } + catch (Throwable t) { + thr = t; + } + assertNull(thr, "Exception indicates error creating EntityStatePdu"); + } } diff --git a/test/edu/nps/moves/dis7/FixedAndVariableDatumRoundTrip.java b/test/edu/nps/moves/dis7/FixedAndVariableDatumRoundTripTest.java similarity index 56% rename from test/edu/nps/moves/dis7/FixedAndVariableDatumRoundTrip.java rename to test/edu/nps/moves/dis7/FixedAndVariableDatumRoundTripTest.java index a2137bd828..d7088a93b1 100644 --- a/test/edu/nps/moves/dis7/FixedAndVariableDatumRoundTrip.java +++ b/test/edu/nps/moves/dis7/FixedAndVariableDatumRoundTripTest.java @@ -1,7 +1,6 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html */ package edu.nps.moves.dis7; @@ -10,38 +9,32 @@ import edu.nps.moves.dis7.enumerations.VariableRecordType; import edu.nps.moves.dis7.util.DisNetworking; import edu.nps.moves.dis7.util.PduFactory; import java.io.IOException; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.assertTrue; -/** - * - * @author mike - */ -public class FixedAndVariableDatumRoundTrip +@DisplayName("Fixed and Variable Datum Round Trip Test") +public class FixedAndVariableDatumRoundTripTest { - - public FixedAndVariableDatumRoundTrip() + public FixedAndVariableDatumRoundTripTest() { } - + @BeforeAll public static void setUpClass() { + System.out.println("FixedAndVariableDatumRoundTripTest"); } - + @AfterAll public static void tearDownClass() { } - + @BeforeEach public void setUp() { } - + @AfterEach public void tearDown() { @@ -49,8 +42,8 @@ public class FixedAndVariableDatumRoundTrip private static int REQUEST_ID = 0x00112233; private static ActionResponseRequestStatus REQUEST_STATUS = ActionResponseRequestStatus.RETRANSMIT_REQUEST_LATER; - - private static FixedDatum fixedDatum1 = new FixedDatum(); + + private static FixedDatum fixedDatum1 = new FixedDatum(); private static int fixedDatum1Value = 0x111111FF; private static VariableRecordType fixedDatum1VarRecordType = VariableRecordType.ACTIVATE_OWNSHIP; private static FixedDatum fixedDatum2 = new FixedDatum(); @@ -59,13 +52,13 @@ public class FixedAndVariableDatumRoundTrip private static FixedDatum fixedDatum3 = new FixedDatum(); private static int fixedDatum3Value = 0x333333FF; private static VariableRecordType fixedDatum3VarRecordType = VariableRecordType.SKE_FREQUENCY; - + private static VariableDatum variableDatum1 = new VariableDatum(); private static VariableRecordType variableDatum1Type = VariableRecordType.ACLS_AIRCRAFT_REPORT; private static String variableDatum1String = "varDatum1Value111"; private static byte[] variableDatum1Value = variableDatum1String.getBytes(); - private static int variableDatum1LengthInBits = variableDatum1String.length()*8 -1; // test - + private static int variableDatum1LengthInBits = variableDatum1String.length() * 8 - 1; // test + private static VariableDatum variableDatum2 = new VariableDatum(); private static VariableRecordType variableDatum2Type = VariableRecordType.Z_ACCELERATION; private static byte[] variableDatum2Value = new String("222varDatum1Value222").getBytes(); @@ -73,78 +66,76 @@ public class FixedAndVariableDatumRoundTrip static { fixedDatum1.setFixedDatumValue(fixedDatum1Value); fixedDatum1.setFixedDatumID(fixedDatum1VarRecordType); - + fixedDatum2.setFixedDatumValue(fixedDatum2Value); fixedDatum2.setFixedDatumID(fixedDatum2VarRecordType); - + fixedDatum3.setFixedDatumValue(fixedDatum3Value); fixedDatum3.setFixedDatumID(fixedDatum3VarRecordType); - + variableDatum1.setVariableDatumID(variableDatum1Type); variableDatum1.setVariableDatumValue(variableDatum1Value); variableDatum1.setVariableDatumLength(variableDatum1LengthInBits); - + variableDatum2.setVariableDatumID(variableDatum2Type); variableDatum2.setVariableDatumValue(variableDatum2Value); variableDatum2.setVariableDatumLength(variableDatum2Value.length * 8); //in bits - } - + } + private Pdu receivedPdu; private Object waiter = new Object(); - - @Test - public void TestRoundTrip() - { - PduFactory factory = new PduFactory(); - ActionResponsePdu sentPdu = factory.makeActionResponsePdu(); - - sentPdu.getFixedDatums().add(fixedDatum1); - sentPdu.getFixedDatums().add(fixedDatum2); - sentPdu.getFixedDatums().add(fixedDatum3); - - sentPdu.getVariableDatums().add(variableDatum1); - sentPdu.getVariableDatums().add(variableDatum2); - - setUpReceiver(); - - try { - Thread.sleep(250l); // make sure receiver is listening - new DisNetworking().sendPdu(sentPdu); - Thread.sleep(1000l); //(180*1000l));//waiter.wait(); - } - catch(Exception ex) { - System.err.println("Error sending Multicast: "+ex.getLocalizedMessage()); - System.exit(1); - } - + + @Test + public void TestRoundTrip() + { + PduFactory factory = new PduFactory(); + ActionResponsePdu sentPdu = factory.makeActionResponsePdu(); + + sentPdu.getFixedDatums().add(fixedDatum1); + sentPdu.getFixedDatums().add(fixedDatum2); + sentPdu.getFixedDatums().add(fixedDatum3); + + sentPdu.getVariableDatums().add(variableDatum1); + sentPdu.getVariableDatums().add(variableDatum2); + + setUpReceiver(); + + try { + Thread.sleep(250l); // make sure receiver is listening + new DisNetworking().sendPdu(sentPdu); + Thread.sleep(1000l); + } + catch (Exception ex) { + System.err.println("Error sending Multicast: " + ex.getLocalizedMessage()); + System.exit(1); + } + // Compare // If we made it this far, we've sent and received. Now compare. - if(receivedPdu.equals(sentPdu)) - System.out.println("passed test"); - else - System.err.println("failed test"); - } - - private void setUpReceiver() - { - Thread rcvThread = new Thread( ()->{ - try { - receivedPdu = new DisNetworking().receivePdu(); // blocks - } - catch(IOException ex) { - System.err.println("Error receiving Multicast: "+ex.getLocalizedMessage()); - System.exit(1); - } - // waiter.notify(); - }); - - rcvThread.setPriority(Thread.NORM_PRIORITY); - rcvThread.setDaemon(true); - rcvThread.start(); - } - - public static void main(String[] args) - { - new FixedAndVariableDatumRoundTrip().TestRoundTrip(); - } + assertTrue(receivedPdu != null, "No response from network"); + assertTrue(receivedPdu.equals(sentPdu),"Sent and received pdus not identical"); + } + + private void setUpReceiver() + { + Thread rcvThread = new Thread(() -> { + try { + receivedPdu = new DisNetworking().receivePdu(); // blocks + } + catch (IOException ex) { + System.err.println("Error receiving Multicast: " + ex.getLocalizedMessage()); + System.exit(1); + } + // waiter.notify(); + }); + + rcvThread.setPriority(Thread.NORM_PRIORITY); + rcvThread.setDaemon(true); + rcvThread.start(); + } + + public static void main(String[] args) + { + new FixedAndVariableDatumRoundTripTest().TestRoundTrip(); + } } diff --git a/test/edu/nps/moves/dis7/MarshalEnumsTest.java b/test/edu/nps/moves/dis7/MarshalEnumsTest.java index 3e4e861ce4..40dc819e0d 100644 --- a/test/edu/nps/moves/dis7/MarshalEnumsTest.java +++ b/test/edu/nps/moves/dis7/MarshalEnumsTest.java @@ -1,7 +1,6 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html */ package edu.nps.moves.dis7; @@ -15,93 +14,94 @@ import static org.junit.jupiter.api.Assertions.assertNull; @DisplayName("Marshal Enums Test") public class MarshalEnumsTest { - @BeforeAll - public static void setUpClass() - { - } - - @AfterAll - public static void tearDownClass() - { - } - - @BeforeEach - public void setUp() - { - } - - @AfterEach - public void tearDown() - { - } - - @Test - public void testGoodMarshall() - { - Throwable thr = null; - try { - marshalOne(APAParameterIndexAPAStatus.values()[0]); - marshalOne(AcknowledgeAcknowledgeFlag.values()[0]); - marshalOne(AcknowledgeResponseFlag.values()[0]); - // this is a simple enum, never marshalled marshalOne(Acronyms.values()[0]); - marshalOne(ActionRequestActionID.values()[0]); - marshalOne(ActionResponseRequestStatus.values()[0]); + @BeforeAll + public static void setUpClass() + { + System.out.println("MarshalEnumsTest"); + } + + @AfterAll + public static void tearDownClass() + { + } + + @BeforeEach + public void setUp() + { + } + + @AfterEach + public void tearDown() + { + } + + @Test + public void testGoodMarshall() + { + Throwable thr = null; + try { + marshalOne(APAParameterIndexAPAStatus.values()[0]); + marshalOne(AcknowledgeAcknowledgeFlag.values()[0]); + marshalOne(AcknowledgeResponseFlag.values()[0]); + // this is a simple enum, never marshalled marshalOne(Acronyms.values()[0]); + marshalOne(ActionRequestActionID.values()[0]); + marshalOne(ActionResponseRequestStatus.values()[0]); // marshalOne(AddSpecificDimensionEnumerationsforSubsurfaceAreaSize.values()[0]); // marshalOne(AddVariantsforAirCategory201Insect.values()[0]); // marshalOne(AddVariantsforLandCategory200Mammal.values()[0]); // marshalOne(AddVariantsforSubsurfaceCategoriesFishMolluskCrustaceanandInsect.values()[0]); - marshalOne(AggregateStateAggregateKind.values()[0]); - marshalOne(AggregateStateAggregateState.values()[0]); - marshalOne(AggregateStateFormation.values()[0]); - marshalOne(AggregateStateSpecific.values()[0]); - marshalOne(AggregateStateSubcategory.values()[0]); - - marshalOne(AircraftAddressSource.values()[0]); - marshalOne(AircraftIdentificationType.values()[0]); - marshalOne(AircraftPresentDomain.values()[0]); - marshalOne(AircraftTypeWake.values()[0]); + marshalOne(AggregateStateAggregateKind.values()[0]); + marshalOne(AggregateStateAggregateState.values()[0]); + marshalOne(AggregateStateFormation.values()[0]); + marshalOne(AggregateStateSpecific.values()[0]); + marshalOne(AggregateStateSubcategory.values()[0]); + + marshalOne(AircraftAddressSource.values()[0]); + marshalOne(AircraftIdentificationType.values()[0]); + marshalOne(AircraftPresentDomain.values()[0]); + marshalOne(AircraftTypeWake.values()[0]); // marshalOne(AnimalLifeformGroupSizeRangeEnumerationforallDomains.values()[0]); - marshalOne(AntennaSelection.values()[0]); - marshalOne(AntennaStatus.values()[0]); - marshalOne(AppearanceAntiCollisionDayNight.values()[0]); - marshalOne(AppearanceCamouflageType.values()[0]); - marshalOne(AppearanceCanopy.values()[0]); - marshalOne(AppearanceConcealedMovement.values()[0]); - marshalOne(AppearanceConcealedPosition.values()[0]); - marshalOne(AppearanceDamage.values()[0]); - marshalOne(AppearanceEntityorObjectState.values()[0]); - marshalOne(AppearanceEnvironmentalDensity.values()[0]); - marshalOne(AppearanceHatch.values()[0]); - marshalOne(AppearanceLauncherOperational.values()[0]); - marshalOne(AppearanceLifeFormComplianceStatus.values()[0]); - marshalOne(AppearanceLifeFormPosture.values()[0]); - marshalOne(AppearanceLifeFormWeaponImplement.values()[0]); - marshalOne(AppearanceLifeformHealth.values()[0]); + marshalOne(AntennaSelection.values()[0]); + marshalOne(AntennaStatus.values()[0]); + marshalOne(AppearanceAntiCollisionDayNight.values()[0]); + marshalOne(AppearanceCamouflageType.values()[0]); + marshalOne(AppearanceCanopy.values()[0]); + marshalOne(AppearanceConcealedMovement.values()[0]); + marshalOne(AppearanceConcealedPosition.values()[0]); + marshalOne(AppearanceDamage.values()[0]); + marshalOne(AppearanceEntityorObjectState.values()[0]); + marshalOne(AppearanceEnvironmentalDensity.values()[0]); + marshalOne(AppearanceHatch.values()[0]); + marshalOne(AppearanceLauncherOperational.values()[0]); + marshalOne(AppearanceLifeFormComplianceStatus.values()[0]); + marshalOne(AppearanceLifeFormPosture.values()[0]); + marshalOne(AppearanceLifeFormWeaponImplement.values()[0]); + marshalOne(AppearanceLifeformHealth.values()[0]); // marshalOne(AppearanceLinearObjectLaneMarkerVisible.values()[0]); // marshalOne(AppearanceLinearObjectTankDitchBreach.values()[0]); - marshalOne(AppearanceNVGMode.values()[0]); - marshalOne(AppearanceNavigationPositionBrightness.values()[0]); - marshalOne(AppearanceObjectGeneralDamage.values()[0]); - marshalOne(AppearanceObjectGeneralIEDPresent.values()[0]); - marshalOne(AppearanceObjectGeneralPredistributed.values()[0]); + marshalOne(AppearanceNVGMode.values()[0]); + marshalOne(AppearanceNavigationPositionBrightness.values()[0]); + marshalOne(AppearanceObjectGeneralDamage.values()[0]); + marshalOne(AppearanceObjectGeneralIEDPresent.values()[0]); + marshalOne(AppearanceObjectGeneralPredistributed.values()[0]); // marshalOne(AppearanceObjectSpecificBreachState.values()[0]); // marshalOne(AppearanceObjectSpecificChemicalType.values()[0]); - marshalOne(AppearancePaintScheme.values()[0]); - marshalOne(AppearanceSubsurfaceHatch.values()[0]); - marshalOne(AppearanceSupplyDeployed.values()[0]); - marshalOne(AppearanceTrailingEffects.values()[0]); - - marshalOne(ArticulatedPartsTypeClass.values()[0]); - marshalOne(ArticulatedPartsTypeMetric.values()[0]); - marshalOne(AttachedPartDetachedIndicator.values()[0]); - marshalOne(AttachedParts.values()[0]); + marshalOne(AppearancePaintScheme.values()[0]); + marshalOne(AppearanceSubsurfaceHatch.values()[0]); + marshalOne(AppearanceSupplyDeployed.values()[0]); + marshalOne(AppearanceTrailingEffects.values()[0]); + + marshalOne(ArticulatedPartsTypeClass.values()[0]); + marshalOne(ArticulatedPartsTypeMetric.values()[0]); + marshalOne(AttachedPartDetachedIndicator.values()[0]); + marshalOne(AttachedParts.values()[0]); // marshalOne(AustralianCategoryOverlay.values()[0]); - marshalOne(BeamStatusBeamState.values()[0]); + marshalOne(BeamStatusBeamState.values()[0]); // marshalOne(BuildingPaintScheme.values()[0]); - marshalOne(CCTTSINCGARSClearChannel.values()[0]); - marshalOne(CCTTSINCGARSStartofMessage.values()[0]); - // marshalOne(CIGIExtensionPacketID.values()[0]); - marshalOne(CapabilityReport.values()[0]); + marshalOne(CCTTSINCGARSClearChannel.values()[0]); + marshalOne(CCTTSINCGARSStartofMessage.values()[0]); + // marshalOne(CIGIExtensionPacketID.values()[0]); + marshalOne(CapabilityReport.values()[0]); // marshalOne(Class10SupplyCategoryMaterialtoSupportNonMilitaryPrograms.values()[0]); // marshalOne(Class11SupplyCategorySuppliesNonDoctrinal.values()[0]); // marshalOne(Class12SupplyCategorySlingLoadsNonDoctrinal.values()[0]); @@ -113,486 +113,478 @@ public class MarshalEnumsTest // marshalOne(Class7SupplyCategoryMajorItems.values()[0]); // marshalOne(Class8SupplyCategoryMedicalMaterial.values()[0]); // marshalOne(Class9SupplyCategoryRepairPartsandComponents.values()[0]); - marshalOne(CollisionType.values()[0]); + marshalOne(CollisionType.values()[0]); // marshalOne(Color.values()[0]); - marshalOne(ComponentVisualDamageStatusSmoke.values()[0]); - marshalOne(ComponentVisualDamageStatusSurfaceDamage.values()[0]); - marshalOne(Country.values()[0]); - marshalOne(CoverShroudStatus.values()[0]); - // marshalOne(CryptoKeyIDCryptoMode.values()[0]); - - marshalOne(DEDamageDescriptionComponentDamageStatus.values()[0]); - - marshalOne(DEDamageDescriptionComponentVisualSmokeColor.values()[0]); - - marshalOne(DEFireFlagsStateUpdateFlag.values()[0]); - marshalOne(DEFirePulseShape.values()[0]); - marshalOne(DEPrecisionAimpointBeamSpotType.values()[0]); - marshalOne(DISAttributeActionCode.values()[0]); - marshalOne(DISLiveEntitySubprotocolNumber.values()[0]); - marshalOne(DISPDUStatusActiveInterrogationIndicatorAII.values()[0]); - marshalOne(DISPDUStatusCoupledExtensionIndicatorCEI.values()[0]); - marshalOne(DISPDUStatusDetonationTypeIndicatorDTI.values()[0]); - marshalOne(DISPDUStatusFireTypeIndicatorFTI.values()[0]); - marshalOne(DISPDUStatusIFFSimulationModeISM.values()[0]); - marshalOne(DISPDUStatusIntercomAttachedIndicatorIAI.values()[0]); - marshalOne(DISPDUStatusLVCIndicatorLVC.values()[0]); - marshalOne(DISPDUStatusRadioAttachedIndicatorRAI.values()[0]); - marshalOne(DISPDUStatusTransferredEntityIndicatorTEI.values()[0]); - marshalOne(DISPDUType.values()[0]); - marshalOne(DISProtocolFamily.values()[0]); - marshalOne(DISProtocolVersion.values()[0]); - marshalOne(DRParametersType.values()[0]); - marshalOne(DataCategory.values()[0]); - marshalOne(DeadReckoningAlgorithm.values()[0]); - marshalOne(DeltaMode5SAltitudePositiveNegativeIndicator.values()[0]); - marshalOne(DesignatorDesignatorCode.values()[0]); - marshalOne(DesignatorSystemName.values()[0]); - marshalOne(DetonationResult.values()[0]); - marshalOne(EEAttributeStateIndicator.values()[0]); - marshalOne(ElectromagneticEmissionBeamFunction.values()[0]); - marshalOne(ElectromagneticEmissionStateUpdateIndicator.values()[0]); - // why won't compile? marshalOne(EmitterName.values()[0]); - marshalOne(EmitterSystemFunction.values()[0]); - marshalOne(EntityAssociationAssociationStatus.values()[0]); - marshalOne(EntityAssociationAssociationType.values()[0]); - marshalOne(EntityAssociationGroupMemberType.values()[0]); - marshalOne(EntityAssociationPhysicalAssociationType.values()[0]); - marshalOne(EntityAssociationPhysicalConnectionType.values()[0]); - marshalOne(EntityDamageStatusComponentIdentification.values()[0]); - marshalOne(EntityKind.values()[0]); - marshalOne(EntityMarkingCharacterSet.values()[0]); - marshalOne(EntityVPRecordChangeIndicator.values()[0]); - marshalOne(EnvironmentRecordTypeGroups.values()[0]); - - marshalOne(EnvironmentalProcessModelType.values()[0]); - marshalOne(EnvironmentalProcessRecordType.values()[0]); - marshalOne(EnvironmentalSubcategory.values()[0]); - marshalOne(EventReportEventType.values()[0]); - marshalOne(ExpendableAirCategory.values()[0]); - - marshalOne(ExpendableSubsurfaceCategory.values()[0]); - marshalOne(ExpendableSurfaceCategory.values()[0]); - marshalOne(ExplosiveMaterialCategories.values()[0]); - marshalOne(ExplosiveMaterialGroups.values()[0]); - marshalOne(FlareSmokeColor.values()[0]); - marshalOne(FlareSmokeStatus.values()[0]); - marshalOne(ForceID.values()[0]); - marshalOne(FormatType.values()[0]); - marshalOne(FuelLocation.values()[0]); - marshalOne(FuelMeasurementUnits.values()[0]); - marshalOne(GridAxisDescriptorAxisType.values()[0]); - marshalOne(GriddedDataConstantGrid.values()[0]); - marshalOne(GriddedDataCoordinateSystem.values()[0]); - marshalOne(GriddedDataDataRepresentation.values()[0]); - marshalOne(GriddedDataFieldNumber.values()[0]); - marshalOne(GriddedDataSampleType.values()[0]); - marshalOne(HighDensityTrackJam.values()[0]); - marshalOne(HighFidelityHAVEQUICKTODTransmitIndicator.values()[0]); - marshalOne(IFFAlternateMode4ChallengeReply.values()[0]); - marshalOne(IFFApplicableModes.values()[0]); - marshalOne(IFFDataRecordAvailable.values()[0]); - marshalOne(IFFLayerSpecificInformation.values()[0]); - marshalOne(IFFSimulationMode.values()[0]); - marshalOne(IFFSystemMode.values()[0]); - marshalOne(IFFSystemName.values()[0]); - marshalOne(IFFSystemType.values()[0]); - marshalOne(IFFSystemType1OperationalParameter1.values()[0]); - marshalOne(IFFSystemType1OperationalParameter2.values()[0]); - marshalOne(IOActionIOActionPhase.values()[0]); - marshalOne(IOActionIOActionType.values()[0]); - marshalOne(IOActionIOSimulationSource.values()[0]); - marshalOne(IOActionIOWarfareType.values()[0]); - marshalOne(IOCommsNodeRecordCommsNodeType.values()[0]); - marshalOne(IOEffectsRecordIOEffect.values()[0]); - marshalOne(IOEffectsRecordIOLinkType.values()[0]); - marshalOne(IOEffectsRecordIOProcess.values()[0]); - marshalOne(IOEffectsRecordIOStatus.values()[0]); - marshalOne(IOReportIOReportType.values()[0]); - marshalOne(ISLSAntennaType.values()[0]); - marshalOne(IntercomControlCommand.values()[0]); - marshalOne(IntercomControlCommunicationsClass.values()[0]); - marshalOne(IntercomControlCommunicationsType.values()[0]); - marshalOne(IntercomControlControlType.values()[0]); - marshalOne(IntercomControlDestinationLineStateCommand.values()[0]); - marshalOne(IntercomControlRecordType.values()[0]); - marshalOne(IntercomControlTransmitLineState.values()[0]); - marshalOne(IsGroupOfGroupedEntityCategory.values()[0]); - marshalOne(IsGroupOfRestStatus.values()[0]); - marshalOne(IsPartOfNature.values()[0]); - marshalOne(IsPartOfPosition.values()[0]); - marshalOne(IsPartOfStationName.values()[0]); - marshalOne(IslandSubcategory.values()[0]); - marshalOne(JTIDSMIDSModulationParametersSynchronizationState.values()[0]); - marshalOne(JTIDSMIDSModulationParametersTransmittingTerminalPrimaryMode.values()[0]); - marshalOne(JTIDSMIDSModulationParametersTransmittingTerminalSecondaryMode.values()[0]); - - marshalOne(LeafCoverage.values()[0]); - marshalOne(Level2SquitterStatus.values()[0]); - marshalOne(LifeFormAirCategories.values()[0]); - marshalOne(LifeFormCategoriesUS.values()[0]); - marshalOne(LifeFormExtraPersonalData.values()[0]); - marshalOne(LifeFormHumanSpecificAntiMaterielRifles.values()[0]); - marshalOne(LifeFormHumanSpecificAntiTankMissiles.values()[0]); - marshalOne(LifeFormHumanSpecificAntiTankRockets.values()[0]); - marshalOne(LifeFormHumanSpecificAssaultRifles.values()[0]); - marshalOne(LifeFormHumanSpecificDroneGuns.values()[0]); - marshalOne(LifeFormHumanSpecificEquipmentClass.values()[0]); - marshalOne(LifeFormHumanSpecificFlameRockets.values()[0]); - marshalOne(LifeFormHumanSpecificFlameThrowers.values()[0]); - marshalOne(LifeFormHumanSpecificGrenadeLaunchers.values()[0]); - marshalOne(LifeFormHumanSpecificGrenadeLaunchingMachineGun.values()[0]); - marshalOne(LifeFormHumanSpecificHandGuns.values()[0]); - marshalOne(LifeFormHumanSpecificHighPowerRifles.values()[0]); - marshalOne(LifeFormHumanSpecificMachineGuns.values()[0]); - marshalOne(LifeFormHumanSpecificManPortableAirDefenseSystem.values()[0]); - marshalOne(LifeFormHumanSpecificMortars.values()[0]); - marshalOne(LifeFormHumanSpecificRecoillessRifles.values()[0]); - marshalOne(LifeFormHumanSpecificShotGuns.values()[0]); - marshalOne(LifeFormHumanSpecificSniper.values()[0]); - marshalOne(LifeFormHumanSpecificSubMachineGun.values()[0]); - marshalOne(LifeFormHumanSpecificWeaponNonspecific.values()[0]); - marshalOne(LifeFormHumanSubcategoryEquipmentClass.values()[0]); - marshalOne(LifeFormLandCategories.values()[0]); - marshalOne(LifeFormSubsurfaceCategories.values()[0]); - - marshalOne(LifeFormsSubcategoryCISWeapons.values()[0]); - marshalOne(LifeFormsSubcategoryFrenchWeapons.values()[0]); - marshalOne(LifeFormsSubcategoryGermanWeapons.values()[0]); - marshalOne(LifeFormsSubcategoryIranianWeapons.values()[0]); - marshalOne(LifeFormsSubcategoryUKWeapons.values()[0]); - marshalOne(LifeFormsSubcategoryUSWeapons.values()[0]); - marshalOne(LifeSavingEquipment.values()[0]); - - marshalOne(Link1111BDataTerminalSetIndicator.values()[0]); - marshalOne(Link1111BFidelityLevel.values()[0]); - marshalOne(Link1111BModeofOperation.values()[0]); - marshalOne(Link1111BTerminalMode.values()[0]); - marshalOne(Material.values()[0]); - marshalOne(MinefieldAppearanceActiveStatus.values()[0]); - marshalOne(MinefieldAppearanceLane.values()[0]); - marshalOne(MinefieldAppearanceMinefieldType.values()[0]); - marshalOne(MinefieldAppearanceState.values()[0]); - - marshalOne(MinefieldFusingFuseType.values()[0]); - marshalOne(MinefieldPaintSchemeAlgae.values()[0]); - marshalOne(MinefieldPaintSchemePaintScheme.values()[0]); - marshalOne(MinefieldSensorTypes.values()[0]); - marshalOne(MinefieldSensorTypesFLIR.values()[0]); - marshalOne(MinefieldSensorTypesLaser.values()[0]); - marshalOne(MinefieldSensorTypesMagnetic.values()[0]); - marshalOne(MinefieldSensorTypesMultispectral.values()[0]); - marshalOne(MinefieldSensorTypesOptical.values()[0]); - marshalOne(MinefieldSensorTypesPhysical.values()[0]); - marshalOne(MinefieldSensorTypesRADAR.values()[0]); - marshalOne(MinefieldSensorTypesSONAR.values()[0]); - - marshalOne(MinefieldStateProtocolMode.values()[0]); - marshalOne(Mode5IFFMission.values()[0]); - marshalOne(Mode5LevelSelection.values()[0]); - marshalOne(Mode5LocationErrors.values()[0]); - marshalOne(Mode5MessageFormatsStatus.values()[0]); - marshalOne(Mode5PlatformType.values()[0]); - marshalOne(Mode5Reply.values()[0]); - marshalOne(Mode5SAltitudeResolution.values()[0]); - marshalOne(Mode5SquitterType.values()[0]); - marshalOne(ModeCAltitudeIndicator.values()[0]); - marshalOne(ModeSInterrogatorIdentifierICType.values()[0]); - marshalOne(ModeSInterrogatorStatusTransmitState.values()[0]); - marshalOne(ModeSSquitterRecordSource.values()[0]); - marshalOne(ModeSSquitterType.values()[0]); - - marshalOne(MunitionCategory.values()[0]); - marshalOne(MunitionDescriptorFuse.values()[0]); - marshalOne(MunitionDescriptorWarhead.values()[0]); - marshalOne(MunitionDomain.values()[0]); - marshalOne(MunitionExpendableStatus.values()[0]); - marshalOne(NETIDRecordFrequencyTable.values()[0]); - marshalOne(NETIDRecordMode.values()[0]); - marshalOne(NavigationSource.values()[0]); - - marshalOne(ObjectKind.values()[0]); - - marshalOne(OwnershipStatus.values()[0]); - marshalOne(Parachute.values()[0]); - marshalOne(PhysicalAssociationTypeGroups.values()[0]); - marshalOne(PlatformAirCategory.values()[0]); - marshalOne(PlatformAirCivilianFixedWingAircraftSubcategories.values()[0]); - marshalOne(PlatformAirCivilianGliderSubcategories.values()[0]); - marshalOne(PlatformAirCivilianHelicopterSubcategories.values()[0]); - marshalOne(PlatformAirCivilianLighterthanAirAirshipSubcategories.values()[0]); - marshalOne(PlatformAirCivilianLighterthanAirBalloonSubcategories.values()[0]); - marshalOne(PlatformAirCivilianUltralightNonrigidWingAircraftSubcategories.values()[0]); - marshalOne(PlatformAirCivilianUltralightRigidWingAircraftSubcategories.values()[0]); - marshalOne(PlatformDomain.values()[0]); - marshalOne(PlatformLandBusSubcategories.values()[0]); - marshalOne(PlatformLandCarSubcategories.values()[0]); - marshalOne(PlatformLandCategory.values()[0]); - marshalOne(PlatformLandConstructionSpecialtyVehicleSubcategories.values()[0]); - marshalOne(PlatformLandFarmSpecialtyVehicleSubcategories.values()[0]); - marshalOne(PlatformLandMotorcycleSubcategories.values()[0]); - marshalOne(PlatformLandMultipleUnitCargoTruckSubcategories.values()[0]); - marshalOne(PlatformLandMultipleUnitUtilityEmergencyTruckSubcategories.values()[0]); - marshalOne(PlatformLandNonmotorizedSubcategories.values()[0]); - marshalOne(PlatformLandRecreationalSubcategories.values()[0]); - marshalOne(PlatformLandSingleUnitCargoTruckSubcategories.values()[0]); - marshalOne(PlatformLandSingleUnitUtilityEmergencyTruckSubcategories.values()[0]); - marshalOne(PlatformLandTrailerSubcategories.values()[0]); - marshalOne(PlatformLandTrainsSubcategories.values()[0]); - marshalOne(PlatformLandUtilityEmergencyCarSubcategories.values()[0]); - marshalOne(PlatformSpaceCategory.values()[0]); - marshalOne(PlatformSubsurfaceCategory.values()[0]); - marshalOne(PlatformSubsurfaceCivilianSemiSubmersiblesSubcategories.values()[0]); - marshalOne(PlatformSubsurfaceCivilianSubmarineSubcategories.values()[0]); - marshalOne(PlatformSubsurfaceCivilianSubmersibleSubcategories.values()[0]); - marshalOne(PlatformSurfaceCategory.values()[0]); - marshalOne(PlatformSurfaceDryCargoShipSubcategories.values()[0]); - marshalOne(PlatformSurfaceFishingVesselSubcategories.values()[0]); - marshalOne(PlatformSurfaceOtherVesselsSubcategories.values()[0]); - marshalOne(PlatformSurfacePassengerVesselSubcategories.values()[0]); - marshalOne(PlatformSurfacePrivateMotorboatSubcategories.values()[0]); - marshalOne(PlatformSurfacePrivateSailboatSubcategories.values()[0]); - marshalOne(PlatformSurfaceSupportVesselSubcategories.values()[0]); - marshalOne(PlatformSurfaceTankerSubcategories.values()[0]); - - marshalOne(RadioCategory.values()[0]); - marshalOne(RadioSubcategory.values()[0]); - marshalOne(ReceiverReceiverState.values()[0]); - marshalOne(RecordQueryREventType.values()[0]); - marshalOne(RecordREventType.values()[0]); - marshalOne(RepairCompleteRepair.values()[0]); - marshalOne(RepairGroups.values()[0]); - marshalOne(RepairResponseRepairResult.values()[0]); - marshalOne(ReplyAmplification.values()[0]); - marshalOne(RequiredReliabilityService.values()[0]); - marshalOne(Season.values()[0]); - - marshalOne(SensorEmitterCategory.values()[0]); - marshalOne(SensorOnOffStatus.values()[0]); - marshalOne(SensorRecordSensorTypeOtherActiveSensors.values()[0]); - marshalOne(SensorRecordSensorTypePassiveSensors.values()[0]); - marshalOne(SensorTypeSource.values()[0]); - marshalOne(SeparationVPPreEntityIndicator.values()[0]); - marshalOne(SeparationVPReasonforSeparation.values()[0]); - marshalOne(ServiceRequestServiceTypeRequested.values()[0]); - marshalOne(SignalEncodingClass.values()[0]); - marshalOne(SignalEncodingType.values()[0]); - marshalOne(SignalTDLType.values()[0]); - marshalOne(SignalUserProtocolIdentificationNumber.values()[0]); - - marshalOne(SpecificDimensionEnumerationsforAirAreaSize.values()[0]); - marshalOne(SpecificDimensionEnumerationsforLandAreaSize.values()[0]); - marshalOne(SpotChaffStatus.values()[0]); - - marshalOne(StopFreezeReason.values()[0]); - marshalOne(SubcategoriesforAirCategory200Bird.values()[0]); - marshalOne(SubcategoriesforAirCategory201Insect.values()[0]); - marshalOne(SubcategoriesforAirCategory202Mammal.values()[0]); - marshalOne(SubcategoriesforLandCategory200Mammal.values()[0]); - marshalOne(SubcategoriesforLandCategory201Reptile.values()[0]); - marshalOne(SubcategoriesforLandCategory202Amphibian.values()[0]); - marshalOne(SubcategoriesforLandCategory203Insect.values()[0]); - marshalOne(SubcategoriesforLandCategory204Arachnid.values()[0]); - marshalOne(SubcategoriesforLandCategory205Mollusk.values()[0]); - marshalOne(SubcategoriesforLandCategory206Marsupial.values()[0]); - marshalOne(SubcategoriesforSubsurfaceCategory200Fish.values()[0]); - marshalOne(SubcategoriesforSubsurfaceCategory201Mammal.values()[0]); - marshalOne(SubcategoriesforSubsurfaceCategory202Mollusk.values()[0]); - marshalOne(SubcategoriesforSubsurfaceCategory203Crustacean.values()[0]); - marshalOne(SubcategoriesforSubsurfaceCategory204Insect.values()[0]); - - marshalOne(SupplyDomain.values()[0]); - marshalOne(SupplyFuelType.values()[0]); - - marshalOne(SurveillanceStatus.values()[0]); - marshalOne(TCASACASBasicAdvancedIndicator.values()[0]); - marshalOne(TCASACASIndicator.values()[0]); - marshalOne(TCASACASSoftwareVersion.values()[0]); - marshalOne(TCASACASType.values()[0]); - marshalOne(TCASIIIType.values()[0]); - marshalOne(TILinkType.values()[0]); - marshalOne(TimeTypeSource.values()[0]); - marshalOne(TransferControlTransferType.values()[0]); - marshalOne(TransmissionIndicator.values()[0]); - marshalOne(TransmitterAntennaPatternReferenceSystem.values()[0]); - marshalOne(TransmitterAntennaPatternType.values()[0]); - marshalOne(TransmitterCryptoSystem.values()[0]); - marshalOne(TransmitterDetailAmplitudeModulation.values()[0]); - marshalOne(TransmitterDetailAmplitudeandAngleModulation.values()[0]); - marshalOne(TransmitterDetailAnglemodulation.values()[0]); - marshalOne(TransmitterDetailCarrierPhaseShiftModulation.values()[0]); - marshalOne(TransmitterDetailCombinationModulation.values()[0]); - marshalOne(TransmitterDetailPulseModulation.values()[0]); - marshalOne(TransmitterDetailSATCOMModulation.values()[0]); - marshalOne(TransmitterDetailUnmodulatedModulation.values()[0]); - marshalOne(TransmitterInputSource.values()[0]); - marshalOne(TransmitterMajorModulation.values()[0]); - marshalOne(TransmitterModulationTypeSystem.values()[0]); - marshalOne(TransmitterTransmitState.values()[0]); - marshalOne(TransponderInterrogatorIndicator.values()[0]); - marshalOne(TurnRateSource.values()[0]); - marshalOne(UAAcousticEmitterSystemFunction.values()[0]); - marshalOne(UAAcousticSystemName.values()[0]); - marshalOne(UAActiveEmissionParameterIndex.values()[0]); - marshalOne(UAAdditionalPassiveActivityParameterIndex.values()[0]); - marshalOne(UAPassiveParameterIndex.values()[0]); - - marshalOne(UAPropulsionPlantConfigurationConfiguration.values()[0]); - marshalOne(UAScanPattern.values()[0]); - marshalOne(UAStateChangeUpdateIndicator.values()[0]); - marshalOne(VariableParameterRecordType.values()[0]); - marshalOne(VariableRecordType.values()[0]); - marshalOne(VariantsforAirCategory200Bird.values()[0]); - marshalOne(VariantsforLandCategoriesReptilesAmphibiansInsectsandArachnids.values()[0]); - marshalOne(VariantsforSubsurfaceCategory201Mammal.values()[0]); - - - System.out.println("Testing BitSets"); - /* DisBitSets which were taken from the alphabetical list above where the spaces are */ - - // Testing import of particular Bits class - marshalOne(new AirPlatformAppearance(AirPlatformAppearance.AFTERBURNER_ON,1),"17"); - - marshalOne(new AirPlatformAppearance().set(AirPlatformAppearance.CANOPY_TROOP_DOOR, AppearanceCanopy.REAR_CANOPY_RIGHT_TROOP_DOOR_OPEN.getValue()),"9 3bitslen = 5"); - - marshalOne(new ArealObjectAppearanceMinefield().set(ArealObjectAppearanceMinefield.BREACH_STATE, 1),""); - marshalOne(new CulturalFeatureAppearance().set(CulturalFeatureAppearance.DAMAGE, 1),""); - marshalOne(new CulturalFeatureCapabilities().set(CulturalFeatureCapabilities.IED_PRESENCE_INDICATOR, 1),""); - marshalOne(new DEDamageDescriptionComponentVisualDamageStatus().set(DEDamageDescriptionComponentVisualDamageStatus.IS_FIRE_PRESENT, 1),""); - marshalOne(new DEFireFlags().set(DEFireFlags.STATE_UPDATE_FLAG, 1),""); - marshalOne(new EnvironmentalAppearance().set(EnvironmentalAppearance.DENSITY, 1),""); - - marshalOne(new EnvironmentalAppearance().set(EnvironmentalAppearance.DENSITY, 3).set(EnvironmentalAppearance.IS_FROZEN, 1),""); - - marshalOne(new EnvironmentalCapabilities().set(EnvironmentalCapabilities.IED_PRESENCE_INDICATOR, 1),""); - marshalOne(new EnvironmentalProcessEnvironmentStatus().set(EnvironmentalProcessEnvironmentStatus.IS_ACTIVE, 1),""); - marshalOne(new ExpendableAppearance().set(ExpendableAppearance.DAMAGE, 1),""); - marshalOne(new ExpendableCapabilities().set(ExpendableCapabilities.RESERVED, 1),""); - marshalOne(new LandPlatformAppearance().set(LandPlatformAppearance.BLACKOUT_BRAKE_LIGHTS_ON, 1),""); - marshalOne(new LandPlatformCapabilities().set(LandPlatformCapabilities.AMMUNITION_SUPPLY, 1),""); - marshalOne(new LifeFormsAppearance().set(LifeFormsAppearance.CAMOUFLAGE_TYPE,1),""); - marshalOne(new LifeFormsCapabilities().set(LifeFormsCapabilities.AMMUNITION_SUPPLY, 1),""); - marshalOne(new LinearObjectAppearanceExhaustSmoke().set(LinearObjectAppearanceExhaustSmoke.CHEMICAL_TYPE, 1),""); - marshalOne(new LinearObjectAppearanceMinefieldLaneMarker().set(LinearObjectAppearanceMinefieldLaneMarker.VISIBLE_SIDE, 1),""); - marshalOne(new LinearObjectAppearanceSpeedBump().set(LinearObjectAppearanceSpeedBump.COLOR, 1),""); - marshalOne(new LinearObjectAppearanceTankDitchAndConcertinaWire().set(LinearObjectAppearanceTankDitchAndConcertinaWire.BREACH_LENGTH, 1),""); - marshalOne(new LinearObjectAppearanceWire().set(LinearObjectAppearanceWire.COLOR, 1),""); - marshalOne(new MinefieldDataFusing().set(MinefieldDataFusing.HAS_ANTI_HANDLING_DEVICE,1),""); - marshalOne(new MinefieldDataPaintScheme().set(MinefieldDataPaintScheme.ALGAE, 1),""); - marshalOne(new MinefieldStateAppearanceBitMap().set(MinefieldStateAppearanceBitMap.ACTIVE_STATUS, 1),""); - marshalOne(new MunitionAppearance().set(MunitionAppearance.COVER_SHROUD_STATUS, 1),""); - marshalOne(new MunitionCapabilities().set(MunitionCapabilities.IED_PRESENCE_INDICATOR, 1),""); - marshalOne(new NonHumanLifeFormsAppearance().set(NonHumanLifeFormsAppearance.HEALTH, 1),""); - marshalOne(new ObjectStateAppearanceGeneral().set(ObjectStateAppearanceGeneral.DAMAGE, 1),""); - marshalOne(new ObjectStateModificationArealObject().set(ObjectStateModificationArealObject.IS_LOCATION_MODIFIED, 1),""); - marshalOne(new ObjectStateModificationLinearObject().set(ObjectStateModificationLinearObject.IS_LOCATION_MODIFIED, 1),""); - marshalOne(new ObjectStateModificationPointObject().set(ObjectStateModificationPointObject.IS_LOCATION_MODIFIED, 1),""); - marshalOne(new PointObjectAppearanceAirGroundBurst().set(PointObjectAppearanceAirGroundBurst.CHEMICAL_TYPE, 1),""); - marshalOne(new PointObjectAppearanceBuildingStructure().set(PointObjectAppearanceBuildingStructure.COLOR, 1),""); - marshalOne(new PointObjectAppearanceCrater().set(PointObjectAppearanceCrater.BREACH_STATE, 1),""); - marshalOne(new PointObjectAppearanceDisturbedEarthRoad().set(PointObjectAppearanceDisturbedEarthRoad.CONTRAST, 1),""); - marshalOne(new PointObjectAppearanceLogCribAbatisEtAl().set(PointObjectAppearanceLogCribAbatisEtAl.BREACH_STATE, 1),""); - marshalOne(new PointObjectAppearancePothole().set(PointObjectAppearancePothole.DEPTH, 1),""); - marshalOne(new PointObjectAppearanceRibbonBridge().set(PointObjectAppearanceRibbonBridge.NUMBER_OF_SEGMENTS, 1),""); - marshalOne(new PointObjectAppearanceTree().set(PointObjectAppearanceTree.LEAF_COVERAGE, 1),""); - marshalOne(new RadioAppearance().set(RadioAppearance.IS_FROZEN, 1),""); - marshalOne(new RadioCapabilities().set(RadioCapabilities.RESERVED, 1),""); - marshalOne(new SensorEmitterAppearance().set(SensorEmitterAppearance.ANTENNA_RAISED, 1),""); - marshalOne(new SensorEmitterCapabilities().set(SensorEmitterCapabilities.IED_PRESENCE_INDICATOR, 1),""); - marshalOne(new SpacePlatformAppearance().set(SpacePlatformAppearance.DAMAGE, 1),""); - marshalOne(new SpacePlatformCapabilities().set(SpacePlatformCapabilities.AMMUNITION_SUPPLY, 1),""); - marshalOne(new StopFreezeFrozenBehavior().set(StopFreezeFrozenBehavior.PROCESS_UPDATES, 1),""); - marshalOne(new SubsurfacePlatformAppearance().set(SubsurfacePlatformAppearance.DAMAGE, 1),""); - marshalOne(new SubsurfacePlatformCapabilities().set(SubsurfacePlatformCapabilities.AMMUNITION_SUPPLY, 1),""); - marshalOne(new SupplyAppearance().set(SupplyAppearance.DAMAGE, 1),""); - marshalOne(new SupplyCapabilities().set(SupplyCapabilities.AMMUNITION_SUPPLY, 1),""); - marshalOne(new SurfacePlatformAppearance().set(SurfacePlatformAppearance.DAMAGE, 1),""); - marshalOne(new SurfacePlatformCapabilities().set(SurfacePlatformCapabilities.AMMUNITION_SUPPLY, 1),""); - marshalOne(new UAPropulsionPlantConfiguration().set(UAPropulsionPlantConfiguration.CONFIGURATION, 1),""); - - // classes with no enumerated bit positions - marshalOne(new LinearObjectAppearanceBreach().set(0,1,1),""); - marshalOne(new PointObjectAppearanceBuildingRubble().set(0,1,1),""); - marshalOne(new PointObjectAppearanceStationaryBridgeAndAVLB().set(0,1,1),""); - } - catch (Throwable t) { - thr = t; - } - if(thr != null) thr.printStackTrace(); - //temp assertNull(thr, "Exception should be null if successful marshal"); - System.out.println(""+count+" enums and disbitsets tested"); + marshalOne(ComponentVisualDamageStatusSmoke.values()[0]); + marshalOne(ComponentVisualDamageStatusSurfaceDamage.values()[0]); + marshalOne(Country.values()[0]); + marshalOne(CoverShroudStatus.values()[0]); + // marshalOne(CryptoKeyIDCryptoMode.values()[0]); + + marshalOne(DEDamageDescriptionComponentDamageStatus.values()[0]); + + marshalOne(DEDamageDescriptionComponentVisualSmokeColor.values()[0]); + + marshalOne(DEFireFlagsStateUpdateFlag.values()[0]); + marshalOne(DEFirePulseShape.values()[0]); + marshalOne(DEPrecisionAimpointBeamSpotType.values()[0]); + marshalOne(DISAttributeActionCode.values()[0]); + marshalOne(DISLiveEntitySubprotocolNumber.values()[0]); + marshalOne(DISPDUStatusActiveInterrogationIndicatorAII.values()[0]); + marshalOne(DISPDUStatusCoupledExtensionIndicatorCEI.values()[0]); + marshalOne(DISPDUStatusDetonationTypeIndicatorDTI.values()[0]); + marshalOne(DISPDUStatusFireTypeIndicatorFTI.values()[0]); + marshalOne(DISPDUStatusIFFSimulationModeISM.values()[0]); + marshalOne(DISPDUStatusIntercomAttachedIndicatorIAI.values()[0]); + marshalOne(DISPDUStatusLVCIndicatorLVC.values()[0]); + marshalOne(DISPDUStatusRadioAttachedIndicatorRAI.values()[0]); + marshalOne(DISPDUStatusTransferredEntityIndicatorTEI.values()[0]); + marshalOne(DISPDUType.values()[0]); + marshalOne(DISProtocolFamily.values()[0]); + marshalOne(DISProtocolVersion.values()[0]); + marshalOne(DRParametersType.values()[0]); + marshalOne(DataCategory.values()[0]); + marshalOne(DeadReckoningAlgorithm.values()[0]); + marshalOne(DeltaMode5SAltitudePositiveNegativeIndicator.values()[0]); + marshalOne(DesignatorDesignatorCode.values()[0]); + marshalOne(DesignatorSystemName.values()[0]); + marshalOne(DetonationResult.values()[0]); + marshalOne(EEAttributeStateIndicator.values()[0]); + marshalOne(ElectromagneticEmissionBeamFunction.values()[0]); + marshalOne(ElectromagneticEmissionStateUpdateIndicator.values()[0]); + // why won't compile? marshalOne(EmitterName.values()[0]); + marshalOne(EmitterSystemFunction.values()[0]); + marshalOne(EntityAssociationAssociationStatus.values()[0]); + marshalOne(EntityAssociationAssociationType.values()[0]); + marshalOne(EntityAssociationGroupMemberType.values()[0]); + marshalOne(EntityAssociationPhysicalAssociationType.values()[0]); + marshalOne(EntityAssociationPhysicalConnectionType.values()[0]); + marshalOne(EntityDamageStatusComponentIdentification.values()[0]); + marshalOne(EntityKind.values()[0]); + marshalOne(EntityMarkingCharacterSet.values()[0]); + marshalOne(EntityVPRecordChangeIndicator.values()[0]); + marshalOne(EnvironmentRecordTypeGroups.values()[0]); + + marshalOne(EnvironmentalProcessModelType.values()[0]); + marshalOne(EnvironmentalProcessRecordType.values()[0]); + marshalOne(EnvironmentalSubcategory.values()[0]); + marshalOne(EventReportEventType.values()[0]); + marshalOne(ExpendableAirCategory.values()[0]); + + marshalOne(ExpendableSubsurfaceCategory.values()[0]); + marshalOne(ExpendableSurfaceCategory.values()[0]); + marshalOne(ExplosiveMaterialCategories.values()[0]); + marshalOne(ExplosiveMaterialGroups.values()[0]); + marshalOne(FlareSmokeColor.values()[0]); + marshalOne(FlareSmokeStatus.values()[0]); + marshalOne(ForceID.values()[0]); + marshalOne(FormatType.values()[0]); + marshalOne(FuelLocation.values()[0]); + marshalOne(FuelMeasurementUnits.values()[0]); + marshalOne(GridAxisDescriptorAxisType.values()[0]); + marshalOne(GriddedDataConstantGrid.values()[0]); + marshalOne(GriddedDataCoordinateSystem.values()[0]); + marshalOne(GriddedDataDataRepresentation.values()[0]); + marshalOne(GriddedDataFieldNumber.values()[0]); + marshalOne(GriddedDataSampleType.values()[0]); + marshalOne(HighDensityTrackJam.values()[0]); + marshalOne(HighFidelityHAVEQUICKTODTransmitIndicator.values()[0]); + marshalOne(IFFAlternateMode4ChallengeReply.values()[0]); + marshalOne(IFFApplicableModes.values()[0]); + marshalOne(IFFDataRecordAvailable.values()[0]); + marshalOne(IFFLayerSpecificInformation.values()[0]); + marshalOne(IFFSimulationMode.values()[0]); + marshalOne(IFFSystemMode.values()[0]); + marshalOne(IFFSystemName.values()[0]); + marshalOne(IFFSystemType.values()[0]); + marshalOne(IFFSystemType1OperationalParameter1.values()[0]); + marshalOne(IFFSystemType1OperationalParameter2.values()[0]); + marshalOne(IOActionIOActionPhase.values()[0]); + marshalOne(IOActionIOActionType.values()[0]); + marshalOne(IOActionIOSimulationSource.values()[0]); + marshalOne(IOActionIOWarfareType.values()[0]); + marshalOne(IOCommsNodeRecordCommsNodeType.values()[0]); + marshalOne(IOEffectsRecordIOEffect.values()[0]); + marshalOne(IOEffectsRecordIOLinkType.values()[0]); + marshalOne(IOEffectsRecordIOProcess.values()[0]); + marshalOne(IOEffectsRecordIOStatus.values()[0]); + marshalOne(IOReportIOReportType.values()[0]); + marshalOne(ISLSAntennaType.values()[0]); + marshalOne(IntercomControlCommand.values()[0]); + marshalOne(IntercomControlCommunicationsClass.values()[0]); + marshalOne(IntercomControlCommunicationsType.values()[0]); + marshalOne(IntercomControlControlType.values()[0]); + marshalOne(IntercomControlDestinationLineStateCommand.values()[0]); + marshalOne(IntercomControlRecordType.values()[0]); + marshalOne(IntercomControlTransmitLineState.values()[0]); + marshalOne(IsGroupOfGroupedEntityCategory.values()[0]); + marshalOne(IsGroupOfRestStatus.values()[0]); + marshalOne(IsPartOfNature.values()[0]); + marshalOne(IsPartOfPosition.values()[0]); + marshalOne(IsPartOfStationName.values()[0]); + marshalOne(IslandSubcategory.values()[0]); + marshalOne(JTIDSMIDSModulationParametersSynchronizationState.values()[0]); + marshalOne(JTIDSMIDSModulationParametersTransmittingTerminalPrimaryMode.values()[0]); + marshalOne(JTIDSMIDSModulationParametersTransmittingTerminalSecondaryMode.values()[0]); + + marshalOne(LeafCoverage.values()[0]); + marshalOne(Level2SquitterStatus.values()[0]); + marshalOne(LifeFormAirCategories.values()[0]); + marshalOne(LifeFormCategoriesUS.values()[0]); + marshalOne(LifeFormExtraPersonalData.values()[0]); + marshalOne(LifeFormHumanSpecificAntiMaterielRifles.values()[0]); + marshalOne(LifeFormHumanSpecificAntiTankMissiles.values()[0]); + marshalOne(LifeFormHumanSpecificAntiTankRockets.values()[0]); + marshalOne(LifeFormHumanSpecificAssaultRifles.values()[0]); + marshalOne(LifeFormHumanSpecificDroneGuns.values()[0]); + marshalOne(LifeFormHumanSpecificEquipmentClass.values()[0]); + marshalOne(LifeFormHumanSpecificFlameRockets.values()[0]); + marshalOne(LifeFormHumanSpecificFlameThrowers.values()[0]); + marshalOne(LifeFormHumanSpecificGrenadeLaunchers.values()[0]); + marshalOne(LifeFormHumanSpecificGrenadeLaunchingMachineGun.values()[0]); + marshalOne(LifeFormHumanSpecificHandGuns.values()[0]); + marshalOne(LifeFormHumanSpecificHighPowerRifles.values()[0]); + marshalOne(LifeFormHumanSpecificMachineGuns.values()[0]); + marshalOne(LifeFormHumanSpecificManPortableAirDefenseSystem.values()[0]); + marshalOne(LifeFormHumanSpecificMortars.values()[0]); + marshalOne(LifeFormHumanSpecificRecoillessRifles.values()[0]); + marshalOne(LifeFormHumanSpecificShotGuns.values()[0]); + marshalOne(LifeFormHumanSpecificSniper.values()[0]); + marshalOne(LifeFormHumanSpecificSubMachineGun.values()[0]); + marshalOne(LifeFormHumanSpecificWeaponNonspecific.values()[0]); + marshalOne(LifeFormHumanSubcategoryEquipmentClass.values()[0]); + marshalOne(LifeFormLandCategories.values()[0]); + marshalOne(LifeFormSubsurfaceCategories.values()[0]); + + marshalOne(LifeFormsSubcategoryCISWeapons.values()[0]); + marshalOne(LifeFormsSubcategoryFrenchWeapons.values()[0]); + marshalOne(LifeFormsSubcategoryGermanWeapons.values()[0]); + marshalOne(LifeFormsSubcategoryIranianWeapons.values()[0]); + marshalOne(LifeFormsSubcategoryUKWeapons.values()[0]); + marshalOne(LifeFormsSubcategoryUSWeapons.values()[0]); + marshalOne(LifeSavingEquipment.values()[0]); + + marshalOne(Link1111BDataTerminalSetIndicator.values()[0]); + marshalOne(Link1111BFidelityLevel.values()[0]); + marshalOne(Link1111BModeofOperation.values()[0]); + marshalOne(Link1111BTerminalMode.values()[0]); + marshalOne(Material.values()[0]); + marshalOne(MinefieldAppearanceActiveStatus.values()[0]); + marshalOne(MinefieldAppearanceLane.values()[0]); + marshalOne(MinefieldAppearanceMinefieldType.values()[0]); + marshalOne(MinefieldAppearanceState.values()[0]); + + marshalOne(MinefieldFusingFuseType.values()[0]); + marshalOne(MinefieldPaintSchemeAlgae.values()[0]); + marshalOne(MinefieldPaintSchemePaintScheme.values()[0]); + marshalOne(MinefieldSensorTypes.values()[0]); + marshalOne(MinefieldSensorTypesFLIR.values()[0]); + marshalOne(MinefieldSensorTypesLaser.values()[0]); + marshalOne(MinefieldSensorTypesMagnetic.values()[0]); + marshalOne(MinefieldSensorTypesMultispectral.values()[0]); + marshalOne(MinefieldSensorTypesOptical.values()[0]); + marshalOne(MinefieldSensorTypesPhysical.values()[0]); + marshalOne(MinefieldSensorTypesRADAR.values()[0]); + marshalOne(MinefieldSensorTypesSONAR.values()[0]); + + marshalOne(MinefieldStateProtocolMode.values()[0]); + marshalOne(Mode5IFFMission.values()[0]); + marshalOne(Mode5LevelSelection.values()[0]); + marshalOne(Mode5LocationErrors.values()[0]); + marshalOne(Mode5MessageFormatsStatus.values()[0]); + marshalOne(Mode5PlatformType.values()[0]); + marshalOne(Mode5Reply.values()[0]); + marshalOne(Mode5SAltitudeResolution.values()[0]); + marshalOne(Mode5SquitterType.values()[0]); + marshalOne(ModeCAltitudeIndicator.values()[0]); + marshalOne(ModeSInterrogatorIdentifierICType.values()[0]); + marshalOne(ModeSInterrogatorStatusTransmitState.values()[0]); + marshalOne(ModeSSquitterRecordSource.values()[0]); + marshalOne(ModeSSquitterType.values()[0]); + + marshalOne(MunitionCategory.values()[0]); + marshalOne(MunitionDescriptorFuse.values()[0]); + marshalOne(MunitionDescriptorWarhead.values()[0]); + marshalOne(MunitionDomain.values()[0]); + marshalOne(MunitionExpendableStatus.values()[0]); + marshalOne(NETIDRecordFrequencyTable.values()[0]); + marshalOne(NETIDRecordMode.values()[0]); + marshalOne(NavigationSource.values()[0]); + + marshalOne(ObjectKind.values()[0]); + + marshalOne(OwnershipStatus.values()[0]); + marshalOne(Parachute.values()[0]); + marshalOne(PhysicalAssociationTypeGroups.values()[0]); + marshalOne(PlatformAirCategory.values()[0]); + marshalOne(PlatformAirCivilianFixedWingAircraftSubcategories.values()[0]); + marshalOne(PlatformAirCivilianGliderSubcategories.values()[0]); + marshalOne(PlatformAirCivilianHelicopterSubcategories.values()[0]); + marshalOne(PlatformAirCivilianLighterthanAirAirshipSubcategories.values()[0]); + marshalOne(PlatformAirCivilianLighterthanAirBalloonSubcategories.values()[0]); + marshalOne(PlatformAirCivilianUltralightNonrigidWingAircraftSubcategories.values()[0]); + marshalOne(PlatformAirCivilianUltralightRigidWingAircraftSubcategories.values()[0]); + marshalOne(PlatformDomain.values()[0]); + marshalOne(PlatformLandBusSubcategories.values()[0]); + marshalOne(PlatformLandCarSubcategories.values()[0]); + marshalOne(PlatformLandCategory.values()[0]); + marshalOne(PlatformLandConstructionSpecialtyVehicleSubcategories.values()[0]); + marshalOne(PlatformLandFarmSpecialtyVehicleSubcategories.values()[0]); + marshalOne(PlatformLandMotorcycleSubcategories.values()[0]); + marshalOne(PlatformLandMultipleUnitCargoTruckSubcategories.values()[0]); + marshalOne(PlatformLandMultipleUnitUtilityEmergencyTruckSubcategories.values()[0]); + marshalOne(PlatformLandNonmotorizedSubcategories.values()[0]); + marshalOne(PlatformLandRecreationalSubcategories.values()[0]); + marshalOne(PlatformLandSingleUnitCargoTruckSubcategories.values()[0]); + marshalOne(PlatformLandSingleUnitUtilityEmergencyTruckSubcategories.values()[0]); + marshalOne(PlatformLandTrailerSubcategories.values()[0]); + marshalOne(PlatformLandTrainsSubcategories.values()[0]); + marshalOne(PlatformLandUtilityEmergencyCarSubcategories.values()[0]); + marshalOne(PlatformSpaceCategory.values()[0]); + marshalOne(PlatformSubsurfaceCategory.values()[0]); + marshalOne(PlatformSubsurfaceCivilianSemiSubmersiblesSubcategories.values()[0]); + marshalOne(PlatformSubsurfaceCivilianSubmarineSubcategories.values()[0]); + marshalOne(PlatformSubsurfaceCivilianSubmersibleSubcategories.values()[0]); + marshalOne(PlatformSurfaceCategory.values()[0]); + marshalOne(PlatformSurfaceDryCargoShipSubcategories.values()[0]); + marshalOne(PlatformSurfaceFishingVesselSubcategories.values()[0]); + marshalOne(PlatformSurfaceOtherVesselsSubcategories.values()[0]); + marshalOne(PlatformSurfacePassengerVesselSubcategories.values()[0]); + marshalOne(PlatformSurfacePrivateMotorboatSubcategories.values()[0]); + marshalOne(PlatformSurfacePrivateSailboatSubcategories.values()[0]); + marshalOne(PlatformSurfaceSupportVesselSubcategories.values()[0]); + marshalOne(PlatformSurfaceTankerSubcategories.values()[0]); + + marshalOne(RadioCategory.values()[0]); + marshalOne(RadioSubcategory.values()[0]); + marshalOne(ReceiverReceiverState.values()[0]); + marshalOne(RecordQueryREventType.values()[0]); + marshalOne(RecordREventType.values()[0]); + marshalOne(RepairCompleteRepair.values()[0]); + marshalOne(RepairGroups.values()[0]); + marshalOne(RepairResponseRepairResult.values()[0]); + marshalOne(ReplyAmplification.values()[0]); + marshalOne(RequiredReliabilityService.values()[0]); + marshalOne(Season.values()[0]); + + marshalOne(SensorEmitterCategory.values()[0]); + marshalOne(SensorOnOffStatus.values()[0]); + marshalOne(SensorRecordSensorTypeOtherActiveSensors.values()[0]); + marshalOne(SensorRecordSensorTypePassiveSensors.values()[0]); + marshalOne(SensorTypeSource.values()[0]); + marshalOne(SeparationVPPreEntityIndicator.values()[0]); + marshalOne(SeparationVPReasonforSeparation.values()[0]); + marshalOne(ServiceRequestServiceTypeRequested.values()[0]); + marshalOne(SignalEncodingClass.values()[0]); + marshalOne(SignalEncodingType.values()[0]); + marshalOne(SignalTDLType.values()[0]); + marshalOne(SignalUserProtocolIdentificationNumber.values()[0]); + + marshalOne(SpecificDimensionEnumerationsforAirAreaSize.values()[0]); + marshalOne(SpecificDimensionEnumerationsforLandAreaSize.values()[0]); + marshalOne(SpotChaffStatus.values()[0]); + + marshalOne(StopFreezeReason.values()[0]); + marshalOne(SubcategoriesforAirCategory200Bird.values()[0]); + marshalOne(SubcategoriesforAirCategory201Insect.values()[0]); + marshalOne(SubcategoriesforAirCategory202Mammal.values()[0]); + marshalOne(SubcategoriesforLandCategory200Mammal.values()[0]); + marshalOne(SubcategoriesforLandCategory201Reptile.values()[0]); + marshalOne(SubcategoriesforLandCategory202Amphibian.values()[0]); + marshalOne(SubcategoriesforLandCategory203Insect.values()[0]); + marshalOne(SubcategoriesforLandCategory204Arachnid.values()[0]); + marshalOne(SubcategoriesforLandCategory205Mollusk.values()[0]); + marshalOne(SubcategoriesforLandCategory206Marsupial.values()[0]); + marshalOne(SubcategoriesforSubsurfaceCategory200Fish.values()[0]); + marshalOne(SubcategoriesforSubsurfaceCategory201Mammal.values()[0]); + marshalOne(SubcategoriesforSubsurfaceCategory202Mollusk.values()[0]); + marshalOne(SubcategoriesforSubsurfaceCategory203Crustacean.values()[0]); + marshalOne(SubcategoriesforSubsurfaceCategory204Insect.values()[0]); + + marshalOne(SupplyDomain.values()[0]); + marshalOne(SupplyFuelType.values()[0]); + + marshalOne(SurveillanceStatus.values()[0]); + marshalOne(TCASACASBasicAdvancedIndicator.values()[0]); + marshalOne(TCASACASIndicator.values()[0]); + marshalOne(TCASACASSoftwareVersion.values()[0]); + marshalOne(TCASACASType.values()[0]); + marshalOne(TCASIIIType.values()[0]); + marshalOne(TILinkType.values()[0]); + marshalOne(TimeTypeSource.values()[0]); + marshalOne(TransferControlTransferType.values()[0]); + marshalOne(TransmissionIndicator.values()[0]); + marshalOne(TransmitterAntennaPatternReferenceSystem.values()[0]); + marshalOne(TransmitterAntennaPatternType.values()[0]); + marshalOne(TransmitterCryptoSystem.values()[0]); + marshalOne(TransmitterDetailAmplitudeModulation.values()[0]); + marshalOne(TransmitterDetailAmplitudeandAngleModulation.values()[0]); + marshalOne(TransmitterDetailAnglemodulation.values()[0]); + marshalOne(TransmitterDetailCarrierPhaseShiftModulation.values()[0]); + marshalOne(TransmitterDetailCombinationModulation.values()[0]); + marshalOne(TransmitterDetailPulseModulation.values()[0]); + marshalOne(TransmitterDetailSATCOMModulation.values()[0]); + marshalOne(TransmitterDetailUnmodulatedModulation.values()[0]); + marshalOne(TransmitterInputSource.values()[0]); + marshalOne(TransmitterMajorModulation.values()[0]); + marshalOne(TransmitterModulationTypeSystem.values()[0]); + marshalOne(TransmitterTransmitState.values()[0]); + marshalOne(TransponderInterrogatorIndicator.values()[0]); + marshalOne(TurnRateSource.values()[0]); + marshalOne(UAAcousticEmitterSystemFunction.values()[0]); + marshalOne(UAAcousticSystemName.values()[0]); + marshalOne(UAActiveEmissionParameterIndex.values()[0]); + marshalOne(UAAdditionalPassiveActivityParameterIndex.values()[0]); + marshalOne(UAPassiveParameterIndex.values()[0]); + + marshalOne(UAPropulsionPlantConfigurationConfiguration.values()[0]); + marshalOne(UAScanPattern.values()[0]); + marshalOne(UAStateChangeUpdateIndicator.values()[0]); + marshalOne(VariableParameterRecordType.values()[0]); + marshalOne(VariableRecordType.values()[0]); + marshalOne(VariantsforAirCategory200Bird.values()[0]); + marshalOne(VariantsforLandCategoriesReptilesAmphibiansInsectsandArachnids.values()[0]); + marshalOne(VariantsforSubsurfaceCategory201Mammal.values()[0]); + + //System.out.println("Testing BitSets"); + /* DisBitSets which were taken from the alphabetical list above where the spaces are */ + // Testing import of particular Bits class + marshalOne(new AirPlatformAppearance(AirPlatformAppearance.AFTERBURNER_ON, 1), "17"); + + marshalOne(new AirPlatformAppearance().set(AirPlatformAppearance.CANOPY_TROOP_DOOR, AppearanceCanopy.REAR_CANOPY_RIGHT_TROOP_DOOR_OPEN.getValue()), "9 3bitslen = 5"); + + marshalOne(new ArealObjectAppearanceMinefield().set(ArealObjectAppearanceMinefield.BREACH_STATE, 1), ""); + marshalOne(new CulturalFeatureAppearance().set(CulturalFeatureAppearance.DAMAGE, 1), ""); + marshalOne(new CulturalFeatureCapabilities().set(CulturalFeatureCapabilities.IED_PRESENCE_INDICATOR, 1), ""); + marshalOne(new DEDamageDescriptionComponentVisualDamageStatus().set(DEDamageDescriptionComponentVisualDamageStatus.IS_FIRE_PRESENT, 1), ""); + marshalOne(new DEFireFlags().set(DEFireFlags.STATE_UPDATE_FLAG, 1), ""); + marshalOne(new EnvironmentalAppearance().set(EnvironmentalAppearance.DENSITY, 1), ""); + + marshalOne(new EnvironmentalAppearance().set(EnvironmentalAppearance.DENSITY, 3).set(EnvironmentalAppearance.IS_FROZEN, 1), ""); + + marshalOne(new EnvironmentalCapabilities().set(EnvironmentalCapabilities.IED_PRESENCE_INDICATOR, 1), ""); + marshalOne(new EnvironmentalProcessEnvironmentStatus().set(EnvironmentalProcessEnvironmentStatus.IS_ACTIVE, 1), ""); + marshalOne(new ExpendableAppearance().set(ExpendableAppearance.DAMAGE, 1), ""); + marshalOne(new ExpendableCapabilities().set(ExpendableCapabilities.RESERVED, 1), ""); + marshalOne(new LandPlatformAppearance().set(LandPlatformAppearance.BLACKOUT_BRAKE_LIGHTS_ON, 1), ""); + marshalOne(new LandPlatformCapabilities().set(LandPlatformCapabilities.AMMUNITION_SUPPLY, 1), ""); + marshalOne(new LifeFormsAppearance().set(LifeFormsAppearance.CAMOUFLAGE_TYPE, 1), ""); + marshalOne(new LifeFormsCapabilities().set(LifeFormsCapabilities.AMMUNITION_SUPPLY, 1), ""); + marshalOne(new LinearObjectAppearanceExhaustSmoke().set(LinearObjectAppearanceExhaustSmoke.CHEMICAL_TYPE, 1), ""); + marshalOne(new LinearObjectAppearanceMinefieldLaneMarker().set(LinearObjectAppearanceMinefieldLaneMarker.VISIBLE_SIDE, 1), ""); + marshalOne(new LinearObjectAppearanceSpeedBump().set(LinearObjectAppearanceSpeedBump.COLOR, 1), ""); + marshalOne(new LinearObjectAppearanceTankDitchAndConcertinaWire().set(LinearObjectAppearanceTankDitchAndConcertinaWire.BREACH_LENGTH, 1), ""); + marshalOne(new LinearObjectAppearanceWire().set(LinearObjectAppearanceWire.COLOR, 1), ""); + marshalOne(new MinefieldDataFusing().set(MinefieldDataFusing.HAS_ANTI_HANDLING_DEVICE, 1), ""); + marshalOne(new MinefieldDataPaintScheme().set(MinefieldDataPaintScheme.ALGAE, 1), ""); + marshalOne(new MinefieldStateAppearanceBitMap().set(MinefieldStateAppearanceBitMap.ACTIVE_STATUS, 1), ""); + marshalOne(new MunitionAppearance().set(MunitionAppearance.COVER_SHROUD_STATUS, 1), ""); + marshalOne(new MunitionCapabilities().set(MunitionCapabilities.IED_PRESENCE_INDICATOR, 1), ""); + marshalOne(new NonHumanLifeFormsAppearance().set(NonHumanLifeFormsAppearance.HEALTH, 1), ""); + marshalOne(new ObjectStateAppearanceGeneral().set(ObjectStateAppearanceGeneral.DAMAGE, 1), ""); + marshalOne(new ObjectStateModificationArealObject().set(ObjectStateModificationArealObject.IS_LOCATION_MODIFIED, 1), ""); + marshalOne(new ObjectStateModificationLinearObject().set(ObjectStateModificationLinearObject.IS_LOCATION_MODIFIED, 1), ""); + marshalOne(new ObjectStateModificationPointObject().set(ObjectStateModificationPointObject.IS_LOCATION_MODIFIED, 1), ""); + marshalOne(new PointObjectAppearanceAirGroundBurst().set(PointObjectAppearanceAirGroundBurst.CHEMICAL_TYPE, 1), ""); + marshalOne(new PointObjectAppearanceBuildingStructure().set(PointObjectAppearanceBuildingStructure.COLOR, 1), ""); + marshalOne(new PointObjectAppearanceCrater().set(PointObjectAppearanceCrater.BREACH_STATE, 1), ""); + marshalOne(new PointObjectAppearanceDisturbedEarthRoad().set(PointObjectAppearanceDisturbedEarthRoad.CONTRAST, 1), ""); + marshalOne(new PointObjectAppearanceLogCribAbatisEtAl().set(PointObjectAppearanceLogCribAbatisEtAl.BREACH_STATE, 1), ""); + marshalOne(new PointObjectAppearancePothole().set(PointObjectAppearancePothole.DEPTH, 1), ""); + marshalOne(new PointObjectAppearanceRibbonBridge().set(PointObjectAppearanceRibbonBridge.NUMBER_OF_SEGMENTS, 1), ""); + marshalOne(new PointObjectAppearanceTree().set(PointObjectAppearanceTree.LEAF_COVERAGE, 1), ""); + marshalOne(new RadioAppearance().set(RadioAppearance.IS_FROZEN, 1), ""); + marshalOne(new RadioCapabilities().set(RadioCapabilities.RESERVED, 1), ""); + marshalOne(new SensorEmitterAppearance().set(SensorEmitterAppearance.ANTENNA_RAISED, 1), ""); + marshalOne(new SensorEmitterCapabilities().set(SensorEmitterCapabilities.IED_PRESENCE_INDICATOR, 1), ""); + marshalOne(new SpacePlatformAppearance().set(SpacePlatformAppearance.DAMAGE, 1), ""); + marshalOne(new SpacePlatformCapabilities().set(SpacePlatformCapabilities.AMMUNITION_SUPPLY, 1), ""); + marshalOne(new StopFreezeFrozenBehavior().set(StopFreezeFrozenBehavior.PROCESS_UPDATES, 1), ""); + marshalOne(new SubsurfacePlatformAppearance().set(SubsurfacePlatformAppearance.DAMAGE, 1), ""); + marshalOne(new SubsurfacePlatformCapabilities().set(SubsurfacePlatformCapabilities.AMMUNITION_SUPPLY, 1), ""); + marshalOne(new SupplyAppearance().set(SupplyAppearance.DAMAGE, 1), ""); + marshalOne(new SupplyCapabilities().set(SupplyCapabilities.AMMUNITION_SUPPLY, 1), ""); + marshalOne(new SurfacePlatformAppearance().set(SurfacePlatformAppearance.DAMAGE, 1), ""); + marshalOne(new SurfacePlatformCapabilities().set(SurfacePlatformCapabilities.AMMUNITION_SUPPLY, 1), ""); + marshalOne(new UAPropulsionPlantConfiguration().set(UAPropulsionPlantConfiguration.CONFIGURATION, 1), ""); + + // classes with no enumerated bit positions + marshalOne(new LinearObjectAppearanceBreach().set(0, 1, 1), ""); + marshalOne(new PointObjectAppearanceBuildingRubble().set(0, 1, 1), ""); + marshalOne(new PointObjectAppearanceStationaryBridgeAndAVLB().set(0, 1, 1), ""); } - int count = 0; - - private void marshalOne(Enum en) throws Throwable - { - Throwable thr = null; - try { - Exception ex = null; - ByteBuffer bb = ByteBuffer.allocate(100); - marshalIt(en, bb); - int sz = getMarshalSize(en); - //temp assertEquals(sz, bb.position(), "Marshalled array should be " + sz + " bytes long"); - // dump(en, sz, bb); - } - catch (Throwable t) { - thr = t; - } - //temp assertNull(thr, "Exception should be null if successful marshal"); - count++; + catch (Throwable t) { + thr = t; } - - private void marshalIt(Enum en, ByteBuffer bb) throws Throwable - { - Class c = en.getClass(); - Method meth = c.getDeclaredMethod("marshal", new Class[]{ByteBuffer.class}); - meth.invoke(en, bb); - } - - private int getMarshalSize(Enum en) throws Throwable - { - Class c = en.getClass(); - Method meth = c.getDeclaredMethod("getMarshalledSize", (Class[]) null); - return (Integer) meth.invoke(en, (Object[]) null); - } - - private void marshalOne(DisBitSet bs, String s) throws Throwable - { - Throwable thr = null; - try { - Exception ex = null; - ByteBuffer bb = ByteBuffer.allocate(100); - bs.marshal(bb); - int sz = bs.getMarshalledSize(); - assertEquals(sz, bb.position(), "Marshalled array should be " + sz + " bytes long"); - System.out.print(s+" "); - // dump(bs, bb); - } - catch (Throwable t) { - thr = t; - } - //tempassertNull(thr, "Exception should be null if successful marshal"); - count++; - } - - private void dump(Enum en, int sz, ByteBuffer bb) - { - System.out.print(en.getClass().getSimpleName() + "(" + sz + "): "); - dumpCommon(bb); + if (thr != null) + thr.printStackTrace(); + assertNull(thr, "Exception should be null if successful marshal"); + //System.out.println(""+count+" enums and disbitsets tested"); + } + int count = 0; + + private void marshalOne(Enum en) throws Throwable + { + ByteBuffer bb = ByteBuffer.allocate(100); + marshalIt(en, bb); + int sz = getMarshalSize(en); + assertEquals(sz, bb.position(), "Marshalled array should be " + sz + " bytes long"); + // dump(en, sz, bb); + + count++; + } + + private void marshalIt(Enum en, ByteBuffer bb) throws Throwable + { + Class c = en.getClass(); + Method meth = c.getDeclaredMethod("marshal", new Class[]{ByteBuffer.class}); + meth.invoke(en, bb); + } + + private int getMarshalSize(Enum en) throws Throwable + { + Class c = en.getClass(); + Method meth = c.getDeclaredMethod("getMarshalledSize", (Class[]) null); + return (Integer) meth.invoke(en, (Object[]) null); + } + + private void marshalOne(DisBitSet bs, String s) throws Throwable + { + Throwable thr = null; + try { + Exception ex = null; + ByteBuffer bb = ByteBuffer.allocate(100); + bs.marshal(bb); + int sz = bs.getMarshalledSize(); + assertEquals(sz, bb.position(), "Marshalled array should be " + sz + " bytes long"); + //System.out.print(s + " "); + // dump(bs, bb); } - - private void dump(DisBitSet bs, ByteBuffer bb) - { - System.out.print(bs.getClass().getSimpleName() + "(" + bs.getMarshalledSize() + "): "); - dumpCommon(bb); + catch (Throwable t) { + thr = t; } - - private void dumpCommon(ByteBuffer bb) - { - for (int i = 0; i < bb.position(); i++) { - System.out.print(String.format("%02X ", bb.array()[i])); - } - System.out.println(); + //tempassertNull(thr, "Exception should be null if successful marshal"); + count++; + } + + private void dump(Enum en, int sz, ByteBuffer bb) + { + System.out.println(en.getClass().getSimpleName() + "(" + sz + "): "); + dumpCommon(bb); + } + + private void dump(DisBitSet bs, ByteBuffer bb) + { + System.out.println(bs.getClass().getSimpleName() + "(" + bs.getMarshalledSize() + "): "); + dumpCommon(bb); + } + + private void dumpCommon(ByteBuffer bb) + { + for (int i = 0; i < bb.position(); i++) { + System.out.print(String.format("%02X ", bb.array()[i])); } + System.out.println(); + } } diff --git a/test/edu/nps/moves/dis7/NullFieldsMarshallTest.java b/test/edu/nps/moves/dis7/NullFieldsEntityMarshallTest.java similarity index 78% rename from test/edu/nps/moves/dis7/NullFieldsMarshallTest.java rename to test/edu/nps/moves/dis7/NullFieldsEntityMarshallTest.java index 5d42f04040..d24ce281ec 100644 --- a/test/edu/nps/moves/dis7/NullFieldsMarshallTest.java +++ b/test/edu/nps/moves/dis7/NullFieldsEntityMarshallTest.java @@ -1,3 +1,7 @@ +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html + */ /** * NullFieldsMarshallTest()); created on May 20, 2019 MOVES Institute Naval Postgraduate School, Monterey, CA, USA www.nps.edu * @@ -11,14 +15,16 @@ import java.nio.ByteBuffer; import org.junit.jupiter.api.*; import static org.junit.jupiter.api.Assertions.*; -@DisplayName("Null Fields Entity Marshal") -public class NullFieldsMarshallTest +@DisplayName("Null Fields Entity Marshall Test") +public class NullFieldsEntityMarshallTest { LAV_105 lav105; @BeforeAll public static void beforeAllTests() - {} + { + System.out.println("NullFieldsEntityMarshallTest"); + } @AfterAll public static void afterAllTests() @@ -39,21 +45,19 @@ public class NullFieldsMarshallTest @Test public void testNoSpecificNoExtraMarshal() { - System.out.println("Test no specific, no extra marshal"); Exception ex=null; ByteBuffer bb = ByteBuffer.allocate(100); try { - dumpET(lav105); + //dumpET(lav105); lav105.marshal(bb); - dumpBb(bb); - System.out.println("Test complete, no exception"); + //dumpBb(bb); } catch(Exception e) { System.err.println(e.getClass().getSimpleName()+": "+e.getLocalizedMessage()); ex = e; } - //temp assertNull(ex,"Exception should be null if successful marshal"); - //temp assertEquals(8, bb.position(), "Marshalled array should be 8 bytes long"); + assertNull(ex,"Exception should be null if successful marshal"); + assertEquals(8, bb.position(), "Marshalled array should be 8 bytes long"); } @Test @@ -97,7 +101,7 @@ public class NullFieldsMarshallTest public static void main(String[] args) { - NullFieldsMarshallTest inst = new NullFieldsMarshallTest(); + NullFieldsEntityMarshallTest inst = new NullFieldsEntityMarshallTest(); inst.setUp(); inst.testNoSpecificNoExtraMarshal(); } diff --git a/test/edu/nps/moves/dis7/ObjectTypeMarshallTest.java b/test/edu/nps/moves/dis7/ObjectTypeMarshallTest.java index 66605af6e3..8e2aa36c1b 100644 --- a/test/edu/nps/moves/dis7/ObjectTypeMarshallTest.java +++ b/test/edu/nps/moves/dis7/ObjectTypeMarshallTest.java @@ -1,11 +1,9 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html */ package edu.nps.moves.dis7; -//import edu.nps.moves.dis.ObjectType; import edu.nps.moves.dis7.objecttypes.LinearObject.Culturalfeature.Tracks_Tire.Tracks_Tire; import edu.nps.moves.dis7.objecttypes.LinearObject.Obstacle.ConcertinaWire._2_Roll._2_Roll; import java.nio.ByteBuffer; @@ -17,7 +15,10 @@ import static org.junit.jupiter.api.Assertions.assertNull; public class ObjectTypeMarshallTest { @BeforeAll - public static void setUpClass(){} + public static void setUpClass() + { + System.out.println("ObjectTypeMarshallTest"); + } @AfterAll public static void tearDownClass(){} @BeforeEach @@ -32,7 +33,6 @@ public class ObjectTypeMarshallTest try { _2_Roll roll2 = new _2_Roll(); common(roll2); - System.out.println("testGoodMarshal successful"); } catch (Throwable t) { thr = t; @@ -47,7 +47,6 @@ public class ObjectTypeMarshallTest try { Tracks_Tire tracksTire = new Tracks_Tire(); common(tracksTire); - System.out.println("TestNoSubCategory successful"); } catch (Throwable t) { thr = t; diff --git a/test/edu/nps/moves/dis7/TestPduFactory1.java b/test/edu/nps/moves/dis7/PduFactoryTest.java similarity index 93% rename from test/edu/nps/moves/dis7/TestPduFactory1.java rename to test/edu/nps/moves/dis7/PduFactoryTest.java index 255323c9da..e7843c7ee1 100644 --- a/test/edu/nps/moves/dis7/TestPduFactory1.java +++ b/test/edu/nps/moves/dis7/PduFactoryTest.java @@ -1,3 +1,7 @@ +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html + */ package edu.nps.moves.dis7; /** @@ -8,17 +12,17 @@ package edu.nps.moves.dis7; import edu.nps.moves.dis7.enumerations.Country; import edu.nps.moves.dis7.util.PduFactory; -import java.util.Arrays; import org.junit.jupiter.api.*; import static org.junit.jupiter.api.Assertions.assertNull; -@DisplayName("PduFactory All Pdus Create") +@DisplayName("Pdu Factory Test") -public class TestPduFactory1 +public class PduFactoryTest { @BeforeAll public static void beforeAllTests() { + System.out.println("PduFactoryTest"); } @AfterAll diff --git a/test/edu/nps/moves/dis7/SignalPdusTest.java b/test/edu/nps/moves/dis7/SignalPdusTest.java index 335e0fed5e..b4a62c7e23 100644 --- a/test/edu/nps/moves/dis7/SignalPdusTest.java +++ b/test/edu/nps/moves/dis7/SignalPdusTest.java @@ -1,19 +1,14 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/** + * Copyright (c) 2008-2019, MOVES Institute, Naval Postgraduate School. All rights reserved. + * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html */ package edu.nps.moves.dis7; -import edu.nps.moves.dis7.enumerations.*; import edu.nps.moves.dis7.util.DisNetworking; import edu.nps.moves.dis7.util.PduFactory; import java.io.IOException; -import java.lang.reflect.Method; -import java.nio.ByteBuffer; import org.junit.jupiter.api.*; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.*; @DisplayName("Signal Pdus Test") public class SignalPdusTest @@ -21,6 +16,7 @@ public class SignalPdusTest @BeforeAll public static void setUpClass() { + System.out.println("SignalPdusTest"); } @AfterAll @@ -62,14 +58,14 @@ public class SignalPdusTest setUpReceiver(); try { - Thread.sleep(250l); // make sure receiver is listening + Thread.sleep(2000l); //250l); // make sure receiver is listening DisNetworking disnet = new DisNetworking(); disnet.sendPdu(sigPdu); disnet.sendPdu(sigPdu2); disnet.sendPdu(isig); disnet.sendPdu(isig2); - Thread.sleep(1000l); //(180*1000l));//waiter.wait(); + Thread.sleep(3000l); //1000l); //(180*1000l));//waiter.wait(); } catch (Exception ex) { System.err.println("Error sending Multicast: " + ex.getLocalizedMessage()); @@ -78,10 +74,10 @@ public class SignalPdusTest // Compare // If we made it this far, we've sent and received. Now compare. - if (receivedPdu.equals(sigPdu)) - System.out.println("passed test"); - else - System.err.println("failed test"); + assertTrue(receivedPdu != null, "No response from network"); + assertTrue(receivedPdu.equals(sigPdu),"Sent and received pdus not identical"); + + System.out.println("SignalPdusTest finished"); } private void setUpReceiver() -- GitLab