예제 #1
0
 @Test
 public void testGetPackageName2() {
   ClassCoverageImpl data =
       new ClassCoverageImpl(
           "org/jacoco/examples/Sample", 0, false, null, "java/lang/Object", new String[0]);
   assertEquals("org/jacoco/examples", data.getPackageName());
 }
예제 #2
0
 @Test
 public void testGetPackageName1() {
   ClassCoverageImpl data =
       new ClassCoverageImpl(
           "ClassInDefaultPackage", 0, false, null, "java/lang/Object", new String[0]);
   assertEquals("", data.getPackageName());
 }
예제 #3
0
 @Test
 public void testAddMethodCovered() {
   ClassCoverageImpl data =
       new ClassCoverageImpl("Sample", 0, false, null, "java/lang/Object", new String[0]);
   data.addMethod(createMethod(true));
   assertEquals(CounterImpl.COUNTER_0_1, data.getInstructionCounter());
   assertEquals(CounterImpl.COUNTER_0_1, data.getMethodCounter());
   assertEquals(CounterImpl.COUNTER_0_1, data.getClassCounter());
 }
예제 #4
0
 @Test
 public void testNoMatch() {
   ClassCoverageImpl data =
       new ClassCoverageImpl("Sample", 12345, true, "LSample;", "java/lang/Object", new String[0]);
   assertTrue(data.isNoMatch());
 }
예제 #5
0
 @Test
 public void testProperties() {
   ClassCoverageImpl data =
       new ClassCoverageImpl(
           "Sample", 12345, false, "LSample;", "java/lang/Object", new String[0]);
   data.setSourceFileName("Sample.java");
   assertEquals(ICoverageNode.ElementType.CLASS, data.getElementType());
   assertEquals("Sample", data.getName());
   assertEquals(12345, data.getId());
   assertFalse(data.isNoMatch());
   assertEquals("LSample;", data.getSignature());
   assertEquals("java/lang/Object", data.getSuperName());
   assertEquals(0, data.getInterfaceNames().length);
   assertEquals("Sample.java", data.getSourceFileName());
   assertEquals(Collections.emptyList(), data.getMethods());
 }