-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report interceptors as not migrated (#657)
- Loading branch information
Showing
17 changed files
with
352 additions
and
19 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...ool-e2e-tests/src/test/resources/e2e/gaps/interceptors/input/src/main/app/mule-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<mule xmlns="http://www.mulesoft.org/schema/mule/core" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd"> | ||
|
||
<interceptor-stack name="stack"> | ||
<custom-interceptor | ||
class="org.mule.test.integration.interceptor.SharedInterceptorStackTestCase$CustomInterceptor" /> | ||
</interceptor-stack> | ||
|
||
<flow name="MyService"> | ||
<custom-interceptor class="org.my.CustomInterceptor"/> | ||
<logging-interceptor/> | ||
<interceptor-stack ref="stack"/> | ||
<timer-interceptor/> | ||
</flow> | ||
|
||
<flow name="flow1"> | ||
<log-component> | ||
<interceptor-stack ref="stack" /> | ||
</log-component> | ||
</flow> | ||
|
||
<flow name="flow2"> | ||
<echo-component/> | ||
<echo-component> | ||
<custom-interceptor class="org.mule.test.integration.interceptor.SharedInterceptorStackTestCase$CustomInterceptor" /> | ||
</echo-component> | ||
|
||
<log-component/> | ||
<log-component> | ||
<custom-interceptor class="org.mule.test.integration.interceptor.SharedInterceptorStackTestCase$CustomInterceptor" /> | ||
</log-component> | ||
|
||
<null-component/> | ||
<null-component> | ||
<custom-interceptor class="org.mule.test.integration.interceptor.SharedInterceptorStackTestCase$CustomInterceptor" /> | ||
</null-component> | ||
</flow> | ||
|
||
</mule> |
159 changes: 159 additions & 0 deletions
159
...gration-tool-e2e-tests/src/test/resources/e2e/gaps/interceptors/output/report/report.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
{ | ||
"projectType": "MULE_THREE_APPLICATION", | ||
"projectName": "input", | ||
"connectorsMigrated": [], | ||
"numberOfMuleComponents": 21, | ||
"numberOfMuleComponentsMigrated": 11, | ||
"componentDetails": { | ||
"mule": { | ||
"success": 1, | ||
"failure": 0 | ||
}, | ||
"flow": { | ||
"success": 3, | ||
"failure": 0 | ||
}, | ||
"interceptor-stack": { | ||
"success": 0, | ||
"failure": 3 | ||
}, | ||
"custom-interceptor": { | ||
"success": 0, | ||
"failure": 5 | ||
}, | ||
"logging-interceptor": { | ||
"success": 0, | ||
"failure": 1 | ||
}, | ||
"timer-interceptor": { | ||
"success": 0, | ||
"failure": 1 | ||
}, | ||
"echo-component": { | ||
"success": 1, | ||
"failure": 0 | ||
}, | ||
"set-payload": { | ||
"success": 1, | ||
"failure": 0 | ||
}, | ||
"logger": { | ||
"success": 3, | ||
"failure": 0 | ||
}, | ||
"raise-error": { | ||
"success": 2, | ||
"failure": 0 | ||
} | ||
}, | ||
"numberOfMELExpressions": 0, | ||
"numberOfMELExpressionsMigrated": 0, | ||
"numberOfMELExpressionLines": 0, | ||
"numberOfMELExpressionLinesMigrated": 0, | ||
"numberOfDWTransformations": 0, | ||
"numberOfDWTransformationsMigrated": 0, | ||
"numberOfDWTransformationLines": 0, | ||
"numberOfDWTransformationLinesMigrated": 0, | ||
"detailedMessages": [ | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "interceptor-stack", | ||
"lineNumber": 4, | ||
"columnNumber": 37, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "custom-interceptor", | ||
"lineNumber": 8, | ||
"columnNumber": 124, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "custom-interceptor", | ||
"lineNumber": 16, | ||
"columnNumber": 62, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "logging-interceptor", | ||
"lineNumber": 22, | ||
"columnNumber": 30, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "interceptor-stack", | ||
"lineNumber": 28, | ||
"columnNumber": 40, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "timer-interceptor", | ||
"lineNumber": 34, | ||
"columnNumber": 28, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "interceptor-stack", | ||
"lineNumber": 44, | ||
"columnNumber": 44, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "custom-interceptor", | ||
"lineNumber": 55, | ||
"columnNumber": 128, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "custom-interceptor", | ||
"lineNumber": 65, | ||
"columnNumber": 128, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
}, | ||
{ | ||
"level": "ERROR", | ||
"key": "components.interceptors", | ||
"component": "custom-interceptor", | ||
"lineNumber": 75, | ||
"columnNumber": 128, | ||
"message": "Interceptors have been replaced by custom policies in Mule 4.", | ||
"filePath": "src/main/mule/mule-config.xml", | ||
"documentationLinks": [] | ||
} | ||
] | ||
} |
84 changes: 84 additions & 0 deletions
84
...l-e2e-tests/src/test/resources/e2e/gaps/interceptors/output/src/main/mule/mule-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd"> | ||
|
||
<interceptor-stack name="stack"> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
<custom-interceptor class="org.mule.test.integration.interceptor.SharedInterceptorStackTestCase$CustomInterceptor"> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</custom-interceptor> | ||
</interceptor-stack> | ||
|
||
<flow name="MyService"> | ||
<custom-interceptor class="org.my.CustomInterceptor"> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</custom-interceptor> | ||
|
||
<logging-interceptor> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</logging-interceptor> | ||
|
||
<interceptor-stack ref="stack"> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</interceptor-stack> | ||
|
||
<timer-interceptor> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</timer-interceptor> | ||
|
||
</flow> | ||
|
||
<flow name="flow1"> | ||
<logger message="#[payload]"> | ||
<interceptor-stack ref="stack"> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</interceptor-stack> | ||
</logger> | ||
|
||
</flow> | ||
|
||
<flow name="flow2"> | ||
<set-payload value="#[payload]"> | ||
<custom-interceptor class="org.mule.test.integration.interceptor.SharedInterceptorStackTestCase$CustomInterceptor"> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</custom-interceptor> | ||
</set-payload> | ||
|
||
<logger message="#[payload]" /> | ||
|
||
<logger message="#[payload]"> | ||
<custom-interceptor class="org.mule.test.integration.interceptor.SharedInterceptorStackTestCase$CustomInterceptor"> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</custom-interceptor> | ||
</logger> | ||
|
||
<raise-error type="COMPATIBILITY:UNSUPPORTED" description="This service cannot receive messages" /> | ||
|
||
<raise-error type="COMPATIBILITY:UNSUPPORTED" description="This service cannot receive messages"> | ||
<custom-interceptor class="org.mule.test.integration.interceptor.SharedInterceptorStackTestCase$CustomInterceptor"> | ||
<!--Migration ERROR: Interceptors have been replaced by custom policies in Mule 4.--> | ||
<!-- For more information refer to:--> | ||
<!-- * https://docs.mulesoft.com/api-manager/2.x/policies-custom-landing-page--> | ||
</custom-interceptor> | ||
</raise-error> | ||
|
||
</flow> | ||
|
||
</mule> |
43 changes: 43 additions & 0 deletions
43
...c/main/java/com/mulesoft/tools/migration/library/mule/steps/core/InterceptorElements.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2020, Mulesoft, LLC. All rights reserved. | ||
* Use of this source code is governed by a BSD 3-Clause License | ||
* license that can be found in the LICENSE.txt file. | ||
*/ | ||
package com.mulesoft.tools.migration.library.mule.steps.core; | ||
|
||
import com.mulesoft.tools.migration.step.AbstractApplicationModelMigrationStep; | ||
import com.mulesoft.tools.migration.step.category.MigrationReport; | ||
|
||
import org.jdom2.Element; | ||
|
||
/** | ||
* Unsupported interceptor elements. | ||
* | ||
* @author Mulesoft Inc. | ||
* @since 1.0.0 | ||
*/ | ||
public class InterceptorElements extends AbstractApplicationModelMigrationStep { | ||
|
||
public static final String XPATH_SELECTOR = "" | ||
+ "//*[" | ||
+ "local-name()='interceptor-stack' or " | ||
+ "local-name()='custom-interceptor' or " | ||
+ "local-name()='logging-interceptor' or " | ||
+ "local-name()='timer-interceptor'" | ||
+ "]"; | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Interceptor elements are no longer supported"; | ||
} | ||
|
||
public InterceptorElements() { | ||
this.setAppliedTo(XPATH_SELECTOR); | ||
} | ||
|
||
@Override | ||
public void execute(Element object, MigrationReport report) throws RuntimeException { | ||
report.report("components.interceptors", object, object, object.getName()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.