Package org.jboss.shrinkwrap.api

Examples of org.jboss.shrinkwrap.api.ArchivePath


    private class Deployment extends AbstractDeployment {
        final File realArchive;

        public Deployment(String archiveName, Package[] pkgs, boolean show) {

            ArchivePath metaInf = ArchivePaths.create("META-INF");

            JavaArchive archive = ShrinkWrap.create(JavaArchive.class, archiveName);
            for(Package pkg : pkgs) {
                archive.addPackage(pkg);
            }
View Full Code Here


    private class WarDeployment extends AbstractDeployment {
        final File realArchive;

        public WarDeployment(String archiveName, Package[] pkgs, boolean show) {

            ArchivePath metaInf = ArchivePaths.create("META-INF");


            WebArchive archive = ShrinkWrap.create(WebArchive.class, archiveName);
            for(Package pkg : pkgs) {
                archive.addPackage(pkg);
View Full Code Here

          //if (!archive.contains(webXmlPath))
          //{
          //   // sets the module name to "test"
          //   ((WebArchive) archive).setWebXML("org/jboss/arquillian/container/glassfish/remote_3/web.xml");
          //}
          ArchivePath sunWebXmlPath = ArchivePaths.create("/WEB-INF/sun-web.xml");
          if (!archive.contains(sunWebXmlPath))
          {
             // sets the module name to "test"
             WebArchive.class.cast(archive).addWebResource("org/jboss/arquillian/container/glassfish/remote_3/sun-web.xml", "sun-web.xml");
          }
View Full Code Here

   private Archive<?> handleArchive(EnterpriseArchive applicationArchive, Collection<Archive<?>> auxiliaryArchives, WebArchive protocol, Processor processor)
   {
      Map<ArchivePath, Node> applicationArchiveWars = applicationArchive.getContent(Filters.include(".*\\.war"));
      if(applicationArchiveWars.size() == 1)
      {
         ArchivePath warPath = applicationArchiveWars.keySet().iterator().next();
         try
         {
            handleArchive(
                  applicationArchive.getAsType(WebArchive.class, warPath),
                  new ArrayList<Archive<?>>(), // reuse the War handling, but Auxiliary Archives should be added to the EAR, not the WAR
View Full Code Here

                    // Actually the performace loss is caused by inner classes
                    // handling - which is not necessary here
                    // See also
                    // org.jboss.shrinkwrap.impl.base.container.ContainerBase
                    // addPackage() and getClassesPath() methods
                    ArchivePath classesPath = resolveClassesPath(archive);

                    if (classesPath != null) {
                        ArchivePath classNamePath = AssetUtil.getFullPathForClassResource(className);
                        archive.add(new ClassLoaderAsset(classNamePath.get().substring(1), clToUse),
                                ArchivePaths.create(classesPath, classNamePath));
                    } else {
                        archive.addClass(className);
                    }
                }
View Full Code Here

                if (classesPackage == null) {
                    classesPackage = clazz.getPackage();
                }
                Asset resource = new ClassAsset(clazz);
                ArchivePath location = ArchivePaths.create(resolveClassesPath(archive),
                        AssetUtil.getFullPathForClassResource(clazz));
                archive.add(resource, location);
            }

            // Quite naive way of handling inner classes
View Full Code Here

            // Arquillian generates auxiliary archives that aren't bundles
            // auxArchives.clear();
            merge(appArchive, auxArchives);
        } else {
            if (appArchive instanceof WebArchive) {
                final ArchivePath webInfLib = ArchivePaths.create("WEB-INF", "lib");
                for (Archive<?> aux : auxArchives) {
                    // we don't want to include the arquillian-core.jar and arquillian-junit.jar
                    // auxillary archives, as these are already part of the container
                    if (!excludedAuxillaryArchives.contains(aux.getName())) {
                        appArchive.add(aux, webInfLib);
View Full Code Here

            }
        }
        attributes.putValue("Dependencies", moduleDeps.toString());

        // Add the manifest to the archive
        ArchivePath path = ArchivePaths.create("META-INF", "MANIFEST.MF");
        appArchive.add(new Asset() {
                public InputStream openStream() {
                    try {
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        manifest.write(baos);
View Full Code Here

     * @see {@link ByteAssetClassNotFoundException}
     */
    @Override
    protected Class<?> findClass(String name) throws ClassNotFoundException {

        ArchivePath path = type.asArchivePath(name);

        if (!archive.contains(path)) {
            throw new ByteAssetClassNotFoundException("Unable to find class " + name + " in archive " + archive.getName());
        }

View Full Code Here

        ArchiveStreamHandler.set(ar, prefix, closeables);
    }

    @Override
    protected Enumeration<URL> findResources(final String name) throws IOException {
        ArchivePath path = ArchivePaths.create(prefix + name);
        Node node = archive.get(path);
        if (node == null) {
            path = ArchivePaths.create(name);
            node = archive.get(path);
View Full Code Here

TOP

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

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.