Code example for URL

Methods: openStream

0
    } 
 
    @Test 
    public void givenValidAndroidManifestXmlTreeThenPackageIsFound() throws IOException { 
        final URL         resource               = this.getClass().getResource("AndroidManifestXmlTree.txt");
        final InputStream inputStream            = resource.openStream();
        final String      androidManifestXmlTree = IOUtils.toString(inputStream);
        final String      foundPackage           = androidMojo.extractPackageNameFromAndroidManifestXmlTree(androidManifestXmlTree);
        Assert.assertEquals("com.example.android.apis", foundPackage);
    } 
 
    @Test 
    public void givenApidemosApkThenPackageIsFound() throws IOException, MojoExecutionException, URISyntaxException { 
        final URL    resource     = this.getClass().getResource("apidemos-0.1.0-SNAPSHOT.apk");
        final String foundPackage = androidMojo.extractPackageNameFromApk(new File(new URI(resource.toString())));
        Assert.assertEquals("com.example.android.apis", foundPackage);
    } 
 
    @Test 
    public void givenApidemosPlatformtestsApkThenPackageIsFound() throws IOException, MojoExecutionException, URISyntaxException { 
        final URL    resource     = this.getClass().getResource("apidemos-platformtests-0.1.0-SNAPSHOT.apk");