001 package org.hackystat.sensor.ant.emma; 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 Emma sensor. 011 * 012 * @author Philip Johnson, Aaron A. Kagawa 013 */ 014 public class TestEmmaSensor extends AntSensorTestHelper { 015 016 /** 017 * Tests sensor by processing some test files. 018 * @throws Exception If a problem occurs. 019 */ 020 @Test 021 public void testEmmaSensor() throws Exception { 022 EmmaSensor sensor = new EmmaSensor(host, user, user); 023 sensor.setVerbose("off"); 024 int instances = 0; 025 // Process the test files. 026 for (File file : super.getXmlFiles(System.getProperty("emmatestfiles"))) { 027 instances += sensor.processCoverageXmlFile(file); 028 } 029 assertEquals("Should have 5 entries; 4 granularities per entry", 5, instances); 030 } 031 }