Browse files

Merge pull request #114 from bobwalker99/master

Issue 263
  • Loading branch information...
2 parents d36f1b9 + b7c007d commit ea375e1e7b39389db639b345226c7cba60dba915 @mosabua mosabua committed Mar 27, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/test/java/com/jayway/maven/plugins/android/AndroidSdkTest.java
View
11 src/test/java/com/jayway/maven/plugins/android/AndroidSdkTest.java
@@ -81,12 +81,13 @@ public void givenPlatform1dot5ThenPlatformis1dot5() throws IllegalAccessExceptio
@Test
public void givenPlatformNullThenPlatformisSomethingValidLooking() throws IllegalAccessException, URISyntaxException {
- final File path = (File) ReflectionUtils.getValueIncludingSuperclasses("sdkPath",sdkTestSupport.getSdk_with_platform_default());
+ final File sdkPath = (File) ReflectionUtils.getValueIncludingSuperclasses("sdkPath",sdkTestSupport.getSdk_with_platform_default());
final File platform = sdkTestSupport.getSdk_with_platform_default().getPlatform();
- final String platformPath = platform.getAbsolutePath();
- final String pathPath = path.getAbsolutePath();
- final String regex = new File(pathPath + "/platforms/android-.*").toURI().toString();
- Assert.assertTrue(new File(platformPath).toURI().toString().matches(regex));
+ final String platformPath = platform.getAbsoluteFile().toURI().toString();
+ final String regex = "/platforms/android-.*";
+ //Strip off the sdkPath part
+ String matcher = platformPath.substring( sdkPath.toURI().toString().length() -1 );
+ Assert.assertTrue(String.format("Platform [%s] does not match regex: [%s]", matcher,regex), matcher.matches(regex));
}
/**

0 comments on commit ea375e1

Please sign in to comment.