Migration guide

If your custom component is based on Petals Component Developer Toolkit, some changes can occur according to the target version of the Petals CDK required

From 5.8.x to 5.9.x

Migrating your component runtime

Migrating your component unit test

Please apply the following changes in the unit tests oy your custom component:

  • JUnit 5 is now required for your unit tests,
  • move Java EE package to Jakarta EE 9+ package:
    • javax.activation -> jakarta.activation
    • javax.mail -> jakarta.mail
    • 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':
    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);
                    ...
    
                    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);
                    ...
    
                    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));
        }
    }
    

From 5.7.x to 5.8.x

Migrating your component runtime

Please apply the following changes in the source code of your custom component:

  • Placeholders are no more defined through Properties but through Placeholders.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.