File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed
org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ /*******************************************************************************
2+ * Copyright (c) 2009, 2019 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+ * Jan Wloka - initial API and implementation
10+ *
11+ *******************************************************************************/
12+ package org .jacoco .core .test .validation .groovy ;
13+
14+ import org .jacoco .core .test .validation .ValidationTestBase ;
15+ import org .jacoco .core .test .validation .groovy .targets .GroovyDelegateClassTarget ;
16+ import org .junit .Test ;
17+
18+ /**
19+ * Test of class with field annotated by {@link groovy.lang.Delegate}.
20+ */
21+ public class GroovyDelegateClassTest extends ValidationTestBase {
22+ public GroovyDelegateClassTest () {
23+ super (GroovyDelegateClassTarget .class );
24+ }
25+
26+ @ Test
27+ public void test_method_count () {
28+ assertMethodCount (4 );
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ /* ******************************************************************************
2+ * Copyright (c) 2009, 2019 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+ * Jan Wloka - initial API and implementation
10+ *
11+ *******************************************************************************/
12+ package org.jacoco.core.test.validation.groovy.targets
13+
14+ class GroovyDelegateClassTarget { // assertEmpty()
15+
16+ static class D {
17+ void m1 () {
18+ } // assertFullyCovered()
19+
20+ void m2 () {
21+ } // assertFullyCovered()
22+ }
23+
24+ @Delegate
25+ D delegate = new D() // assertEmpty()
26+
27+ void m2 () {
28+ delegate. m2() // assertFullyCovered()
29+ }
30+
31+ static void main (String [] args ) {
32+ new GroovyDelegateClassTarget (). m1()
33+ new GroovyDelegateClassTarget (). m2()
34+ }
35+
36+ }
You can’t perform that action at this time.
0 commit comments