001    package org.hackystat.sensor.ant.clover;
002    
003    import static org.junit.Assert.assertEquals;
004    
005    import java.io.File;
006    import org.hackystat.sensor.ant.test.AntSensorTestHelper;
007    import org.junit.Test;
008    
009    /**
010     * Tests the Ant Clover sensor.
011     *
012     * @author Philip Johnson, Aaron A. Kagawa
013     */
014    public class TestCloverSensor extends AntSensorTestHelper {
015    
016      /**
017       * Tests CheckstyleSensor by processing some test checkstyle files. 
018       * @throws Exception If a problem occurs.
019       */
020      @Test
021      public void testCloverSensor() throws Exception {
022        CloverSensor sensor = new CloverSensor(host, user, user);
023        sensor.setVerbose("off");
024        int instances = 0;
025        // Process the test files.
026        for (File file : super.getXmlFiles(System.getProperty("clovertestfiles"))) {
027          instances += sensor.processCoverageXmlFile(file);
028        }
029        assertEquals("Should have 14 entries; 4 granularities per entry", 14, instances);
030      }  
031    }