Package org.apache.geronimo.deployment.xbeans

Examples of org.apache.geronimo.deployment.xbeans.DependencyType


        assertEquals(1, parentId.size());
        assertEquals("import", ((URI)parentId.get(0)).getPath());
    }

    public void testImportParent2() throws Exception {
        DependencyType anImport = DependencyType.Factory.newInstance();
        anImport.setGroupId("groupId");
        anImport.setType("type");
        anImport.setArtifactId("artifactId");
        anImport.setVersion("version");
        List parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {anImport});
        assertEquals(1, parentId.size());
        assertEquals("groupId/types/artifactId-version.type", ((URI)parentId.get(0)).getPath());
    }
View Full Code Here


        assertEquals(1, parentId.size());
        assertEquals("groupId/types/artifactId-version.type", ((URI)parentId.get(0)).getPath());
    }

    public void testBothParent() throws Exception {
        DependencyType import1 = DependencyType.Factory.newInstance();
        import1.setUri("import1");
        DependencyType import2 = DependencyType.Factory.newInstance();
        import2.setUri("import2");
        List parentId = ServiceConfigBuilder.getParentID("attribute", new DependencyType[] {import1, import2});
        assertEquals(3, parentId.size());
        assertEquals("attribute", ((URI)parentId.get(0)).getPath());
        assertEquals("import1", ((URI)parentId.get(1)).getPath());
        assertEquals("import2", ((URI)parentId.get(2)).getPath());
View Full Code Here

            }
        } else if (imports.length == 0) {
            return new ArrayList();
        }
        for (int i = 0; i < imports.length; i++) {
            DependencyType anImport = imports[i];
            URI parentURI = getDependencyURI(anImport);
            uris.add(parentURI);
        }
        return uris;
    }
View Full Code Here

        return uris;
    }

    public static void addIncludes(DeploymentContext context, DependencyType[] includes, Repository repository) throws DeploymentException {
        for (int i = 0; i < includes.length; i++) {
            DependencyType include = includes[i];
            URI uri = getDependencyURI(include, repository);
            String name = uri.toString();
            int idx = name.lastIndexOf('/');
            if (idx != -1) {
                name = name.substring(idx + 1);
View Full Code Here

            artifactType.setType(artifact.getType());
        }
    }

    private static DependencyType toDependencyType(Dependency dependency) {
        DependencyType dependencyType = DependencyType.Factory.newInstance();
        fillArtifactType(dependency.getArtifact(), dependencyType);

        org.apache.geronimo.kernel.repository.ImportType importType = dependency.getImportType();
        if (importType == org.apache.geronimo.kernel.repository.ImportType.CLASSES) {
            dependencyType.setImport(ImportType.CLASSES);
        } else if (importType == org.apache.geronimo.kernel.repository.ImportType.SERVICES) {
            dependencyType.setImport(ImportType.SERVICES);
        }

        return dependencyType;
    }
View Full Code Here

    }

    private static LinkedHashSet toDependencies(DependencyType[] dependencyArray) {
        LinkedHashSet dependencies = new LinkedHashSet();
        for (int i = 0; i < dependencyArray.length; i++) {
            DependencyType artifactType = dependencyArray[i];
            Dependency dependency = toDependency(artifactType);
            dependencies.add(dependency);
        }
        return dependencies;
    }
View Full Code Here

            artifactType.setType(artifact.getType());
        }
    }

    private static DependencyType toDependencyType(Dependency dependency) {
        DependencyType dependencyType = DependencyType.Factory.newInstance();
        fillArtifactType(dependency.getArtifact(), dependencyType);

        org.apache.geronimo.kernel.repository.ImportType importType = dependency.getImportType();
        if (importType == org.apache.geronimo.kernel.repository.ImportType.CLASSES) {
            dependencyType.setImport(ImportType.CLASSES);
        } else if (importType == org.apache.geronimo.kernel.repository.ImportType.SERVICES) {
            dependencyType.setImport(ImportType.SERVICES);
        }

        return dependencyType;
    }
View Full Code Here

    }

    private static LinkedHashSet toDependencies(DependencyType[] dependencyArray) {
        LinkedHashSet dependencies = new LinkedHashSet();
        for (int i = 0; i < dependencyArray.length; i++) {
            DependencyType artifactType = dependencyArray[i];
            Dependency dependency = toDependency(artifactType);
            dependencies.add(dependency);
        }
        return dependencies;
    }
View Full Code Here

            artifactType.setType(artifact.getType());
        }
    }

    private static DependencyType toDependencyType(Dependency dependency) {
        DependencyType dependencyType = DependencyType.Factory.newInstance();
        fillArtifactType(dependency.getArtifact(), dependencyType);

        org.apache.geronimo.kernel.repository.ImportType importType = dependency.getImportType();
        if (importType == org.apache.geronimo.kernel.repository.ImportType.CLASSES) {
            dependencyType.setImport(ImportType.CLASSES);
        } else if (importType == org.apache.geronimo.kernel.repository.ImportType.SERVICES) {
            dependencyType.setImport(ImportType.SERVICES);
        }

        return dependencyType;
    }
View Full Code Here

    }

    private static LinkedHashSet toDependencies(DependencyType[] dependencyArray) {
        LinkedHashSet dependencies = new LinkedHashSet();
        for (int i = 0; i < dependencyArray.length; i++) {
            DependencyType artifactType = dependencyArray[i];
            Dependency dependency = toDependency(artifactType);
            dependencies.add(dependency);
        }
        return dependencies;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.xbeans.DependencyType

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.