@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()); }
@Test public void testGetPackageName1() { ClassCoverageImpl data = new ClassCoverageImpl( "ClassInDefaultPackage", 0, false, null, "java/lang/Object", new String[0]); assertEquals("", data.getPackageName()); }
@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()); }
@Test public void testNoMatch() { ClassCoverageImpl data = new ClassCoverageImpl("Sample", 12345, true, "LSample;", "java/lang/Object", new String[0]); assertTrue(data.isNoMatch()); }
@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()); }