Migration guide

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (3)

View Page History
** {{javax.xml.bind}} -> {{jakarta.xml.bind}}
** ...
* to generate your beans from an XSD or WSDL definition, use the Maven plugin '{{org.patrodyne.jvnet:hisrc-higherjaxb-maven-plugin}}' instead of '{{org.jvnet.jaxb2.maven2:maven-jaxb2-plugin}}'.,
* the component under test instance is now initialized through the annotation '{{@ComponentUnderTestExtension}}' with its own '{{InMemoryLogHandler}}':
{code}
public class MyComponentTest

@ComponentUnderTestExtension(inMemoryLogHandler = @InMemoryLogHandlerExtension, explicitPostInitialization = true)
protected static ComponentUnderTest COMPONENT_UNDER_TEST;

@BeforeAll
private static void completesComponentUnderTestConfiguration() throws Exception {
COMPONENT_UNDER_TEST.registerServiceToDeploy(VALID_INTEGRATION_SU_PROVIDE, new ServiceConfigurationFactory() {
@Override
public ServiceConfiguration create() {

final URL wsdlUrl = Thread.currentThread().getContextClassLoader()
.getResource("su/valid/integrationMailService.wsdl");
assertNotNull(wsdlUrl, "WSDl not found");

final ProvidesServiceConfiguration serviceConfiguration = new ProvidesServiceConfiguration(
IntegrationService.INTERFACE_NAME, INTEGRATION_SVC_NAME, INTEGRATION_EDP, wsdlUrl);

serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.SCHEME_PATHELEMENT),
MailConstants.MAIL_SCHEME_SMTP);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.HOST_PATHELEMENT), "localhost");
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.PORT_PATHELEMENT),
String.valueOf(MAIL_SERVER.getSmtp().getPort()));
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.FROM_PATHELEMENT),
EXTERNAL_EMAIL_ADDRESS_FROM);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.REPLY_PATHELEMENT),
EXTERNAL_EMAIL_ADDRESS_REPLY);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.TO_PATHELEMENT),
EXTERNAL_EMAIL_ADDRESS_TO_2);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.SUBJECT_PATHELEMENT),
EXTERNAL_EMAIL_SUBJECT);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.CONTENTTYPE_PATHELEMENT), "text/plain");

return serviceConfiguration;
}
}).registerServiceToDeploy(VALID_SU_CONSUME_POP3, new ServiceConfigurationFactory() {
@Override
public ServiceConfiguration create() {

final ConsumesServiceConfiguration serviceConfiguration = new ConsumesServiceConfiguration(
PROVIDER_ITF_NAME, PROVIDER_SVC_NAME, PROVIDER_EDP);
serviceConfiguration.setOperation(CONSUMED_OPERATION);
serviceConfiguration.setTimeout(CONSUMED_TIMEOUT);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.SCHEME_PATHELEMENT),
MailConstants.MAIL_SCHEME_POP3);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.HOST_PATHELEMENT), "localhost");
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.PORT_PATHELEMENT),
String.valueOf(MAIL_SERVER.getPop3().getPort()));
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.USER_PATHELEMENT),
INCOMING_ACCOUNT_USER);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.PASSWORD_PATHELEMENT),
INCOMING_ACCOUNT_PWD);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.FOLDER_QUERYELEMENT),
MailConstants.FOLDER_DEFAULT);
serviceConfiguration.setParameter(
new QName(MailConstants.MAIL_SERVICE_NS, MailConstants.PERIOD_QUERYELEMENT), "500");

return serviceConfiguration;
}
}).registerExternalServiceProvider(PROVIDER_EDP, PROVIDER_SVC_NAME, PROVIDER_ITF_NAME).postInitComponentUnderTest();
}

@Test
public void receiveMail() throws Exception {

...

COMPONENT.receiveAsExternalProvider(
ServiceProviderImplementation.statusMessage(ExchangeStatus.DONE).with(new MessageChecks() {
@Override
public void checks(Message message) throws Exception {
...
}
}), 4000, true);

// Check MONIT traces
final List<LogRecord> monitLogs = COMPONENT_UNDER_TEST.getInMemoryLogHandler().getAllRecords(Level.MONIT);
assertEquals(4, monitLogs_1.size());
final FlowLogData consumeExtLogData = assertMonitMailConsumerBeginLog(..., monitLogs.get(0));
final FlowLogData provideLogData = assertMonitProviderBeginLog(..., monitLogs.get(1));
assertMonitProviderEndLog(provideLogData, monitLogs.get(2));
assertMonitConsumerExtEndLog(consumeExtLogData, monitLogs.get(3));
}
}
{code}

{anchor:from57xto58x}
h1. From 5.7.x to 5.8.x