1 /******************************************************************************* 2 * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * Marc R. Hoffmann - initial API and implementation 10 * 11 *******************************************************************************/ 12 package org.jacoco.core.test.validation; 13 14 import org.jacoco.core.analysis.ICounter; 15 import org.jacoco.core.test.validation.targets.Target05; 16 import org.junit.Test; 17 18 /** 19 * Tests of static initializer in classes. 20 */ 21 public class ClassInitializerTest extends ValidationTestBase { 22 23 public ClassInitializerTest() { 24 super(Target05.class); 25 } 26 27 @Test 28 public void testCoverageResult() { 29 30 assertLine("const1", ICounter.EMPTY); 31 assertLine("const2", ICounter.EMPTY); 32 33 assertLine("const3", ICounter.FULLY_COVERED); 34 assertLine("const4", ICounter.FULLY_COVERED); 35 36 assertLine("field1", ICounter.FULLY_COVERED); 37 assertLine("field2", ICounter.FULLY_COVERED); 38 assertLine("field3", ICounter.FULLY_COVERED); 39 assertLine("field4", ICounter.FULLY_COVERED); 40 41 assertLine("staticblock", ICounter.FULLY_COVERED); 42 } 43 44 } 45