Clover Coverage Report - Maven JavaFX Compiler Plugin 1.0b2
Coverage timestamp: Wed Jul 14 2010 00:20:43 PDT
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
11   45   6   3.67
6   19   0.55   3
3     2  
1    
 
  JavaFxcMojoValidator       Line # 27 11 0% 6 0 100% 1.0
 
No Tests
 
1    /*
2    * Created on Jan 25, 2010
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10    * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11    * or implied. See the License for the specific language governing permissions and limitations under
12    * the License.
13    *
14    * Copyright @2010 the original author or authors.
15    */
16    package org.fest.javafx.maven;
17   
18    import org.apache.maven.plugin.MojoExecutionException;
19   
20    import java.io.File;
21   
22    /**
23    * Understands validation of the state of a <code>{@link JavaFxcMojo}</code>.
24    *
25    * @author Alex Ruiz
26    */
 
27    class JavaFxcMojoValidator {
28   
 
29  4 toggle void validate(AbstractJavaFxcMojo javaFxcMojo) throws MojoExecutionException {
30  4 validateSourceDirectory(javaFxcMojo);
31  3 validateOutputDirectory(javaFxcMojo);
32    }
33   
 
34  4 toggle private void validateSourceDirectory(AbstractJavaFxcMojo javaFxcMojo) throws MojoExecutionException {
35  3 if (javaFxcMojo.sourceDirectory().isDirectory()) return;
36  1 throw new MojoExecutionException( "Source directory <" + javaFxcMojo.sourceDirectory().getAbsolutePath() + "> is not an existing directory." );
37    }
38   
 
39  3 toggle private void validateOutputDirectory(AbstractJavaFxcMojo javaFxcMojo) throws MojoExecutionException {
40  3 File output = javaFxcMojo.outputDirectory();
41  1 if (output.isDirectory()) return;
42  2 boolean success = output.mkdirs();
43  1 if (!success) throw new MojoExecutionException( "Unable to create output directory <" + output.getAbsolutePath() + ">." );
44    }
45    }