MuleProjectValidator extends AbstractProjectValidator { public static void isProjectStructureValid(String packagingType, Path projectBaseDir) throws ValidationException { File mainSrcApplication = mainSrcApplication(packagingType, projectBaseDir); if (!mainSrcApplication.exists()) { throw new ValidationException("The folder " + mainSrcApplication.getAbsolutePath() + " is mandatory"); } } MuleProjectValidator(ProjectInformation projectInformation, List<SharedLibraryDependency> sharedLibraries,
                              boolean strictCheck);  MuleProjectValidator(ProjectInformation projectInformation, List<SharedLibraryDependency> sharedLibraries,
                              ProjectRequirement requirement); static void isProjectStructureValid(String packagingType, Path projectBaseDir); void validateSharedLibraries(List<SharedLibraryDependency> sharedLibraries,
                                      List<ArtifactCoordinates> projectDependencies);  }
@Test(expected = ValidationException.class) public void projectStructureValidMuleApplicationInvalid() throws ValidationException { Path mainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()); mainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_APPLICATION.toString(), projectBaseFolder.getRoot().toPath()); }
@Test(expected = ValidationException.class) public void isProjectStructureInvalidValidMuleApplication() throws ValidationException { Path muleMainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()).resolve(POLICY.value()); muleMainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_APPLICATION.toString(), projectBaseFolder.getRoot().toPath()); }
@Test public void isProjectStructureValidMuleApplication() throws ValidationException { Path muleMainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()).resolve(MULE.value()); muleMainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_APPLICATION.toString(), projectBaseFolder.getRoot().toPath()); }
@Test(expected = ValidationException.class) public void isProjectStructureValidMulePolicyInvalid() throws ValidationException { Path mainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()); mainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_POLICY.toString(), projectBaseFolder.getRoot().toPath()); }
@Test(expected = ValidationException.class) public void isProjectStructureInvalidValidMulePolicy() throws ValidationException { Path muleMainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()).resolve("invalid-src-folder"); muleMainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_POLICY.toString(), projectBaseFolder.getRoot().toPath()); }
@Test public void isProjectStructureValidMulePolicy() throws ValidationException { Path muleMainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()).resolve(MULE.value()); muleMainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_POLICY.toString(), projectBaseFolder.getRoot().toPath()); }
@Test(expected = ValidationException.class) public void isProjectStructureValidMuleDomainInvalid() throws ValidationException { Path mainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()); mainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_DOMAIN.toString(), projectBaseFolder.getRoot().toPath()); }
@Test(expected = ValidationException.class) public void isProjectStructureInValidMuleDomain() throws ValidationException { Path muleMainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()).resolve(POLICY.value()); muleMainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_DOMAIN.toString(), projectBaseFolder.getRoot().toPath()); }
@Test public void isProjectStructureValidMuleDomain() throws ValidationException { Path muleMainSrcFolder = projectBaseFolder.getRoot().toPath().resolve(SRC.value()).resolve(MAIN.value()).resolve(MULE.value()); muleMainSrcFolder.toFile().mkdirs(); isProjectStructureValid(MULE_DOMAIN.toString(), projectBaseFolder.getRoot().toPath()); }