JarVisitor jarVisitor = new JarProtocolVisitor( new URL( jarFileName ), filters, "" );
//TODO should we fix the name here to reach defaultpar rather than nestedjar ??
//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();
}
jarFileName = "jar:file:./target/test-packages/nesteddir.ear!/defaultpar.par";
//JarVisitor jarVisitor = new ZippedJarVisitor( jarFileName, true, true );
filters = getFilters();
jarVisitor = new JarProtocolVisitor( new URL( jarFileName ), filters, "" );
//TODO should we fix the name here to reach defaultpar rather than nestedjar ??
//assertEquals( "defaultpar", jarVisitor.getUnqualifiedJarName() );
entries = jarVisitor.getMatchingEntries()[1];
assertEquals( 3, entries.size() );
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() );