diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyAutoExternalizeClassTest.java b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyAutoExternalizeClassTest.java new file mode 100644 index 000000000..30ace707c --- /dev/null +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyAutoExternalizeClassTest.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stephan Classen + * Vadim Bauer + * + *******************************************************************************/ +package org.jacoco.core.test.validation.groovy; + +import org.jacoco.core.test.validation.ValidationTestBase; +import org.jacoco.core.test.validation.groovy.targets.GroovyAutoExternalizeClassTarget; +import org.junit.Test; + +/** + * Test of class with {@link groovy.transform.AutoExternalize} annotation. + */ +public class GroovyAutoExternalizeClassTest extends ValidationTestBase { + public GroovyAutoExternalizeClassTest() { + super(GroovyAutoExternalizeClassTarget.class); + } + + @Test + public void test_method_count() { + assertMethodCount(1); + } +} diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyBindableClassTest.java b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyBindableClassTest.java new file mode 100644 index 000000000..773604c46 --- /dev/null +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyBindableClassTest.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stephan Classen + * Vadim Bauer + * + *******************************************************************************/ +package org.jacoco.core.test.validation.groovy; + +import org.jacoco.core.test.validation.ValidationTestBase; +import org.jacoco.core.test.validation.groovy.targets.GroovyBindableClassTarget; +import org.junit.Test; + +/** + * Test of class with {@link groovy.beans.Bindable} annotation. + */ +public class GroovyBindableClassTest extends ValidationTestBase { + public GroovyBindableClassTest() { + super(GroovyBindableClassTarget.class); + } + + @Test + public void test_method_count() { + assertMethodCount(1); + } +} diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyDataClassTest.java b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyCanonicalClassTest.java similarity index 72% rename from org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyDataClassTest.java rename to org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyCanonicalClassTest.java index f13fc4380..05f1f4e97 100644 --- a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyDataClassTest.java +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyCanonicalClassTest.java @@ -12,15 +12,15 @@ package org.jacoco.core.test.validation.groovy; import org.jacoco.core.test.validation.ValidationTestBase; -import org.jacoco.core.test.validation.groovy.targets.GroovyDataClassTarget; +import org.jacoco.core.test.validation.groovy.targets.GroovyCanonicalClassTarget; import org.junit.Test; /** - * Test of data classes. + * Test of class with {@link groovy.transform.Canonical} annotation. */ -public class GroovyDataClassTest extends ValidationTestBase { - public GroovyDataClassTest() { - super(GroovyDataClassTarget.class); +public class GroovyCanonicalClassTest extends ValidationTestBase { + public GroovyCanonicalClassTest() { + super(GroovyCanonicalClassTarget.class); } @Test diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyIndexPropertyClassTest.java b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyIndexPropertyClassTest.java new file mode 100644 index 000000000..382c99d6d --- /dev/null +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyIndexPropertyClassTest.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stephan Classen + * Vadim Bauer + * + *******************************************************************************/ +package org.jacoco.core.test.validation.groovy; + +import org.jacoco.core.test.validation.ValidationTestBase; +import org.jacoco.core.test.validation.groovy.targets.GroovyIndexPropertyClassTarget; +import org.junit.Test; + +/** + * Test of class with fields annotated by {@link groovy.transform.IndexedProperty} annotation. + */ +public class GroovyIndexPropertyClassTest extends ValidationTestBase { + public GroovyIndexPropertyClassTest() { + super(GroovyIndexPropertyClassTarget.class); + } + + @Test + public void test_method_count() { + assertMethodCount(1); + } +} diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyVetoableClassTest.java b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyVetoableClassTest.java new file mode 100644 index 000000000..e05e0b64d --- /dev/null +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/GroovyVetoableClassTest.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stephan Classen + * Vadim Bauer + * + *******************************************************************************/ +package org.jacoco.core.test.validation.groovy; + +import org.jacoco.core.test.validation.ValidationTestBase; +import org.jacoco.core.test.validation.groovy.targets.GroovyVetoableClassTarget; +import org.junit.Test; + +/** + * Test of class with {@link groovy.beans.Vetoable} annotation. + */ +public class GroovyVetoableClassTest extends ValidationTestBase { + public GroovyVetoableClassTest() { + super(GroovyVetoableClassTarget.class); + } + + @Test + public void test_method_count() { + assertMethodCount(1); + } +} diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyAutoExternalizeClassTarget.groovy b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyAutoExternalizeClassTarget.groovy new file mode 100644 index 000000000..0475e58a1 --- /dev/null +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyAutoExternalizeClassTarget.groovy @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stephan Classen + * Vadim Bauer + * + *******************************************************************************/ +package org.jacoco.core.test.validation.groovy.targets + +import groovy.transform.AutoExternalize + +@AutoExternalize +class GroovyAutoExternalizeClassTarget { // assertEmpty() + + String first // assertEmpty() + List favItems // assertEmpty() + Date since // assertEmpty() + + static void main(String[] args) { + new GroovyAutoExternalizeClassTarget() // assertFullyCovered() + } +} diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyBindableClassTarget.groovy b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyBindableClassTarget.groovy new file mode 100644 index 000000000..0c2391960 --- /dev/null +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyBindableClassTarget.groovy @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stephan Classen + * Vadim Bauer + * + *******************************************************************************/ +package org.jacoco.core.test.validation.groovy.targets + +import groovy.beans.Bindable + +class GroovyBindableClassTarget { // assertEmpty() + + @Bindable + String firstName // assertEmpty() + + @Bindable + def zipCode // assertEmpty() + + static void main(String[] args) { + new GroovyBindableClassTarget() // assertFullyCovered() + } +} diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyDataClassTarget.groovy b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyCanonicalClassTarget.groovy similarity index 60% rename from org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyDataClassTarget.groovy rename to org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyCanonicalClassTarget.groovy index c51b1e517..8eb959ef0 100644 --- a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyDataClassTarget.groovy +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyCanonicalClassTarget.groovy @@ -11,20 +11,14 @@ *******************************************************************************/ package org.jacoco.core.test.validation.groovy.targets -/* This annotation generates the following - * - a constructor that takes an int as argument - * - a suitable implementation of toString() - * - a suitable implementation of hashCode() - * - a suitable implementation of equals(Object) - * - a public method named canEqual(Object) - * - a getter & setter for the valRead property - */ -@groovy.transform.Canonical -class GroovyDataClassTarget { // assertEmpty() +import groovy.transform.Canonical + +@Canonical +class GroovyCanonicalClassTarget { // assertEmpty() int valRead // assertEmpty() static void main(String[] args) { - new GroovyDataClassTarget() // assertFullyCovered() + new GroovyCanonicalClassTarget() // assertFullyCovered() } } diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyIndexPropertyClassTarget.groovy b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyIndexPropertyClassTarget.groovy new file mode 100644 index 000000000..2a1893b54 --- /dev/null +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyIndexPropertyClassTarget.groovy @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stephan Classen + * Vadim Bauer + * + *******************************************************************************/ +package org.jacoco.core.test.validation.groovy.targets + +import groovy.io.FileType +import groovy.transform.IndexedProperty + +class GroovyIndexPropertyClassTarget { // assertEmpty() + + @IndexedProperty + FileType[] someField // assertEmpty() + @IndexedProperty + List otherField // assertEmpty() + @IndexedProperty + List furtherField // assertEmpty() + + static void main(String[] args) { + new GroovyIndexPropertyClassTarget() // assertFullyCovered() + } +} diff --git a/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyVetoableClassTarget.groovy b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyVetoableClassTarget.groovy new file mode 100644 index 000000000..54d900d68 --- /dev/null +++ b/org.jacoco.core.test.validation.groovy/src/org/jacoco/core/test/validation/groovy/targets/GroovyVetoableClassTarget.groovy @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Stephan Classen + * Vadim Bauer + * + *******************************************************************************/ +package org.jacoco.core.test.validation.groovy.targets + +import groovy.beans.Vetoable + +@Vetoable +class GroovyVetoableClassTarget { // assertEmpty() + + String firstName // assertEmpty() + def zipCode // assertEmpty() + + static void main(String[] args) { + new GroovyVetoableClassTarget() // assertFullyCovered() + } +}