// Path: src/main/java/com/github/sergueik/swet/TestConfigurationParser.java
// public class TestConfigurationParser {
// 
// 	private static boolean skipHeaders = true;
// 	private static String defaultConfig = "test.configuration";
// 	private static Scanner scanner;
// 
// 	public static void main(String[] args) {
// 		String configuPath = (args.length == 0)
// 				? String.format("%s/src/main/resources/%s",
// 						System.getProperty("user.dir"), defaultConfig)
// 				: String.format("%s/%s", System.getProperty("user.dir"), args[0]);
// 		TestConfigurationParser.getConfiguration(configuPath);
// 
// 	}
// 
// 	@SuppressWarnings("resource")
// 	public static Scanner loadTestData(final String filename) {
// 		Scanner scanner = null;
// 		System.err
// 				.println(String.format("Reading configuration file: '%s'", filename));
// 		try {
// 			scanner = new Scanner(new File(filename)).useDelimiter("(?:\\r?\\n)+");
// 		} catch (FileNotFoundException e) {
// 			System.err.println(
// 					String.format("Configuration file was not found: '%s'", filename));
// 			e.printStackTrace();
// 		}
// 		return scanner;
// 	}
// 
// 	public static List<String[]> getConfiguration(final String filename) {
// 		List<String[]> result = new LinkedList<>();
// 		scanner = loadTestData(filename);
// 		List<String> separators = new ArrayList<String>(
// 				Arrays.asList(new String[] { "|", "\t", ";", "," }));
// 		String separator = String
// 				.format("(?:%s)",
// 						String.join("|",
// 								separators.stream().map(o -> Pattern.compile("(\\||/)")
// 										.matcher(o).replaceAll("\\\\$1"))
// 										.collect(Collectors.toList())));
// 		int lineNum = 0;
// 		// System.err.println("separator:" + separator);
// 		while (scanner.hasNext()) {
// 			String line = scanner.next();
// 			// System.err.println("line: " + line);
// 			// skip comments
// 			if (line.matches("^#.*$")) {
// 				continue;
// 			}
// 			lineNum++;
// 			// skip headers
// 			if (skipHeaders) {
// 				if (lineNum == 1) {
// 					continue;
// 				}
// 			}
// 
// 			String[] columns = line.split(separator);
// 			/*
// 			for (String column : columns) {
// 				System.err.println("data column: " + column);
// 			}
// 			*/
// 			result.add(columns);
// 		}
// 		scanner.close();
// 		return result;
// 	}
// }


import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.hamcrest.core.AnyOf.anyOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.containsString;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import com.github.sergueik.swet.TestConfigurationParser;
package com.github.sergueik.swet;
/**
 * Copyright 2014 - 2019 Serguei Kouzmine
 */


// import static org.hamcrest.CoreMatchers.*;
// NOTE: a need to switch to hamcrest-all.jar and Matchers 
// just for resolving method 'containsInAnyOrder'




public class TestConfigurationParserTest {
	/**
	 * Testing of the Selenium WebDriver Elementor Tool (SWET) Configuration table helper
	 *  @author: Serguei Kouzmine (kouzmine_serguei@yahoo.com)
	 */

	private static boolean skipHeaders = true;
	private static String defaultConfig = "test.configuration";
	private static String configuPath = String.format("%s/src/main/resources/%s",
			System.getProperty("user.dir"), defaultConfig);
	private static List<Object> result = new ArrayList<>();
	private static Object[] expected = new Object[] { "A1", "A2", "A3", "B1",
			"B2", "B3", "C1", "C2", "C3", "D1", "D2", "D3" /* , "E1" */ };

	@BeforeClass
	public static void beforeSuiteMethod() throws Exception {
// Path: src/main/java/com/github/sergueik/swet/TestConfigurationParser.java
// public class TestConfigurationParser {
// 
// 	private static boolean skipHeaders = true;
// 	private static String defaultConfig = "test.configuration";
// 	private static Scanner scanner;
// 
// 	public static void main(String[] args) {
// 		String configuPath = (args.length == 0)
// 				? String.format("%s/src/main/resources/%s",
// 						System.getProperty("user.dir"), defaultConfig)
// 				: String.format("%s/%s", System.getProperty("user.dir"), args[0]);
// 		TestConfigurationParser.getConfiguration(configuPath);
// 
// 	}
// 
// 	@SuppressWarnings("resource")
// 	public static Scanner loadTestData(final String filename) {
// 		Scanner scanner = null;
// 		System.err
// 				.println(String.format("Reading configuration file: '%s'", filename));
// 		try {
// 			scanner = new Scanner(new File(filename)).useDelimiter("(?:\\r?\\n)+");
// 		} catch (FileNotFoundException e) {
// 			System.err.println(
// 					String.format("Configuration file was not found: '%s'", filename));
// 			e.printStackTrace();
// 		}
// 		return scanner;
// 	}
// 
// 	public static List<String[]> getConfiguration(final String filename) {
// 		List<String[]> result = new LinkedList<>();
// 		scanner = loadTestData(filename);
// 		List<String> separators = new ArrayList<String>(
// 				Arrays.asList(new String[] { "|", "\t", ";", "," }));
// 		String separator = String
// 				.format("(?:%s)",
// 						String.join("|",
// 								separators.stream().map(o -> Pattern.compile("(\\||/)")
// 										.matcher(o).replaceAll("\\\\$1"))
// 										.collect(Collectors.toList())));
// 		int lineNum = 0;
// 		// System.err.println("separator:" + separator);
// 		while (scanner.hasNext()) {
// 			String line = scanner.next();
// 			// System.err.println("line: " + line);
// 			// skip comments
// 			if (line.matches("^#.*$")) {
// 				continue;
// 			}
// 			lineNum++;
// 			// skip headers
// 			if (skipHeaders) {
// 				if (lineNum == 1) {
// 					continue;
// 				}
// 			}
// 
// 			String[] columns = line.split(separator);
// 			/*
// 			for (String column : columns) {
// 				System.err.println("data column: " + column);
// 			}
// 			*/
// 			result.add(columns);
// 		}
// 		scanner.close();
// 		return result;
// 	}
// }


// Path: src/test/java/com/github/sergueik/swet/TestConfigurationParserTest.java
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import static org.hamcrest.core.AnyOf.anyOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.containsString;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import com.github.sergueik.swet.TestConfigurationParser;

package com.github.sergueik.swet;
/**
 * Copyright 2014 - 2019 Serguei Kouzmine
 */


// import static org.hamcrest.CoreMatchers.*;
// NOTE: a need to switch to hamcrest-all.jar and Matchers 
// just for resolving method 'containsInAnyOrder'




public class TestConfigurationParserTest {
	/**
	 * Testing of the Selenium WebDriver Elementor Tool (SWET) Configuration table helper
	 *  @author: Serguei Kouzmine (kouzmine_serguei@yahoo.com)
	 */

	private static boolean skipHeaders = true;
	private static String defaultConfig = "test.configuration";
	private static String configuPath = String.format("%s/src/main/resources/%s",
			System.getProperty("user.dir"), defaultConfig);
	private static List<Object> result = new ArrayList<>();
	private static Object[] expected = new Object[] { "A1", "A2", "A3", "B1",
			"B2", "B3", "C1", "C2", "C3", "D1", "D2", "D3" /* , "E1" */ };

	@BeforeClass
	public static void beforeSuiteMethod() throws Exception {
		result = flatten(TestConfigurationParser.getConfiguration(configuPath));