Package org.springframework.roo.project.maven

Examples of org.springframework.roo.project.maven.Pom


    @Test
    public void testGetFocusedModuleWhenChildModuleHasFocus() {
        // Set up
        when(mockPomManagementService.getFocusedModuleName()).thenReturn(
                "child");
        final Pom mockChildPom = mock(Pom.class);
        final ProjectMetadata mockChildMetadata = mock(ProjectMetadata.class);
        when(mockChildMetadata.getPom()).thenReturn(mockChildPom);
        when(
                mockMetadataService.get(ProjectMetadata
                        .getProjectIdentifier("child"))).thenReturn(
View Full Code Here


        when(mockDependency.getType()).thenReturn(DependencyType.JAR);
        when(mockDependency.getVersion()).thenReturn(VERSION);
        when(mockMetadataService.get(ProjectMetadata.getProjectIdentifier("")))
                .thenReturn(mockProjectMetadata);

        final Pom pom = mock(Pom.class);
        when(pom.getPath()).thenReturn(POM_PATH);
        when(mockProjectMetadata.getPom()).thenReturn(pom);

        final Collection<Dependency> dependencies = Arrays.asList(
                mockDependency, mockDependency);
        when(pom.isAnyDependenciesRegistered(dependencies)).thenReturn(true);
        when(pom.isDependencyRegistered(mockDependency)).thenReturn(true);

        // Invoke
        projectOperations.removeDependencies("", dependencies);

        // Check
View Full Code Here

    public String getName() {
        return FeatureNames.GAE;
    }

    public boolean isInstalledInModule(final String moduleName) {
        final Pom pom = projectOperations.getPomFromModuleName(moduleName);
        if (pom == null) {
            return false;
        }
        for (final Plugin buildPlugin : pom.getBuildPlugins()) {
            if ("appengine-maven-plugin".equals(buildPlugin.getArtifactId())) {
                return true;
            }
        }
        return false;
View Full Code Here

    public String getName() {
        return FeatureNames.DATABASE_DOT_COM;
    }

    public boolean isInstalledInModule(final String moduleName) {
        final Pom pom = projectOperations.getPomFromModuleName(moduleName);
        if (pom == null) {
            return false;
        }
        for (final Plugin buildPlugin : pom.getBuildPlugins()) {
            if ("com.force.sdk".equals(buildPlugin.getArtifactId())) {
                return true;
            }
        }
        return false;
View Full Code Here

        when(mockModulePath.getLogicalPath()).thenReturn(logicalPath);
        return mockModulePath;
    }

    private Pom getMockPom(final String rootPath) {
        final Pom mockPom = mock(Pom.class);
        when(mockPom.getRoot()).thenReturn(rootPath);
        return mockPom;
    }
View Full Code Here

    private void setUpModulePaths() {
        final PhysicalPath mockModuleSourcePath = getMockModulePath(true,
                mockSourcePath);
        final PhysicalPath mockModuleNonSourcePath = getMockModulePath(false,
                mockNonSourcePath);
        final Pom mockPom = mock(Pom.class);
        when(mockPom.getPhysicalPaths()).thenReturn(
                Arrays.asList(mockModuleSourcePath, mockModuleNonSourcePath));
        when(mockPomManagementService.getPoms()).thenReturn(
                Arrays.asList(mockPom));
    }
View Full Code Here

                modulePathIds);
    }

    @Test
    public void testGetIdentifierForNewModuleWithEmptyRelativePath() {
        final Pom mockParentPom = getMockPom(POM_PATH);
        when(mockPomManagementService.getFocusedModule()).thenReturn(
                mockParentPom);
        final String expectedIdentifier = FileUtils.getSystemDependentPath(
                POM_PATH, NEW_MODULE, PATH_RELATIVE_TO_POM) + File.separator;
        assertIdentifier(null, NEW_MODULE, "", expectedIdentifier);
View Full Code Here

        return dependencies;
    }

    private JsfImplementation getExistingOrDefaultJsfImplementation(
            final Element configuration) {
        final Pom pom = projectOperations
                .getPomFromModuleName(projectOperations.getFocusedModuleName());
        JsfImplementation existingJsfImplementation = null;
        for (final JsfImplementation value : JsfImplementation.values()) {
            final Element jsfDependencyElement = XmlUtils.findFirstElement(
                    JSF_IMPLEMENTATION_XPATH + "[@id = '" + value.name() + "']"
                            + DEPENDENCY_XPATH, configuration);
            if (jsfDependencyElement != null
                    && pom.isDependencyRegistered(new Dependency(
                            jsfDependencyElement))) {
                existingJsfImplementation = value;
                break;
            }
        }
View Full Code Here

                : existingJsfImplementation;
    }

    private JsfLibrary getExistingOrDefaultJsfLibrary(
            final Element configuration) {
        final Pom pom = projectOperations
                .getPomFromModuleName(projectOperations.getFocusedModuleName());
        JsfLibrary existingJsfImplementation = null;
        for (final JsfLibrary value : JsfLibrary.values()) {
            final Element jsfDependencyElement = XmlUtils.findFirstElement(
                    JSF_LIBRARY_XPATH + "[@id = '" + value.name() + "']"
                            + DEPENDENCY_XPATH, configuration);
            if (jsfDependencyElement != null
                    && pom.isDependencyRegistered(new Dependency(
                            jsfDependencyElement))) {
                existingJsfImplementation = value;
                break;
            }
        }
View Full Code Here

                    final Element rootElement = XmlUtils
                            .stringToElement(pomContents);
                    resolvePoms(rootElement, pathToChangedPom, pomModuleMap);
                    final String moduleName = getModuleName(FileUtils
                            .getFirstDirectory(pathToChangedPom));
                    final Pom pom = pomFactory.getInstance(rootElement,
                            pathToChangedPom, moduleName);
                    Validate.notNull(pom,
                            "POM is null for module '%s' and path '%s'",
                            moduleName, pathToChangedPom);
                    pomMap.put(pathToChangedPom, pom);
View Full Code Here

TOP

Related Classes of org.springframework.roo.project.maven.Pom

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.