-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WINDUPRULE-1019] adds eap 8 ruleset deprecated-initialcontextfactory…
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
rules/rules-reviewed/eap8/eap7/deprecated-initialcontextfactory-is-removed.windup.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,34 @@ | ||
<?xml version="1.0"?> | ||
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="deprecated-initialcontextfactory-is-removed" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd"> | ||
<metadata> | ||
<description> | ||
This ruleset provides analysis of Java EE applications that need to change their sources due to the removal of deprecated InitialContextFactory class. | ||
</description> | ||
<dependencies> | ||
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final" /> | ||
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final" /> | ||
<addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final" /> | ||
</dependencies> | ||
<sourceTechnology id="eap" versionRange="[6,8)" /> | ||
<targetTechnology id="eap" versionRange="[8,)" /> | ||
</metadata> | ||
<rules> | ||
<rule id="deprecated-initialcontextfactory-is-removed-00001"> | ||
<when> | ||
<or> | ||
<javaclass references="org.jboss.naming.remote.client.InitialContextFactory" /> | ||
<filecontent pattern='"org.jboss.naming.remote.client.InitialContextFactory"' filename="{*}.java"/> | ||
<filecontent pattern="org.jboss.naming.remote.client.InitialContextFactory" filename="{*}.wsdl"/> | ||
</or> | ||
</when> | ||
<perform> | ||
<hint title="Class org.jboss.naming.remote.client.InitialContextFactory has been removed" effort="1" category-id="mandatory"> | ||
<message>Replace this class with `org.wildfly.naming.client.WildFlyInitialContextFactory`.</message> | ||
<tag>JakartaEE</tag> | ||
</hint> | ||
</perform> | ||
</rule> | ||
</rules> | ||
</ruleset> |
10 changes: 10 additions & 0 deletions
10
...deprecated-initialcontextfactory-is-removed/DeprecatedInitialcontextfactoryIsRemoved.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,10 @@ | ||
import org.jboss.naming.remote.client.InitialContextFactory; | ||
|
||
public class DeprecatedInitialcontextfactoryIsRemoved { | ||
|
||
String propertyValue = "org.jboss.naming.remote.client.InitialContextFactory"; | ||
|
||
public String getDeprecatedClassName() { | ||
return InitialContextFactory.class.getName(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...recated-initialcontextfactory-is-removed/deprecated-initialcontextfactory-is-removed.wsdl
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,8 @@ | ||
<definitions name = "HelloService" | ||
targetNamespace = "http://www.examples.com/wsdl/HelloService.wsdl" | ||
xmlns = "http://schemas.xmlsoap.org/wsdl/" | ||
xmlns:soapjms = "http://schemas.xmlsoap.org/wsdl/soap/"> | ||
<service name="exampleService"> | ||
<soapjms:jndiInitialContextFactory>org.jboss.naming.remote.client.InitialContextFactory</soapjms:jndiInitialContextFactory> | ||
</service> | ||
</definitions> |
24 changes: 24 additions & 0 deletions
24
...ules-reviewed/eap8/eap7/tests/deprecated-initialcontextfactory-is-removed.windup.test.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,24 @@ | ||
<?xml version="1.0"?> | ||
<ruletest id="deprecated-initialcontextfactory-is-removed-tests" | ||
xmlns="http://windup.jboss.org/schema/jboss-ruleset" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd"> | ||
<testDataPath>data/deprecated-initialcontextfactory-is-removed</testDataPath> | ||
<rulePath>../deprecated-initialcontextfactory-is-removed.windup.xml</rulePath> | ||
<ruleset> | ||
<rules> | ||
<rule id="deprecated-initialcontextfactory-is-removed-00001-test"> | ||
<when> | ||
<not> | ||
<iterable-filter size="3"> | ||
<hint-exists message="Replace this class with `org.wildfly.naming.client.WildFlyInitialContextFactory`."/> | ||
</iterable-filter> | ||
</not> | ||
</when> | ||
<perform> | ||
<fail message="[deprecated-initialcontextfactory-is-removed-00001] The hint was not found!" /> | ||
</perform> | ||
</rule> | ||
</rules> | ||
</ruleset> | ||
</ruletest> |