Code example for URL

Methods: getFile

0
    } 
 
    //@Test 
    public void givenApidemosApkThenPackageIsFound() throws IOException, MojoExecutionException { 
        final URL    resource     = this.getClass().getResource("apidemos-0.1.0-SNAPSHOT.apk");
        final String foundPackage = androidMojo.extractPackageNameFromApk(new File(resource.getFile()));
        Assert.assertEquals("com.example.android.apis", foundPackage);
    } 
 
    //@Test 
    public void givenApidemosPlatformtestsApkThenPackageIsFound() throws IOException, MojoExecutionException { 
        final URL    resource     = this.getClass().getResource("apidemos-platformtests-0.1.0-SNAPSHOT.apk");
        final String foundPackage = androidMojo.extractPackageNameFromApk(new File(resource.getFile()));
        Assert.assertEquals("com.example.android.apis.tests", foundPackage);
    } 
 
    private class DefaultTestAndroidMojo extends AbstractAndroidMojo { 
 
        @Override 
        protected AndroidSdk getAndroidSdk() { 
            return new SdkTestSupport().getSdk_with_platform_1_5();