Code example for URL

Methods: toURI

0
    } 
 
    //@Test 
    public void givenAndroidManifestThenTargetPackageIsFound() throws MalformedURLException, URISyntaxException, MojoExecutionException { 
        final URL    url                = this.getClass().getResource("AndroidManifest.xml");
        final URI    uri                = url.toURI();
        final File   file               = new File(uri);
        final String foundTargetPackage = androidMojo.extractPackageNameFromAndroidManifest(file);
        Assert.assertEquals("com.example.android.apis.tests", foundTargetPackage);
    } 
 
    //@Test 
    public void givenAndroidManifestThenInstrumentationRunnerIsFound() throws MalformedURLException, URISyntaxException, MojoExecutionException { 
        final URL    url             = this.getClass().getResource("AndroidManifest.xml");
        final URI    uri             = url.toURI();
        final File   file            = new File(uri);
        final String foundInstrumentationRunner = androidMojo.extractInstrumentationRunnerFromAndroidManifest(file);
        Assert.assertEquals("android.test.InstrumentationTestRunner", foundInstrumentationRunner);
    } 
 
    //@Test