Package org.jboss.shrinkwrap.api

Examples of org.jboss.shrinkwrap.api.GenericArchive


               CreateContainerOptions.NONE);
         if (!created) {
            deleteAllObjectsInContainer(regionId, containerName);
         }
      }
      GenericArchive files = ShrinkWrap.create(GenericArchive.class, "files.tar.gz");
      StringAsset content = new StringAsset("foo");
      for (int i = 0; i < OBJECT_COUNT; i++) {
         paths.add(containerName + "/file" + i);
         files.add(content, "/file" + i);
      }
      try {
         tarGz = ByteStreams.toByteArray(files.as(TarGzExporter.class).exportAsInputStream());
      } catch (IOException e) {
         throw Throwables.propagate(e);
      }
   }
View Full Code Here


@Test(groups = "unit", testName = "BulkApiMockTest")
public class BulkApiMockTest extends BaseOpenStackMockTest<SwiftApi> {

   public void testExtractArchive() throws Exception {
      GenericArchive files = ShrinkWrap.create(GenericArchive.class, "files.tar.gz");
      StringAsset content = new StringAsset("foo");
      for (int i = 0; i < 10; i++) {
         files.add(content, "/file" + i);
      }
      byte[] tarGz = ByteStreams.toByteArray(files.as(TarGzExporter.class).exportAsInputStream());

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));
View Full Code Here

         boolean created = api.getContainerApiForRegion(regionId).create(containerName);
         if (!created) {
            deleteAllObjectsInContainer(regionId, containerName);
         }
      }
      GenericArchive files = ShrinkWrap.create(GenericArchive.class, "files.tar.gz");
      StringAsset content = new StringAsset("foo");
      for (int i = 0; i < OBJECT_COUNT; i++) {
         paths.add(containerName + "/file" + i);
         files.add(content, "/file" + i);
      }

      try {
         tarGz = ByteSources.asByteSource(files.as(TarGzExporter.class).exportAsInputStream()).read();
      } catch (IOException e) {
         throw Throwables.propagate(e);
      }
   }
View Full Code Here

@Test(groups = "unit", testName = "BulkApiMockTest")
public class BulkApiMockTest extends BaseOpenStackMockTest<SwiftApi> {

   public void testExtractArchive() throws Exception {
      GenericArchive files = ShrinkWrap.create(GenericArchive.class, "files.tar.gz");
      StringAsset content = new StringAsset("foo");
      for (int i = 0; i < 10; i++) {
         files.add(content, "/file" + i);
      }

      byte[] tarGz = ByteSources.asByteSource(files.as(TarGzExporter.class).exportAsInputStream()).read();

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));
View Full Code Here

public class NoteResourceImplTest {

    @Deployment
    public static Archive createDeployment()
    {
        final GenericArchive webResources = ShrinkWrap.create(GenericArchive.class)
            .as(ExplodedImporter.class)
            .importDirectory("src/main/webapp")
            .as(GenericArchive.class);
        final File[] seleniumApi = Maven.resolver()
            .loadPomFromFile("pom.xml")
View Full Code Here

      {
         for (ArchivePath path : nestedArchives.keySet())
         {
            try
            {
               GenericArchive genericArchive = archive.getAsType(GenericArchive.class, path);
               if (genericArchive != null && Testable.isArchiveToTest(genericArchive))
               {
                  return genericArchive;
               }
            }
View Full Code Here

        // Remove this hack. It shouldbe possible to use the shrinkwrap maven resolver
        boolean useShrinkwrap = System.getProperty("shrinkwrap.resolver") != null;

        for (MavenCoordinates artefact : configuration.getMavenCoordinates()) {
            File zipfile = useShrinkwrap ? shrinkwrapResolve(artefact) : localResolve(artefact);
            GenericArchive archive = ShrinkWrap.createFromZipFile(GenericArchive.class, zipfile);
            ExplodedExporter exporter = archive.as(ExplodedExporter.class);
            File targetdir = configuration.getTargetDirectory();
            if (!targetdir.isDirectory() && !targetdir.mkdirs())
                throw new IllegalStateException("Cannot create target dir: " + targetdir);

            if (containerHome == null) {
View Full Code Here

         {
            for (ArchivePath path : nested.keySet())
            {
               try
               {
                  GenericArchive genericArchive = applicationArchive.getAsType(GenericArchive.class, path);
                  if (Testable.isArchiveToTest(genericArchive))
                  {
                     if (archiveForEnrichment != null)
                     {
                        throw new UnsupportedOperationException("Multiple marked Archives found in "
View Full Code Here

         boolean created = api.getContainerApiForRegion(regionId).create(containerName);
         if (!created) {
            deleteAllObjectsInContainer(regionId, containerName);
         }
      }
      GenericArchive files = ShrinkWrap.create(GenericArchive.class, "files.tar.gz");
      StringAsset content = new StringAsset("foo");
      for (int i = 0; i < OBJECT_COUNT; i++) {
         paths.add(containerName + "/file" + i);
         files.add(content, "/file" + i);
      }

      try {
         tarGz = ByteStreams2.toByteArrayAndClose(files.as(TarGzExporter.class).exportAsInputStream());
      } catch (IOException e) {
         throw Throwables.propagate(e);
      }
   }
View Full Code Here

@Test(groups = "unit", testName = "BulkApiMockTest")
public class BulkApiMockTest extends BaseOpenStackMockTest<SwiftApi> {

   public void testExtractArchive() throws Exception {
      GenericArchive files = ShrinkWrap.create(GenericArchive.class, "files.tar.gz");
      StringAsset content = new StringAsset("foo");
      for (int i = 0; i < 10; i++) {
         files.add(content, "/file" + i);
      }

      byte[] tarGz = ByteStreams2.toByteArrayAndClose(files.as(TarGzExporter.class).exportAsInputStream());

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.api.GenericArchive

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.