Detailed description is in upstream jira issue. https://issues.jboss.org/browse/SHRINKWRAP-444
This is a tracking issues for eventual ShrinkWrap update to WFK 2.3.0. It does not affect any of the WFK releases out there.
Karel Piwko <kpiwko> made a comment on jira SHRINKWRAP-444 [~mmatloka] here is a SHRINKWRAP-433 related bug you asked for.
Michal Matloka <mmatloka> made a comment on jira SHRINKWRAP-444 I was able to reproduce bug (on jboss-as 7.1.3). The following test passes: {code} @RunWith(Arquillian.class) public class MyWorkingTest { @Deployment public static WebArchive createDeployment() { return ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar"); } @Test public void empty() { } } {code} And the following does not: {code} @RunWith(Arquillian.class) public class MyNotWorkingTest { @Deployment public static WebArchive createDeployment() { ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar").as(ZipExporter.class).exportTo(new File("target\\testABC.war"), true); return ShrinkWrap.createFromZipFile(WebArchive.class, new File("target\\testABC.war")); } @Test public void empty() { } } {code} But manual deployment of testABC.war produced during second test does work, so problem lies probably somewhere around createFromZipFile.
Michal Matloka <mmatloka> made a comment on jira SHRINKWRAP-444 I was able to reproduce bug (on jboss-as 7.1.3). The following test passes: {code} @RunWith(Arquillian.class) public class MyWorkingTest { @Deployment public static WebArchive createDeployment() { return ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar"); } @Test public void empty() { } } {code} And the following does not: {code} @RunWith(Arquillian.class) public class MyNotWorkingTest { @Deployment public static WebArchive createDeployment() { ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar").as(ZipExporter.class).exportTo(new File("target\\testABC.war"), true); return ShrinkWrap.createFromZipFile(WebArchive.class, new File("target\\testABC.war")); } @Test public void empty() { } } {code} But manual deployment of testABC.war produced during second test does work, so problem lies probably somewhere around createFromZipFile. {code} ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar").as(ZipExporter.class).exportTo(new File("target\\testABC.war"), true); ShrinkWrap.createFromZipFile(WebArchive.class, new File("target\\testABC.war")).exportTo(new File("target\\testABC2.war"), true); {code} testABC.war has 653KB testABC2.war has 9KB
Michal Matloka <mmatloka> made a comment on jira SHRINKWRAP-444 Sorry, my fault. Some types of streams can return less bytes than bufffer can handle, even if there are more data to be returned on next read.
Andrew Rubinger <jboss> made a comment on jira SHRINKWRAP-444 Good job, Michal. Though your sample is just a bit broken on *nix filesystems; I'll fix it up and push upstream.
Andrew Rubinger <jboss> made a comment on jira SHRINKWRAP-444 Upstream: https://github.com/shrinkwrap/shrinkwrap/commit/d6ba91e868e3e54d0316c38ba7e95b70822fe3fa and https://github.com/shrinkwrap/shrinkwrap/commit/b2a7dd7324538ce8132a942f576dbc37f49c9b30
Andrew Rubinger <jboss> updated the status of jira SHRINKWRAP-444 to Closed
verified in shrinkwrap-1.1.2