aboutsummaryrefslogtreecommitdiff
path: root/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets
diff options
context:
space:
mode:
authorMarc R. Hoffmann <hoffmann@mountainminds.com>2010-03-11 17:04:58 +0000
committerMarc R. Hoffmann <hoffmann@mountainminds.com>2010-03-11 17:04:58 +0000
commitcb8bec25e012ab896b4ad9399eaae5db3aa947c7 (patch)
tree2752d6d64053195f355b4beaab97199892c0ef48 /org.jacoco.core.test/src/org/jacoco/core/test/validation/targets
parent414260acd72dcc71d3511af0e74a31566c7cbffd (diff)
downloadjacoco-cb8bec25e012ab896b4ad9399eaae5db3aa947c7.tar.gz
Consolidate test targets.
Diffstat (limited to 'org.jacoco.core.test/src/org/jacoco/core/test/validation/targets')
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java12
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java2
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java27
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java31
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java35
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java38
-rw-r--r--org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java37
7 files changed, 179 insertions, 3 deletions
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java
index 678df89b..81b994ca 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Stubs.java
@@ -21,7 +21,7 @@ package org.jacoco.core.test.validation.targets;
public class Stubs {
/**
- * Exception Stub.
+ * Exception stub.
*/
public static class StubException extends RuntimeException {
@@ -30,6 +30,16 @@ public class Stubs {
}
/**
+ * Superclass stub.
+ */
+ public static class SuperClass {
+
+ public SuperClass(boolean arg) {
+ }
+
+ }
+
+ /**
* Dummy method.
*/
public static void nop() {
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java
index 87b695c3..53892c7e 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target05.java
@@ -14,8 +14,6 @@ package org.jacoco.core.test.validation.targets;
import static org.jacoco.core.test.validation.targets.Stubs.i1;
-import org.jacoco.core.test.targets.Stubs;
-
/**
* This test target is a class with a static initializer.
*
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java
new file mode 100644
index 00000000..d8bd3268
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target06.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 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:
+ * Marc R. Hoffmann - initial API and implementation
+ *
+ * $Id: $
+ *******************************************************************************/
+package org.jacoco.core.test.validation.targets;
+
+/**
+ * This test target is a class with a implicit default constructor.
+ *
+ * @author Marc R. Hoffmann
+ * @version $Revision: $
+ */
+public class Target06 { // $line-classdef$
+
+ public static void main(String[] args) {
+ new Target06();
+ }
+
+}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java
new file mode 100644
index 00000000..b8276a1f
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target07.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 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:
+ * Marc R. Hoffmann - initial API and implementation
+ *
+ * $Id: $
+ *******************************************************************************/
+package org.jacoco.core.test.validation.targets;
+
+/**
+ * This test target is a private empty default constructor.
+ *
+ * @author Marc R. Hoffmann
+ * @version $Revision: $
+ */
+public class Target07 { // $line-classdef$
+
+ private Target07() {
+ } // $line-constructor$
+
+ public static final int CONST = 42;
+
+ public static void main(String[] args) {
+ }
+
+}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java
new file mode 100644
index 00000000..c4df3e47
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target08.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 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:
+ * Marc R. Hoffmann - initial API and implementation
+ *
+ * $Id: $
+ *******************************************************************************/
+package org.jacoco.core.test.validation.targets;
+
+/**
+ * This test target has instance members with implicit initializers.
+ *
+ * @author Marc R. Hoffmann
+ * @version $Revision: $
+ */
+public class Target08 { // $line-classdef$
+
+ Object field1; // $line-field1$
+
+ Object field2 = this; // $line-field2$
+
+ int field3; // $line-field3$
+
+ int field4 = 2000; // $line-field4$
+
+ public static void main(String[] args) {
+ new Target08();
+ }
+
+}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java
new file mode 100644
index 00000000..5fc70ab0
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target09.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 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:
+ * Marc R. Hoffmann - initial API and implementation
+ *
+ * $Id: $
+ *******************************************************************************/
+package org.jacoco.core.test.validation.targets;
+
+/**
+ * This test target has instance members with initialization in two
+ * constructors.
+ *
+ * @author Marc R. Hoffmann
+ * @version $Revision: $
+ */
+public class Target09 {
+
+ Object field1 = null; // $line-field1$
+
+ int field2 = 123; // $line-field2$
+
+ public Target09() {
+ } // $line-constr1$
+
+ public Target09(String arg) {
+ } // $line-constr2$
+
+ public static void main(String[] args) {
+ new Target09();
+ }
+
+}
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java
new file mode 100644
index 00000000..1101681e
--- /dev/null
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/targets/Target10.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 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:
+ * Marc R. Hoffmann - initial API and implementation
+ *
+ * $Id: $
+ *******************************************************************************/
+package org.jacoco.core.test.validation.targets;
+
+import static org.jacoco.core.test.validation.targets.Stubs.f;
+import static org.jacoco.core.test.validation.targets.Stubs.t;
+
+import org.jacoco.core.test.validation.targets.Stubs.SuperClass;
+
+/**
+ * This test target has a constructor containing control structures before the
+ * superclass constructor is called.
+ *
+ * @author Marc R. Hoffmann
+ * @version $Revision: $
+ */
+public class Target10 extends SuperClass {
+
+ public Target10() {
+ super(t() ? t() : f()); // $line-super$
+ }
+
+ public static void main(String[] args) {
+ new Target10();
+ }
+
+}