Search in sources :

Example 96 with Stack

use of java.util.Stack in project maven-plugins by apache.

the class BundleCreateMojoTest method testDefaultconfiguration_RemoveTwoWithSpace.

public void testDefaultconfiguration_RemoveTwoWithSpace() throws Exception {
    try {
        createTestJars("default-configuration", true, true, getBasedir() + "/target/test/unit/default-configuration/target");
    } catch (IOException ie) {
        ie.printStackTrace();
    }
    File testPom = new File(getBasedir(), "src/test/resources/unit/default-configuration/pom.xml");
    try {
        BundleCreateMojo mojo = (BundleCreateMojo) lookupMojo("bundle-create", testPom);
        // NOTE: This is sensitive to the lookupMojo method timing...
        TestInputHandler ih = (TestInputHandler) lookup(InputHandler.ROLE, "default");
        Stack<String> responses = new Stack<String>();
        responses.push("2, 3");
        ih.setLineResponses(responses);
        mojo.execute();
    } catch (Exception e) {
        e.printStackTrace();
    }
    File bundleSource = new File(getBasedir(), "target/test/unit/default-configuration/target/default-configuration-bundle.jar");
    assertTrue(FileUtils.fileExists(bundleSource.getAbsolutePath()));
    Set<String> entryNames = new HashSet<String>();
    entryNames.add("default-configuration.jar");
    entryNames.add("pom.xml");
    entryNames.add("META-INF/MANIFEST.MF");
    entryNames.add("META-INF/");
    Set<String> bannedNames = new HashSet<String>();
    bannedNames.add("default-configuration-javadoc.jar");
    bannedNames.add("default-configuration-sources.jar");
    assertZipContents(entryNames, bannedNames, bundleSource);
}
Also used : IOException(java.io.IOException) File(java.io.File) TestInputHandler(org.apache.maven.plugins.repository.testutil.TestInputHandler) IOException(java.io.IOException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) Stack(java.util.Stack) HashSet(java.util.HashSet)

Example 97 with Stack

use of java.util.Stack in project maven-plugins by apache.

the class BundleCreateMojoTest method testDefaultconfiguration_RemoveOne.

public void testDefaultconfiguration_RemoveOne() throws Exception {
    try {
        createTestJars("default-configuration", true, true, getBasedir() + "/target/test/unit/default-configuration/target");
    } catch (IOException ie) {
        ie.printStackTrace();
    }
    File testPom = new File(getBasedir(), "src/test/resources/unit/default-configuration/pom.xml");
    try {
        BundleCreateMojo mojo = (BundleCreateMojo) lookupMojo("bundle-create", testPom);
        // NOTE: This is sensitive to the lookupMojo method timing...
        TestInputHandler ih = (TestInputHandler) lookup(InputHandler.ROLE, "default");
        Stack<String> responses = new Stack<String>();
        responses.push("2");
        ih.setLineResponses(responses);
        mojo.execute();
    } catch (Exception e) {
        e.printStackTrace();
    }
    File bundleSource = new File(getBasedir(), "target/test/unit/default-configuration/target/default-configuration-bundle.jar");
    assertTrue(FileUtils.fileExists(bundleSource.getAbsolutePath()));
    Set<String> entryNames = new HashSet<String>();
    entryNames.add("default-configuration-sources.jar");
    entryNames.add("default-configuration.jar");
    entryNames.add("pom.xml");
    entryNames.add("META-INF/MANIFEST.MF");
    entryNames.add("META-INF/");
    Set<String> bannedNames = new HashSet<String>();
    bannedNames.add("default-configuration-javadoc.jar");
    assertZipContents(entryNames, bannedNames, bundleSource);
}
Also used : IOException(java.io.IOException) File(java.io.File) TestInputHandler(org.apache.maven.plugins.repository.testutil.TestInputHandler) IOException(java.io.IOException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) Stack(java.util.Stack) HashSet(java.util.HashSet)

Example 98 with Stack

use of java.util.Stack in project maven-plugins by apache.

the class BundleCreateMojoTest method testDefaultconfiguration_RemoveTwoUnordered.

public void testDefaultconfiguration_RemoveTwoUnordered() throws Exception {
    try {
        createTestJars("default-configuration", true, true, getBasedir() + "/target/test/unit/default-configuration/target");
    } catch (IOException ie) {
        ie.printStackTrace();
    }
    File testPom = new File(getBasedir(), "src/test/resources/unit/default-configuration/pom.xml");
    try {
        BundleCreateMojo mojo = (BundleCreateMojo) lookupMojo("bundle-create", testPom);
        // NOTE: This is sensitive to the lookupMojo method timing...
        TestInputHandler ih = (TestInputHandler) lookup(InputHandler.ROLE, "default");
        Stack<String> responses = new Stack<String>();
        responses.push("3,2");
        ih.setLineResponses(responses);
        mojo.execute();
    } catch (Exception e) {
        e.printStackTrace();
    }
    File bundleSource = new File(getBasedir(), "target/test/unit/default-configuration/target/default-configuration-bundle.jar");
    assertTrue(FileUtils.fileExists(bundleSource.getAbsolutePath()));
    Set<String> entryNames = new HashSet<String>();
    entryNames.add("default-configuration.jar");
    entryNames.add("pom.xml");
    entryNames.add("META-INF/MANIFEST.MF");
    entryNames.add("META-INF/");
    Set<String> bannedNames = new HashSet<String>();
    bannedNames.add("default-configuration-javadoc.jar");
    bannedNames.add("default-configuration-sources.jar");
    assertZipContents(entryNames, bannedNames, bundleSource);
}
Also used : IOException(java.io.IOException) File(java.io.File) TestInputHandler(org.apache.maven.plugins.repository.testutil.TestInputHandler) IOException(java.io.IOException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) Stack(java.util.Stack) HashSet(java.util.HashSet)

Example 99 with Stack

use of java.util.Stack in project maven-plugins by apache.

the class BundlePackMojoTest method testPack_RemoveTwo.

public void testPack_RemoveTwo() throws Exception {
    File testPom = new File(getBasedir(), "src/test/resources/unit/bundle-pack/pom.xml");
    BundlePackMojo mojo = (BundlePackMojo) lookupMojo("bundle-pack", testPom);
    URL repoURL = new File(getBasedir(), "src/test/resources/repo").toURL();
    mojo.localRepository = new DefaultArtifactRepository("test", repoURL.toString(), new DefaultRepositoryLayout());
    // NOTE: This is sensitive to the lookupMojo method timing...
    TestInputHandler ih = (TestInputHandler) lookup(InputHandler.ROLE, "default");
    Stack<String> responses = new Stack<String>();
    responses.push("2,3");
    ih.setLineResponses(responses);
    File generatedFilesDir = new File(getBasedir(), "target/bundle-pack-tests");
    mojo.basedir = generatedFilesDir.getAbsolutePath();
    mojo.execute();
    File bundleSource = new File(generatedFilesDir, "testartifact-1.0-bundle.jar");
    Set<String> entryNames = new HashSet<String>();
    entryNames.add("testartifact-1.0.jar");
    entryNames.add("pom.xml");
    entryNames.add("META-INF/MANIFEST.MF");
    entryNames.add("META-INF/");
    Set<String> bannedNames = new HashSet<String>();
    // determined experimentally, so this could change!
    bannedNames.add("testartifact-1.0-sources.jar");
    bannedNames.add("testartifact-1.0-javadoc.jar");
    assertZipContents(entryNames, bannedNames, bundleSource);
}
Also used : DefaultArtifactRepository(org.apache.maven.artifact.repository.DefaultArtifactRepository) DefaultRepositoryLayout(org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout) File(java.io.File) TestInputHandler(org.apache.maven.plugins.repository.testutil.TestInputHandler) URL(java.net.URL) Stack(java.util.Stack) HashSet(java.util.HashSet)

Example 100 with Stack

use of java.util.Stack in project maven-plugins by apache.

the class BundlePackMojoTest method testPack_RemoveTwoUnordered.

public void testPack_RemoveTwoUnordered() throws Exception {
    File testPom = new File(getBasedir(), "src/test/resources/unit/bundle-pack/pom.xml");
    BundlePackMojo mojo = (BundlePackMojo) lookupMojo("bundle-pack", testPom);
    URL repoURL = new File(getBasedir(), "src/test/resources/repo").toURL();
    mojo.localRepository = new DefaultArtifactRepository("test", repoURL.toString(), new DefaultRepositoryLayout());
    // NOTE: This is sensitive to the lookupMojo method timing...
    TestInputHandler ih = (TestInputHandler) lookup(InputHandler.ROLE, "default");
    Stack<String> responses = new Stack<String>();
    responses.push("3,2");
    ih.setLineResponses(responses);
    File generatedFilesDir = new File(getBasedir(), "target/bundle-pack-tests");
    mojo.basedir = generatedFilesDir.getAbsolutePath();
    mojo.execute();
    File bundleSource = new File(generatedFilesDir, "testartifact-1.0-bundle.jar");
    Set<String> entryNames = new HashSet<String>();
    entryNames.add("testartifact-1.0.jar");
    entryNames.add("pom.xml");
    entryNames.add("META-INF/MANIFEST.MF");
    entryNames.add("META-INF/");
    Set<String> bannedNames = new HashSet<String>();
    // determined experimentally, so this could change!
    bannedNames.add("testartifact-1.0-sources.jar");
    bannedNames.add("testartifact-1.0-javadoc.jar");
    assertZipContents(entryNames, bannedNames, bundleSource);
}
Also used : DefaultArtifactRepository(org.apache.maven.artifact.repository.DefaultArtifactRepository) DefaultRepositoryLayout(org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout) File(java.io.File) TestInputHandler(org.apache.maven.plugins.repository.testutil.TestInputHandler) URL(java.net.URL) Stack(java.util.Stack) HashSet(java.util.HashSet)

Aggregations

Stack (java.util.Stack)245 HashSet (java.util.HashSet)42 ArrayList (java.util.ArrayList)37 File (java.io.File)23 IOException (java.io.IOException)22 View (android.view.View)18 Test (org.junit.Test)18 ViewGroup (android.view.ViewGroup)14 HashMap (java.util.HashMap)14 Set (java.util.Set)12 LinkedList (java.util.LinkedList)11 List (java.util.List)11 ImageView (android.widget.ImageView)10 Map (java.util.Map)10 Document (org.w3c.dom.Document)10 TestInputHandler (org.apache.maven.plugins.repository.testutil.TestInputHandler)9 PostfixMathCommandI (org.nfunk.jep.function.PostfixMathCommandI)9 DocumentBuilder (javax.xml.parsers.DocumentBuilder)8 NotificationPanelView (com.android.systemui.statusbar.phone.NotificationPanelView)7 TreeSet (java.util.TreeSet)7