<commit_before>package com.kurento.kmf.test.grid;

/*
 * (C) Copyright 2014 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
import static com.kurento.kmf.common.PropertiesManager.getProperty;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Charsets;
import com.google.common.io.CharStreams;
import com.kurento.kmf.test.services.RemoteHost;

/**
 * Meta test for assessing the state of hosts for nodes in Selenium Grid.
 * 
 * @author <NAME> (<EMAIL>)
 * @since 4.2.5
 */
public class CheckNodes {

	public static Logger log = LoggerFactory.getLogger(CheckNodes.class);

	@Ignore
	@Test
	public void test() throws IOException {
		InputStream inputStream = this.getClass().getClassLoader()
				.getResourceAsStream("node-list.txt");
		List<String> nodeList = CharStreams.readLines(new InputStreamReader(
				inputStream, Charsets.UTF_8));

		List<String> nodesWithoutXvfb = new ArrayList<String>();
		List<String> nodesWithException = new ArrayList<String>();
		List<String> nodesDown = new ArrayList<String>();
		List<String> nodesOk = new ArrayList<String>();

		for (String node : nodeList) {
			if (RemoteHost.ping(node)) {

				RemoteHost remoteHost = new RemoteHost(node,
						getProperty("test.node.login"),
						getProperty("test.node.passwd"));
				try {
					remoteHost.start();
					int xvfb = remoteHost.runAndWaitCommand("xvfb-run");
					if (xvfb != 2) {
						nodesWithoutXvfb.add(node);
					} else {
						nodesOk.add(node);
					}
					log.info("{} {}", node, xvfb);
				} catch (Exception e) {
					log.error("Exception in node {} : {}", node, e.getClass());
					nodesWithException.add(node);
				} finally {
					remoteHost.stop();
				}
			} else {
				log.error("Node down {}", node);
				nodesDown.add(node);
			}
		}

		log.info("Nodes Ok: {} {}", nodesOk.size(), nodesOk);
		log.info("Nodes without Xvfb: {} {}", nodesWithoutXvfb.size(),
				nodesWithoutXvfb);
		log.info("Nodes with exception: {} {}", nodesWithException.size(),
				nodesWithException);
		log.info("Nodes down: {} {}", nodesDown.size(), nodesDown);
	}

}
<commit_msg>[kmf-system-test] Removing JUnit annotations from CheckNodes (internal test)<commit_after>package com.kurento.kmf.test.grid;

/*
 * (C) Copyright 2014 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
import static com.kurento.kmf.common.PropertiesManager.getProperty;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Charsets;
import com.google.common.io.CharStreams;
import com.kurento.kmf.test.services.RemoteHost;

/**
 * Meta test for assessing the state of hosts for nodes in Selenium Grid.
 * 
 * @author <NAME> (<EMAIL>)
 * @since 4.2.5
 */
public class CheckNodes {

	public static Logger log = LoggerFactory.getLogger(CheckNodes.class);

	// @Test
	public void test() throws IOException {
		InputStream inputStream = this.getClass().getClassLoader()
				.getResourceAsStream("node-list.txt");
		List<String> nodeList = CharStreams.readLines(new InputStreamReader(
				inputStream, Charsets.UTF_8));

		List<String> nodesWithoutXvfb = new ArrayList<String>();
		List<String> nodesWithException = new ArrayList<String>();
		List<String> nodesDown = new ArrayList<String>();
		List<String> nodesOk = new ArrayList<String>();

		for (String node : nodeList) {
			if (RemoteHost.ping(node)) {

				RemoteHost remoteHost = new RemoteHost(node,
						getProperty("test.node.login"),
						getProperty("test.node.passwd"));
				try {
					remoteHost.start();
					int xvfb = remoteHost.runAndWaitCommand("xvfb-run");
					if (xvfb != 2) {
						nodesWithoutXvfb.add(node);
					} else {
						nodesOk.add(node);
					}
					log.info("{} {}", node, xvfb);
				} catch (Exception e) {
					log.error("Exception in node {} : {}", node, e.getClass());
					nodesWithException.add(node);
				} finally {
					remoteHost.stop();
				}
			} else {
				log.error("Node down {}", node);
				nodesDown.add(node);
			}
		}

		log.info("Nodes Ok: {} {}", nodesOk.size(), nodesOk);
		log.info("Nodes without Xvfb: {} {}", nodesWithoutXvfb.size(),
				nodesWithoutXvfb);
		log.info("Nodes with exception: {} {}", nodesWithException.size(),
				nodesWithException);
		log.info("Nodes down: {} {}", nodesDown.size(), nodesDown);
	}

}

{'fraction_non_alphanumeric': 0.13306093444661574, 'fraction_numerical': 0.005329543435779001, 'mean_word_length': 3.925634295713036, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '5568106', 'n_tokens_mistral': 1944, 'n_tokens_neox': 1718, 'n_words': 454}