Want more features on Pastebin? Sign Up, it's FREE!
Guest

ALR

By: a guest on Apr 14th, 2011  |  syntax: Java  |  size: 0.72 KB  |  views: 54  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     @Test
  2.     public void testExecutor() throws InterruptedException, IOException {
  3.         ConfigurationBuilder builder = new ConfigurationBuilder()
  4.                 .executorService(Executors.newFixedThreadPool(1));
  5.         ArchiveFactory factory = ShrinkWrap.createDomain(builder).getArchiveFactory();
  6.         // blow the pipe
  7.         factory.create(JavaArchive.class, "test.jar")
  8.             .add(MegaByteAsset.newInstance(), "dummy")
  9.             .as(ZipExporter.class)
  10.             .exportAsInputStream();
  11.  
  12.         InputStream in2 = factory.create(JavaArchive.class, "test2.jar")
  13.             .add(MegaByteAsset.newInstance(), "dummy")
  14.             .as(ZipExporter.class)
  15.             .exportAsInputStream();
  16.         in2.read();
  17.     }
clone this paste RAW Paste Data