1/*******************************************************************************
2 * Copyright (c) 2009, 2015 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 *******************************************************************************/
12package org.jacoco.ant;
13
14import java.io.FileOutputStream;
15import java.io.IOException;
16import java.io.OutputStream;
17
18import org.jacoco.core.data.ExecutionData;
19import org.jacoco.core.data.ExecutionDataWriter;
20
21/**
22 * Utility class to create exec files required for some Ant tests.
23 */
24public class CreateExecFiles {
25
26	private static final String BASE_LOCATION = "./src/org/jacoco/ant/data/";
27
28	public static void main(String[] args) throws IOException {
29		OutputStream out;
30
31		out = new FileOutputStream(BASE_LOCATION + "sample1.exec");
32		new ExecutionDataWriter(out);
33		out.close();
34
35		out = new FileOutputStream(BASE_LOCATION + "sample2.exec");
36		new ExecutionDataWriter(out);
37		out.close();
38
39		out = new FileOutputStream(BASE_LOCATION + "nomatch.exec");
40		ExecutionDataWriter writer = new ExecutionDataWriter(out);
41		writer.visitClassExecution(new ExecutionData(0,
42				"org/jacoco/ant/TestTarget", new boolean[0]));
43		out.close();
44	}
45
46}
47