<commit_before>package aQute.bnd.main;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintStream;

import aQute.bnd.osgi.Jar;
import junit.framework.TestCase;

public class TestBndMain extends TestCase {

	private final ByteArrayOutputStream	capturedStdOut	= new ByteArrayOutputStream();
	private PrintStream					originalStdOut;

	private final ByteArrayOutputStream	capturedStdErr	= new ByteArrayOutputStream();
	private PrintStream					originalStdErr;

	@Override
	protected void setUp() throws Exception {
		super.setUp();

		capturedStdOut.reset();
		originalStdOut = System.out;
		System.setOut(new PrintStream(capturedStdOut));

		capturedStdErr.reset();
		originalStdErr = System.err;
		System.setErr(new PrintStream(capturedStdErr));
	}

	@Override
	protected void tearDown() throws Exception {
		System.setErr(originalStdErr);
		System.setOut(originalStdOut);
		super.tearDown();
	}

	public void testBndVersion() throws Exception {
		bnd.mainNoExit(new String[] {
				"version"
		});
		expectNoError();
		expectOutput("${Bundle-Version}");
	}

	public void testRunStandalone() throws Exception {
		bnd.mainNoExit(new String[] {
				"run", "testdata/standalone/standalone.bndrun"
		});
		expectNoError();
		expectOutput("Gesundheit!");
	}

	public void testRunWorkspace() throws Exception {
		bnd.mainNoExit(new String[] {
				"run", "testdata/workspace/p/workspace.bndrun"
		});
		expectNoError();
		expectOutput("Gesundheit!");
	}

	public void testPackageBndrunStandalone() throws Exception {
		bnd.mainNoExit(new String[] {
				"package", "-o", "generated/export-standalone.jar", "testdata/standalone/standalone.bndrun"
		});
		expectNoError();

		// validate exported jar content
		try (Jar result = new Jar(new File("generated/export-standalone.jar"))) {
			expectJarEntry(result, "jar/biz.aQute.launcher-3.1.0.jar");<commit_msg>And yet another superfluous test …<commit_after>package aQute.bnd.main;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintStream;

import aQute.bnd.osgi.Jar;
import junit.framework.TestCase;

public class TestBndMain extends TestCase {

	private final ByteArrayOutputStream	capturedStdOut	= new ByteArrayOutputStream();
	private PrintStream					originalStdOut;

	private final ByteArrayOutputStream	capturedStdErr	= new ByteArrayOutputStream();
	private PrintStream					originalStdErr;

	@Override
	protected void setUp() throws Exception {
		super.setUp();

		capturedStdOut.reset();
		originalStdOut = System.out;
		System.setOut(new PrintStream(capturedStdOut));

		capturedStdErr.reset();
		originalStdErr = System.err;
		System.setErr(new PrintStream(capturedStdErr));
	}

	@Override
	protected void tearDown() throws Exception {
		System.setErr(originalStdErr);
		System.setOut(originalStdOut);
		super.tearDown();
	}

	public void testRunStandalone() throws Exception {
		bnd.mainNoExit(new String[] {
				"run", "testdata/standalone/standalone.bndrun"
		});
		expectNoError();
		expectOutput("Gesundheit!");
	}

	public void testRunWorkspace() throws Exception {
		bnd.mainNoExit(new String[] {
				"run", "testdata/workspace/p/workspace.bndrun"
		});
		expectNoError();
		expectOutput("Gesundheit!");
	}

	public void testPackageBndrunStandalone() throws Exception {
		bnd.mainNoExit(new String[] {
				"package", "-o", "generated/export-standalone.jar", "testdata/standalone/standalone.bndrun"
		});
		expectNoError();

		// validate exported jar content
		try (Jar result = new Jar(new File("generated/export-standalone.jar"))) {
			expectJarEntry(result, "jar/biz.aQute.launcher-3.1.0.jar");
{'fraction_non_alphanumeric': 0.12063227953410982, 'fraction_numerical': 0.0016638935108153079, 'mean_word_length': 5.082630691399663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4434955', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1160, 'n_words': 228}