Search in sources :

Example 1 with PolicyTagMigrationStep

use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep in project mule-migration-assistant by mulesoft.

the class BasicStructureMigrationTask method getSteps.

@Override
public List<MigrationStep> getSteps() {
    PolicyFileRenameMigrationStep policyFileRenameMigrationStep = new PolicyFileRenameMigrationStep();
    policyFileRenameMigrationStep.setApplicationModel(getApplicationModel());
    List<MigrationStep> steps = new ArrayList<>();
    steps.add(new PolicyTagMigrationStep());
    steps.add(new BeforeTagMigrationStep());
    steps.add(new AfterTagMigrationStep());
    steps.add(new BeforeExceptionTagMigrationStep());
    steps.add(new AfterExceptionTagMigrationStep());
    steps.add(new PointcutTagMigrationStep());
    steps.add(new DataTagMigrationStep());
    steps.add(new CleanupAttributesMigrationStep());
    steps.add(policyFileRenameMigrationStep);
    return steps;
}
Also used : BeforeExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeExceptionTagMigrationStep) AfterExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep) BeforeTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep) AfterExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep) PolicyFileRenameMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyFileRenameMigrationStep) AfterTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterTagMigrationStep) PointcutTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep) BeforeTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep) BeforeExceptionTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeExceptionTagMigrationStep) PolicyTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep) CleanupAttributesMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.CleanupAttributesMigrationStep) MigrationStep(com.mulesoft.tools.migration.step.MigrationStep) DataTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.DataTagMigrationStep) ArrayList(java.util.ArrayList) DataTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.DataTagMigrationStep) PolicyFileRenameMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyFileRenameMigrationStep) PolicyTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep) AfterTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterTagMigrationStep) CleanupAttributesMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.CleanupAttributesMigrationStep) PointcutTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep)

Example 2 with PolicyTagMigrationStep

use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep in project mule-migration-assistant by mulesoft.

the class PolicyTagMigrationStepTestCase method convertPolicyKeepingContent.

@Test
public void convertPolicyKeepingContent() {
    final PolicyTagMigrationStep step = new PolicyTagMigrationStep();
    Element element = getTestElement().addContent(new Element(GENERIC_TAG_NAME).setText(GENERIC_TAG_VALUE).setAttribute(GENERIC_TAG_ATTRIBUTE_NAME, GENERIC_TAG_ATTRIBUTE_VALUE).setNamespace(GENERIC_NAMESPACE));
    step.execute(element, reportMock);
    assertMuleTagName(element, true);
    assertThat(element.getAttribute(SCHEMA_LOCATION, XSI_NAMESPACE).getValue(), is(new Attribute(SCHEMA_LOCATION, MULE_4_XSI_SCHEMA_LOCATION_URI, XSI_NAMESPACE).getValue()));
    final Element genericElement = (Element) element.getContent().get(0);
    assertThat(genericElement.getParentElement().getName(), is(MULE_TAG_NAME));
    assertThat(genericElement.getParentElement().getNamespaceURI(), is(MULE_4_NAMESPACE_URI));
    assertThat(genericElement.getValue(), is(GENERIC_TAG_VALUE));
    assertThat(genericElement.getCType().name(), is(Element.class.getSimpleName()));
    assertThat(genericElement.getNamespacesIntroduced().size(), is(2));
    assertThat(getElementNamespaces(element), is(GENERIC_NAMESPACE_URI));
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element) PolicyTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep) Test(org.junit.Test)

Example 3 with PolicyTagMigrationStep

use of com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep in project mule-migration-assistant by mulesoft.

the class PolicyTagMigrationStepTestCase method convertRawPolicy.

@Test
public void convertRawPolicy() {
    final PolicyTagMigrationStep step = new PolicyTagMigrationStep();
    Element element = getTestElement();
    step.execute(element, reportMock);
    assertMuleTagName(element, false);
}
Also used : Element(org.jdom2.Element) PolicyTagMigrationStep(com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep) Test(org.junit.Test)

Aggregations

PolicyTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyTagMigrationStep)3 Element (org.jdom2.Element)2 Test (org.junit.Test)2 AfterExceptionTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterExceptionTagMigrationStep)1 AfterTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.AfterTagMigrationStep)1 BeforeExceptionTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeExceptionTagMigrationStep)1 BeforeTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.BeforeTagMigrationStep)1 CleanupAttributesMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.CleanupAttributesMigrationStep)1 DataTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.DataTagMigrationStep)1 PointcutTagMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PointcutTagMigrationStep)1 PolicyFileRenameMigrationStep (com.mulesoft.tools.migration.library.gateway.steps.policy.basicstructure.PolicyFileRenameMigrationStep)1 MigrationStep (com.mulesoft.tools.migration.step.MigrationStep)1 ArrayList (java.util.ArrayList)1 Attribute (org.jdom2.Attribute)1