@Test public void testEmptyRecipeDirectory() throws Exception { File appDir = this.folder.newFolder(); Component comp = new Component("toto").installerName("script"); File directory = ResourceUtils.findInstanceResourcesDirectory(appDir, comp); Assert.assertTrue(directory.mkdirs()); List<ModelError> errors = RecipesValidator.validateComponentRecipes(appDir, comp); Assert.assertEquals(0, errors.size()); }
public static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ) { List<ModelError> result; if( "puppet".equalsIgnoreCase( component.getInstallerName())) result = validatePuppetComponent( applicationFilesDirectory, component ); else if( "script".equalsIgnoreCase( component.getInstallerName())) result = validateScriptComponent( applicationFilesDirectory, component ); else result = Collections.emptyList(); return result; }
RecipesValidator { public static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ) { List<ModelError> result; if( "puppet".equalsIgnoreCase( component.getInstallerName())) result = validatePuppetComponent( applicationFilesDirectory, component ); else if( "script".equalsIgnoreCase( component.getInstallerName())) result = validateScriptComponent( applicationFilesDirectory, component ); else result = Collections.emptyList(); return result; } }
RecipesValidator { public static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ) { List<ModelError> result; if( "puppet".equalsIgnoreCase( component.getInstallerName())) result = validatePuppetComponent( applicationFilesDirectory, component ); else if( "script".equalsIgnoreCase( component.getInstallerName())) result = validateScriptComponent( applicationFilesDirectory, component ); else result = Collections.emptyList(); return result; } private  RecipesValidator(); }
RecipesValidator { public static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ) { List<ModelError> result; if( "puppet".equalsIgnoreCase( component.getInstallerName())) result = validatePuppetComponent( applicationFilesDirectory, component ); else if( "script".equalsIgnoreCase( component.getInstallerName())) result = validateScriptComponent( applicationFilesDirectory, component ); else result = Collections.emptyList(); return result; } private  RecipesValidator(); static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ); }
RecipesValidator { public static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ) { List<ModelError> result; if( "puppet".equalsIgnoreCase( component.getInstallerName())) result = validatePuppetComponent( applicationFilesDirectory, component ); else if( "script".equalsIgnoreCase( component.getInstallerName())) result = validateScriptComponent( applicationFilesDirectory, component ); else result = Collections.emptyList(); return result; } private  RecipesValidator(); static List<ModelError> validateComponentRecipes( File applicationFilesDirectory, Component component ); static final String SCRIPTS_DIR_NAME; }