Package org.apache.plc4x.test.migration
Class MessageValidatorAndMigrator
java.lang.Object
org.apache.plc4x.test.migration.MessageValidatorAndMigrator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessagevalidateInboundMessageAndGet(Map<String, String> options, org.dom4j.Element referenceXml) Validates a inbound message and migrates it to the expectation if the parameterautoMigrateis set to truestatic MessagevalidateInboundMessageAndGet(MessageInput messageInput, org.dom4j.Element referenceXml) Validates a inbound message and migrates it to the expectation if the parameterautoMigrateis set to truestatic voidvalidateOutboundMessageAndMigrate(String testCaseName, Map<String, String> options, org.dom4j.Element referenceXml, List<String> parserArguments, byte[] data, ByteOrder byteOrder, boolean autoMigrate, URI siteURI) Validates a outbound message and migrates it to the expectation if the parameterautoMigrateis set to true.static booleanvalidateOutboundMessageAndMigrate(String testCaseName, MessageInput<?> messageInput, org.dom4j.Element referenceXml, byte[] data, ByteOrder byteOrder, boolean autoMigrate, URI siteURI) Validates a outbound message and migrates it to the expectation if the parameterautoMigrateis set to true
-
Constructor Details
-
MessageValidatorAndMigrator
public MessageValidatorAndMigrator()
-
-
Method Details
-
validateOutboundMessageAndMigrate
public static void validateOutboundMessageAndMigrate(String testCaseName, Map<String, String> options, org.dom4j.Element referenceXml, List<String> parserArguments, byte[] data, ByteOrder byteOrder, boolean autoMigrate, URI siteURI) throws DriverTestsuiteExceptionValidates a outbound message and migrates it to the expectation if the parameterautoMigrateis set to true.Passed options should contain a single 'package' option or 'protocolName' and 'outputFlavor'. In case if package is not specified then protocol name and output flavor (e.g read-write) are used to construct lookup package.
- Parameters:
testCaseName- name of the testcaseoptions- map with specific test/lookup options.referenceXml- the xml we expect the outbound message to beparserArguments- the parser arguments to create an instance of the messagedata- the bytes of the messagebyteOrder- the byte-oder being usedautoMigrate- indicates if we want to migrate to a new versionsiteURI- the file which we want to auto migrate- Throws:
DriverTestsuiteException- if something goes wrong
-
validateOutboundMessageAndMigrate
public static boolean validateOutboundMessageAndMigrate(String testCaseName, MessageInput<?> messageInput, org.dom4j.Element referenceXml, byte[] data, ByteOrder byteOrder, boolean autoMigrate, URI siteURI) throws DriverTestsuiteException Validates a outbound message and migrates it to the expectation if the parameterautoMigrateis set to true- Parameters:
testCaseName- name of the testcasemessageInput- the pre-constructed MessageInputreferenceXml- the xml we expect the outbound message to bedata- the bytes of the messagebyteOrder- the byte-order being usedautoMigrate- indicates if we want to migrate to a new versionsiteURI- the file which we want to auto migrate- Returns:
- true if migration happened
- Throws:
DriverTestsuiteException- if something goes wrong
-
validateInboundMessageAndGet
public static Message validateInboundMessageAndGet(Map<String, String> options, org.dom4j.Element referenceXml) Validates a inbound message and migrates it to the expectation if the parameterautoMigrateis set to true- Parameters:
options- Options which contain custom 'package' name or keys 'protocolName' (name of the protocol) and 'outputFlavor' (flavor of the output e.g read-write) which are used to construct class lookup root package.referenceXml- the xml we expect the outbound message- Returns:
- the message if all went well
-
validateInboundMessageAndGet
public static Message validateInboundMessageAndGet(MessageInput messageInput, org.dom4j.Element referenceXml) Validates a inbound message and migrates it to the expectation if the parameterautoMigrateis set to true- Parameters:
messageInput- the pre-constructed MessageInputreferenceXml- the xml we expect the outbound messag- Returns:
- the message if all went well
-