Package org.hibernate.ejb.packaging

Examples of org.hibernate.ejb.packaging.InputStreamZippedJarVisitor


  public void testInputStreamZippedJar() throws Exception {
    String jarFileName = "file:./build/testresources/defaultpar.par";
    //JarVisitor jarVisitor = new ZippedJarVisitor( jarFileName, true, true );
    JarVisitor.Filter[] filters = getFilters();
    JarVisitor jarVisitor = new InputStreamZippedJarVisitor( new URL( jarFileName ), filters );
    assertEquals( "defaultpar", jarVisitor.getUnqualifiedJarName() );
    Set entries = jarVisitor.getMatchingEntries()[1];
    assertEquals( 3, entries.size() );
    JarVisitor.Entry entry = new JarVisitor.Entry( ApplicationServer.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    entry = new JarVisitor.Entry( org.hibernate.ejb.test.pack.defaultpar.Version.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    assertNull( ( (JarVisitor.Entry) entries.iterator().next() ).getInputStream() );
    assertEquals( 2, jarVisitor.getMatchingEntries()[2].size() );
    for (JarVisitor.Entry localEntry : (Set<JarVisitor.Entry>) jarVisitor.getMatchingEntries()[2] ) {
      assertNotNull( localEntry.getInputStream() );
      localEntry.getInputStream().close();
    }

//    Set<String> classes = jarVisitor.getClassNames();
View Full Code Here


  public void testInputStreamZippedJar() throws Exception {
    File defaultPar = buildDefaultPar();
    addPackageToClasspath( defaultPar );

    Filter[] filters = getFilters();
    JarVisitor jarVisitor = new InputStreamZippedJarVisitor( defaultPar.toURL(), filters, "" );
    assertEquals( "defaultpar", jarVisitor.getUnqualifiedJarName() );
    Set entries = jarVisitor.getMatchingEntries()[1];
    assertEquals( 3, entries.size() );
    Entry entry = new Entry( ApplicationServer.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    entry = new Entry( org.hibernate.ejb.test.pack.defaultpar.Version.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    assertNull( ( ( Entry ) entries.iterator().next() ).getInputStream() );
    assertEquals( 2, jarVisitor.getMatchingEntries()[2].size() );
    for ( Entry localEntry : ( Set<Entry> ) jarVisitor.getMatchingEntries()[2] ) {
      assertNotNull( localEntry.getInputStream() );
      localEntry.getInputStream().close();
    }
  }
View Full Code Here

  public void testInputStreamZippedJar() throws Exception {
    String jarFileName = "file:./target/test-packages/defaultpar.par";
    //JarVisitor jarVisitor = new ZippedJarVisitor( jarFileName, true, true );
    Filter[] filters = getFilters();
    JarVisitor jarVisitor = new InputStreamZippedJarVisitor( new URL( jarFileName ), filters, "" );
    assertEquals( "defaultpar", jarVisitor.getUnqualifiedJarName() );
    Set entries = jarVisitor.getMatchingEntries()[1];
    assertEquals( 3, entries.size() );
    Entry entry = new Entry( ApplicationServer.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    entry = new Entry( org.hibernate.ejb.test.pack.defaultpar.Version.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    assertNull( ( (Entry) entries.iterator().next() ).getInputStream() );
    assertEquals( 2, jarVisitor.getMatchingEntries()[2].size() );
    for (Entry localEntry : (Set<Entry>) jarVisitor.getMatchingEntries()[2] ) {
      assertNotNull( localEntry.getInputStream() );
      localEntry.getInputStream().close();
    }
  }
View Full Code Here

  public void testInputStreamZippedJar() throws Exception {
    String jarFileName = "file:./build/testresources/defaultpar.par";
    //JarVisitor jarVisitor = new ZippedJarVisitor( jarFileName, true, true );
    Filter[] filters = getFilters();
    JarVisitor jarVisitor = new InputStreamZippedJarVisitor( new URL( jarFileName ), filters, "" );
    assertEquals( "defaultpar", jarVisitor.getUnqualifiedJarName() );
    Set entries = jarVisitor.getMatchingEntries()[1];
    assertEquals( 3, entries.size() );
    Entry entry = new Entry( ApplicationServer.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    entry = new Entry( org.hibernate.ejb.test.pack.defaultpar.Version.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    assertNull( ( (Entry) entries.iterator().next() ).getInputStream() );
    assertEquals( 2, jarVisitor.getMatchingEntries()[2].size() );
    for (Entry localEntry : (Set<Entry>) jarVisitor.getMatchingEntries()[2] ) {
      assertNotNull( localEntry.getInputStream() );
      localEntry.getInputStream().close();
    }
  }
View Full Code Here

  public void testInputStreamZippedJar() throws Exception {
    String jarFileName = "file:./target/test-packages/defaultpar.par";
    //JarVisitor jarVisitor = new ZippedJarVisitor( jarFileName, true, true );
    Filter[] filters = getFilters();
    JarVisitor jarVisitor = new InputStreamZippedJarVisitor( new URL( jarFileName ), filters, "" );
    assertEquals( "defaultpar", jarVisitor.getUnqualifiedJarName() );
    Set entries = jarVisitor.getMatchingEntries()[1];
    assertEquals( 3, entries.size() );
    Entry entry = new Entry( ApplicationServer.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    entry = new Entry( org.hibernate.ejb.test.pack.defaultpar.Version.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    assertNull( ( (Entry) entries.iterator().next() ).getInputStream() );
    assertEquals( 2, jarVisitor.getMatchingEntries()[2].size() );
    for (Entry localEntry : (Set<Entry>) jarVisitor.getMatchingEntries()[2] ) {
      assertNotNull( localEntry.getInputStream() );
      localEntry.getInputStream().close();
    }
  }
View Full Code Here

  public void testInputStreamZippedJar() throws Exception {
    String jarFileName = "file:./target/test-packages/defaultpar.par";
    //JarVisitor jarVisitor = new ZippedJarVisitor( jarFileName, true, true );
    Filter[] filters = getFilters();
    JarVisitor jarVisitor = new InputStreamZippedJarVisitor( new URL( jarFileName ), filters, "" );
    assertEquals( "defaultpar", jarVisitor.getUnqualifiedJarName() );
    Set entries = jarVisitor.getMatchingEntries()[1];
    assertEquals( 3, entries.size() );
    Entry entry = new Entry( ApplicationServer.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    entry = new Entry( org.hibernate.ejb.test.pack.defaultpar.Version.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    assertNull( ( (Entry) entries.iterator().next() ).getInputStream() );
    assertEquals( 2, jarVisitor.getMatchingEntries()[2].size() );
    for (Entry localEntry : (Set<Entry>) jarVisitor.getMatchingEntries()[2] ) {
      assertNotNull( localEntry.getInputStream() );
      localEntry.getInputStream().close();
    }
  }
View Full Code Here

  public void testInputStreamZippedJar() throws Exception {
    String jarFileName = "file:./build/testresources/defaultpar.par";
    //JarVisitor jarVisitor = new ZippedJarVisitor( jarFileName, true, true );
    Filter[] filters = getFilters();
    JarVisitor jarVisitor = new InputStreamZippedJarVisitor( new URL( jarFileName ), filters, "" );
    assertEquals( "defaultpar", jarVisitor.getUnqualifiedJarName() );
    Set entries = jarVisitor.getMatchingEntries()[1];
    assertEquals( 3, entries.size() );
    Entry entry = new Entry( ApplicationServer.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    entry = new Entry( org.hibernate.ejb.test.pack.defaultpar.Version.class.getName(), null );
    assertTrue( entries.contains( entry ) );
    assertNull( ( (Entry) entries.iterator().next() ).getInputStream() );
    assertEquals( 2, jarVisitor.getMatchingEntries()[2].size() );
    for (Entry localEntry : (Set<Entry>) jarVisitor.getMatchingEntries()[2] ) {
      assertNotNull( localEntry.getInputStream() );
      localEntry.getInputStream().close();
    }

//    Set<String> classes = jarVisitor.getClassNames();
View Full Code Here

TOP

Related Classes of org.hibernate.ejb.packaging.InputStreamZippedJarVisitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.