Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Confirm that stackoverflow issue is not a maven-filtering issue anymore

git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@1571030 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit fc45cf755247772b252f0199fc189bf6e32a2142 1 parent cb3116d
@rfscholte rfscholte authored
View
17 ...rc/test/java/org/apache/maven/shared/filtering/MultiDelimiterInterpolatorFilterReaderLineEndingTest.java
@@ -80,5 +80,22 @@ public void testLineWithSingleAtAndExpression()
assertEquals( "toto@titi.com bar", IOUtil.toString( reader ) );
}
+
+ // http://stackoverflow.com/questions/21786805/maven-war-plugin-customize-filter-delimitters-in-webresources/
+ @Test
+ public void testAtDollarExpression() throws Exception
+ {
+ when( interpolator.interpolate( eq( "${db.server}" ), eq( "" ), isA( RecursionInterceptor.class ) ) ).thenReturn( "DB_SERVER" );
+ when( interpolator.interpolate( eq( "${db.port}" ), eq( "" ), isA( RecursionInterceptor.class ) ) ).thenReturn( "DB_PORT" );
+ when( interpolator.interpolate( eq( "${db.name}" ), eq( "" ), isA( RecursionInterceptor.class ) ) ).thenReturn( "DB_NAME" );
+
+ Reader in = new StringReader( " url=\"jdbc:oracle:thin:\\@${db.server}:${db.port}:${db.name}\"" );
+ MultiDelimiterInterpolatorFilterReaderLineEnding reader =
+ new MultiDelimiterInterpolatorFilterReaderLineEnding( in, interpolator, true );
+ reader.setEscapeString( "\\" );
+ reader.setDelimiterSpecs( new HashSet<String>( Arrays.asList( "${*}", "@" ) ) );
+
+ assertEquals( " url=\"jdbc:oracle:thin:@DB_SERVER:DB_PORT:DB_NAME\"", IOUtil.toString( reader ) );
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.