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 * Evgeny Mandrikov - 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.BadCycleClass; 16 import org.junit.Test; 17 18 /** 19 * Test of "bad cycles" with classes. 20 */ 21 public class BadCycleClassTest extends ValidationTestBase { 22 23 public BadCycleClassTest() throws Exception { 24 super(BadCycleClass.class); 25 } 26 27 @Test 28 public void test() throws Exception { 29 assertLine("childinit", ICounter.FULLY_COVERED); 30 assertLine("childsomeMethod", ICounter.FULLY_COVERED); 31 assertLine("childclinit", ICounter.FULLY_COVERED); 32 33 // The cycle causes a constructor and instance method to be called 34 // before the static initializer of a class: 35 assertLogEvents("childinit", "childsomeMethod", "childclinit", 36 "childinit"); 37 } 38 39 } 40