@Test public void validateReusableRecipeProject_noDescriptor_noInstances_withoutMaven() throws Exception { File dir = this.folder.newFolder(); CreationBean bean = new CreationBean() .projectDescription( "some desc" ).projectName( "my-project" ) .groupId( "net.roboconf" ).projectVersion( "1.0.0" ).mavenProject( false ); ProjectUtils.createProjectSkeleton( dir, bean ); Utils.deleteFilesRecursively( new File( dir, Constants.PROJECT_DIR_DESC )); Utils.deleteFilesRecursively( new File( dir, Constants.PROJECT_DIR_INSTANCES )); ProjectValidationResult pvr = ProjectValidator.validateProject( dir ); Assert.assertTrue( pvr.isRecipe()); }
public static ProjectValidationResult validateProject( File appDirectory ) { File instancesDir = new File( appDirectory, Constants.PROJECT_DIR_INSTANCES ); boolean isRecipe = ! new File( appDirectory, Constants.PROJECT_DIR_DESC + "/" + Constants.PROJECT_FILE_DESCRIPTOR ).exists() && (! instancesDir.isDirectory() || Utils.listAllFiles( instancesDir ).isEmpty()); return validateProject( appDirectory, isRecipe ); }
ProjectValidator { public static ProjectValidationResult validateProject( File appDirectory ) { File instancesDir = new File( appDirectory, Constants.PROJECT_DIR_INSTANCES ); boolean isRecipe = ! new File( appDirectory, Constants.PROJECT_DIR_DESC + "/" + Constants.PROJECT_FILE_DESCRIPTOR ).exists() && (! instancesDir.isDirectory() || Utils.listAllFiles( instancesDir ).isEmpty()); return validateProject( appDirectory, isRecipe ); } }
ProjectValidator { public static ProjectValidationResult validateProject( File appDirectory ) { File instancesDir = new File( appDirectory, Constants.PROJECT_DIR_INSTANCES ); boolean isRecipe = ! new File( appDirectory, Constants.PROJECT_DIR_DESC + "/" + Constants.PROJECT_FILE_DESCRIPTOR ).exists() && (! instancesDir.isDirectory() || Utils.listAllFiles( instancesDir ).isEmpty()); return validateProject( appDirectory, isRecipe ); } private  ProjectValidator(); }
ProjectValidator { public static ProjectValidationResult validateProject( File appDirectory ) { File instancesDir = new File( appDirectory, Constants.PROJECT_DIR_INSTANCES ); boolean isRecipe = ! new File( appDirectory, Constants.PROJECT_DIR_DESC + "/" + Constants.PROJECT_FILE_DESCRIPTOR ).exists() && (! instancesDir.isDirectory() || Utils.listAllFiles( instancesDir ).isEmpty()); return validateProject( appDirectory, isRecipe ); } private  ProjectValidator(); static ProjectValidationResult validateProject( File appDirectory ); static ProjectValidationResult validateProject( File appDirectory, boolean isRecipe ); }
ProjectValidator { public static ProjectValidationResult validateProject( File appDirectory ) { File instancesDir = new File( appDirectory, Constants.PROJECT_DIR_INSTANCES ); boolean isRecipe = ! new File( appDirectory, Constants.PROJECT_DIR_DESC + "/" + Constants.PROJECT_FILE_DESCRIPTOR ).exists() && (! instancesDir.isDirectory() || Utils.listAllFiles( instancesDir ).isEmpty()); return validateProject( appDirectory, isRecipe ); } private  ProjectValidator(); static ProjectValidationResult validateProject( File appDirectory ); static ProjectValidationResult validateProject( File appDirectory, boolean isRecipe );  }