<commit_before>/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.liferay.blade.cli.command;

import java.io.InputStream;
import java.io.PrintWriter;

import org.junit.Assert;
import org.junit.Test;

/**
 * @author <NAME>
 */
public class VersionCommandTest {

	@Test
	public void testVersionCommandFromJar() throws Exception {
		boolean ok;

		Process ps = Runtime.getRuntime().exec(new String[] {"java", "-jar", _BLADE_JAR_PATH});

		ps.waitFor();

		InputStream is = ps.getInputStream();

		byte[] b = new byte[is.available()];

		is.read(b, 0, b.length);

		String version = new String(b);

		try (PrintWriter out = new PrintWriter("out0.txt")) {
			out.println("testBladeVersionWithManifest: version = " + version);
		}

		if (version.length() > 1) {
			ok = true;
		}
		else {
			ok = false;
		}

		Assert.assertTrue("version = " + version + " ... this does not look right.", ok);
	}

	private static final String _BLADE_JAR_PATH = System.getProperty("bladeJarPath");

}<commit_msg>BLADE-335 simplify<commit_after>/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.liferay.blade.cli.command;

import java.io.InputStream;

import org.junit.Assert;
import org.junit.Test;

/**
 * @author <NAME>
 */
public class VersionCommandTest {

	@Test
	public void testVersionCommandFromJar() throws Exception {
		Runtime runtime = Runtime.getRuntime();

		Process process = runtime.exec(new String[] {"java", "-jar", _BLADE_JAR_PATH});

		process.waitFor();

		InputStream inputStream = process.getInputStream();

		byte[] bytes = new byte[inputStream.available()];

		inputStream.read(bytes, 0, bytes.length);

		String version = new String(bytes);

		Assert.assertFalse(version.isEmpty());
	}

	private static final String _BLADE_JAR_PATH = System.getProperty("bladeJarPath");

}
{'fraction_non_alphanumeric': 0.11313745356298548, 'fraction_numerical': 0.007767646065518406, 'mean_word_length': 4.003378378378378, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3021787', 'n_tokens_mistral': 913, 'n_tokens_neox': 850, 'n_words': 301}