public String getCanonicalPath(final String moduleName, final Path path, final JavaType javaType) { Validate.notNull(moduleName, "Module name is null"); return getCanonicalPath(path.getModulePathId(moduleName), javaType); }
private PhysicalPath getModulePath(final String moduleName, final String moduleRoot, final Pom pom) { return new PhysicalPath(getModulePathId(moduleName), new File(moduleRoot, getPathRelativeToPom(pom))); }
public String getProjectRoot() { return pathResolver.getRoot(Path.ROOT.getModulePathId(pomManagementService .getFocusedModuleName())); }
private void addAddonsDependencies(Document pom, String folder, JavaPackage topLevelPackage) { projectOperations.getPathResolver().getIdentifier(Path.ROOT.getModulePathId(""), folder + "/pom.xml");
getPathResolver().getIdentifier(Path.ROOT.getModulePathId(module), "pom.xml"); getFileManager().createOrUpdateTextFileIfRequired(pomPath, XmlUtils.nodeToString(pom), true); return pomPath;
@Override public void createUnitTest(final JavaType entity) { Validate.notNull(entity, "Class to produce an unit test class for is required"); // Check if provided JavaType is a Repository ClassOrInterfaceTypeDetails cid = typeLocationService.getTypeDetails(entity); Validate.notNull(cid.getAnnotation(RooJavaType.ROO_JPA_ENTITY), "Type must be a Roo JPA Entity type."); // Create JPA DataOnDemand artifacts List<DataOnDemandCreatorProvider> dodCreators = getValidDataOnDemandCreatorsForType(entity); for (DataOnDemandCreatorProvider dodCreator : dodCreators) { dodCreator.createDataOnDemand(entity); } final JavaType name = new JavaType(entity + "Test", entity.getModule()); final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(entity.getModule())); if (metadataService.get(declaredByMetadataId) != null) { // The file already exists return; } // Add @RooUnitTest to source file AnnotationMetadataBuilder rooUnitTestAnnotation = new AnnotationMetadataBuilder(RooJavaType.ROO_JPA_UNIT_TEST); rooUnitTestAnnotation.addClassAttribute("targetClass", entity); final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(declaredByMetadataId, Modifier.PUBLIC, name, PhysicalTypeCategory.CLASS); cidBuilder.addAnnotation(rooUnitTestAnnotation); typeManagementService.createOrUpdateTypeOnDisk(cidBuilder.build()); }
final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(module.getModuleName())); if (metadataService.get(declaredByMetadataId) != null) {
final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(module.getModuleName())); if (metadataService.get(declaredByMetadataId) != null) {
final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(module.getModuleName())); if (metadataService.get(declaredByMetadataId) != null) {
private Connection getConnection(final boolean displayAddOns) { final String dbProps = "database.properties"; final String jndiDataSource = getJndiDataSourceName(); if (StringUtils.isNotBlank(jndiDataSource)) { final Map<String, String> props = propFileOperations.getProperties( Path.SPRING_CONFIG_ROOT.getModulePathId(projectOperations .getFocusedModuleName()), "jndi.properties"); return connectionProvider.getConnectionViaJndiDataSource( jndiDataSource, props, displayAddOns); } else if (fileManager.exists(projectOperations.getPathResolver() .getFocusedIdentifier(Path.SPRING_CONFIG_ROOT, dbProps))) { final Map<String, String> props = propFileOperations.getProperties( Path.SPRING_CONFIG_ROOT.getModulePathId(projectOperations .getFocusedModuleName()), dbProps); return connectionProvider.getConnection(props, displayAddOns); } final Properties connectionProperties = getConnectionPropertiesFromDataNucleusConfiguration(); return connectionProvider.getConnection(connectionProperties, displayAddOns); }
final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(projectType.getModule()));
final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(module.getModuleName()));
@Override public void createUnitTest(final JavaType entity) { Validate.notNull(entity, "Class to produce an unit test class for is required"); // Check if provided JavaType is a Repository ClassOrInterfaceTypeDetails cid = typeLocationService.getTypeDetails(entity); Validate.notNull(cid.getAnnotation(RooJavaType.ROO_JPA_ENTITY), "Type must be a Roo JPA Entity type."); // Create JPA DataOnDemand artifacts List<DataOnDemandCreatorProvider> dodCreators = getValidDataOnDemandCreatorsForType(entity); for (DataOnDemandCreatorProvider dodCreator : dodCreators) { dodCreator.createDataOnDemand(entity); } final JavaType name = new JavaType(entity + "Test", entity.getModule()); final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(entity.getModule())); if (metadataService.get(declaredByMetadataId) != null) { // The file already exists return; } // Add @RooUnitTest to source file AnnotationMetadataBuilder rooUnitTestAnnotation = new AnnotationMetadataBuilder(RooJavaType.ROO_JPA_UNIT_TEST); rooUnitTestAnnotation.addClassAttribute("targetClass", entity); final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(declaredByMetadataId, Modifier.PUBLIC, name, PhysicalTypeCategory.CLASS); cidBuilder.addAnnotation(rooUnitTestAnnotation); typeManagementService.createOrUpdateTypeOnDisk(cidBuilder.build()); }
final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(projectType.getModule()));
final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(module.getModuleName())); if (metadataService.get(declaredByMetadataId) != null) {
final String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_TEST_JAVA.getModulePathId(module.getModuleName())); if (metadataService.get(declaredByMetadataId) != null) {
public void installCommonViewArtefacts(final String moduleName) { Validate.isTrue(isProjectAvailable(), "Project metadata required"); final LogicalPath webappPath = Path.SRC_MAIN_WEBAPP .getModulePathId(moduleName); if (!isControllerAvailable()) { webMvcOperations.installAllWebMvcArtifacts();