-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from apache/warn
replace deprecated methods
- Loading branch information
Showing
5 changed files
with
41 additions
and
36 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,10 +29,10 @@ | |
import java.util.List; | ||
import java.util.Properties; | ||
|
||
import org.apache.commons.io.IOUtils; | ||
import org.apache.maven.project.MavenProject; | ||
import org.apache.maven.shared.utils.io.FileUtils; | ||
import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper; | ||
import org.apache.maven.shared.utils.io.IOUtil; | ||
import org.codehaus.plexus.PlexusTestCase; | ||
|
||
/** | ||
|
@@ -149,9 +149,10 @@ public void testMavenBasedir() | |
|
||
List<FilterWrapper> wrappers = mavenFileFilter.getDefaultFilterWrappers( req ); | ||
|
||
Reader reader = wrappers.get( 0 ).getReader( new StringReader( "${filefilter} ${buildfilter}" ) ); | ||
|
||
assertEquals( "true true", IOUtil.toString( reader ) ); | ||
try ( Reader reader = wrappers.get( 0 ).getReader( new StringReader( "${filefilter} ${buildfilter}" ) ) ) | ||
{ | ||
assertEquals( "true true", IOUtils.toString( reader ) ); | ||
} | ||
} | ||
|
||
// MSHARED-198: custom delimiters doesn't work as expected | ||
|
@@ -169,10 +170,10 @@ public void testCustomDelimiters() | |
List<FilterWrapper> wrappers = mavenFileFilter.getDefaultFilterWrappers( req ); | ||
|
||
Reader reader = wrappers.get( 0 ).getReader( new StringReader( "aaaFILTER.a.MEaaa" ) ); | ||
assertEquals( "DONE", IOUtil.toString( reader ) ); | ||
assertEquals( "DONE", IOUtils.toString( reader ) ); | ||
|
||
reader = wrappers.get( 0 ).getReader( new StringReader( "abcFILTER.a.MEabc" ) ); | ||
assertEquals( "DONE", IOUtil.toString( reader ) ); | ||
assertEquals( "DONE", IOUtils.toString( reader ) ); | ||
} | ||
|
||
// MSHARED-199: Filtering doesn't work if 2 delimiters are used on the same line, the first one being left open | ||
|
@@ -188,7 +189,9 @@ public void testLineWithSingleAtAndExpression() | |
|
||
List<FilterWrapper> wrappers = mavenFileFilter.getDefaultFilterWrappers( req ); | ||
|
||
Reader reader = wrappers.get( 0 ).getReader( new StringReader( "[email protected] ${foo}" ) ); | ||
assertEquals( "[email protected] bar", IOUtil.toString( reader ) ); | ||
try ( Reader reader = wrappers.get( 0 ).getReader( new StringReader( "[email protected] ${foo}" ) ) ) | ||
{ | ||
assertEquals( "[email protected] bar", IOUtils.toString( reader ) ); | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
import java.io.StringReader; | ||
import java.util.Properties; | ||
|
||
import org.apache.maven.shared.utils.io.IOUtil; | ||
import org.apache.commons.io.IOUtils; | ||
import org.codehaus.plexus.PlexusTestCase; | ||
|
||
/** | ||
|
@@ -35,7 +35,6 @@ public class DefaultMavenReaderFilterTest | |
public void testJustDoSomeFiltering() | ||
throws Exception | ||
{ | ||
assertNotNull( DefaultMavenReaderFilter.class ); | ||
MavenReaderFilter readerFilter = lookup( MavenReaderFilter.class ); | ||
|
||
StringReader src = new StringReader( "[email protected] ${foo}" ); | ||
|
@@ -46,8 +45,9 @@ public void testJustDoSomeFiltering() | |
req.setFiltering( true ); | ||
req.setAdditionalProperties( additionalProperties ); | ||
|
||
final Reader filter = readerFilter.filter( req ); | ||
|
||
assertEquals( "[email protected] bar", IOUtil.toString( filter ) ); | ||
try ( Reader filter = readerFilter.filter( req ) ) | ||
{ | ||
assertEquals( "[email protected] bar", IOUtils.toString( filter ) ); | ||
} | ||
} | ||
} |
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