Package org.springframework.roo.project.maven

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


        // Set up
        @SuppressWarnings("unchecked")
        final List<Completion> mockCompletions = mock(List.class);
        when(mockProjectOperations.isFocusedProjectAvailable())
                .thenReturn(true);
        final Pom mockFocusedModule = mock(Pom.class);
        when(mockProjectOperations.getFocusedModule()).thenReturn(
                mockFocusedModule);
        final String topLevelPackage = "com.example";
        when(
                mockTypeLocationService
                        .getTopLevelPackageForModule(mockFocusedModule))
                .thenReturn(topLevelPackage);
        final String focusedModuleName = "web";
        when(mockFocusedModule.getModuleName()).thenReturn(focusedModuleName);
        final String modulePath = "/path/to/it";
        when(mockFocusedModule.getPath()).thenReturn(modulePath);
        final String otherModuleName = "core";
        when(mockProjectOperations.getModuleNames()).thenReturn(
                Arrays.asList(focusedModuleName, otherModuleName));
        final JavaType type1 = new JavaType("com.example.Foo");
        final JavaType type2 = new JavaType("com.example.sub.Bar");
View Full Code Here


    private void assertConvertFromValidText(final String text,
            final String optionContext, final String expectedPackage) {
        // Set up
        when(mockProjectOperations.isFocusedProjectAvailable())
                .thenReturn(true);
        final Pom mockPom = mock(Pom.class);
        when(mockProjectOperations.getFocusedModule()).thenReturn(mockPom);
        when(mockTypeLocationService.getTopLevelPackageForModule(mockPom))
                .thenReturn(TOP_LEVEL_PACKAGE);
        assertEquals(
                expectedPackage,
View Full Code Here

        converter.projectOperations = mockProjectOperations;
        converter.typeLocationService = mockTypeLocationService;
    }

    private Pom setUpMockPom(final String path, final JavaType... types) {
        final Pom mockPom = mock(Pom.class);
        when(mockPom.getPath()).thenReturn(path);
        when(mockTypeLocationService.getTypesForModule(mockPom)).thenReturn(
                Arrays.asList(types));
        return mockPom;
    }
View Full Code Here

    }

    @Test
    public void testGetAllPossibleValuesWhenProjectIsAvailable() {
        // Set up
        final Pom mockPom1 = setUpMockPom("/path/to/pom/1", new JavaType(
                "com.example.domain.Choice"), new JavaType(
                "com.example.domain.Vote"));
        final Pom mockPom2 = setUpMockPom("/path/to/pom/2", new JavaType(
                "com.example.web.ChoiceController"), new JavaType(
                "com.example.web.VoteController"));
        when(mockProjectOperations.getPoms()).thenReturn(
                Arrays.asList(mockPom1, mockPom2));
View Full Code Here

    public String getPhysicalTypeCanonicalPath(final String physicalTypeId) {
        final LogicalPath logicalPath = PhysicalTypeIdentifier
                .getPath(physicalTypeId);
        final JavaType javaType = PhysicalTypeIdentifier
                .getJavaType(physicalTypeId);
        final Pom pom = projectOperations.getPomFromModuleName(logicalPath
                .getModule());
        final String canonicalFilePath = pom.getPathLocation(logicalPath
                .getPath()) + javaType.getRelativeFileName();
        if (fileManager.exists(canonicalFilePath)) {
            typeCache.cacheTypeAgainstModule(pom, javaType);
            typeCache.cacheFilePathAgainstTypeIdentifier(canonicalFilePath,
                    physicalTypeId);
View Full Code Here

            return null;
        }
        final JavaType javaType = new JavaType(
                javaPackage.getFullyQualifiedPackageName() + "."
                        + simpleTypeName);
        final Pom module = projectOperations
                .getModuleForFileIdentifier(fileCanonicalPath);
        Validate.notNull(module, "The module for the file '"
                + fileCanonicalPath + "' could not be located");
        typeCache.cacheTypeAgainstModule(module, javaType);

        String reducedPath = fileCanonicalPath.replace(
                javaType.getRelativeFileName(), "");
        reducedPath = StringUtils.stripEnd(reducedPath, File.separator);

        for (final PhysicalPath physicalPath : module.getPhysicalPaths()) {
            if (physicalPath.getLocationPath().startsWith(reducedPath)) {
                final LogicalPath path = physicalPath.getLogicalPath();
                physicalTypeIdentifier = MetadataIdentificationUtils.create(
                        PhysicalTypeIdentifier.class.getName(), path.getName()
                                + "?" + javaType.getFullyQualifiedTypeName());
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.