// Path: src/test/java/com/github/alexcojocaru/mojo/elasticsearch/v2/NetUtil.java
// public enum ElasticsearchPort
// {
//     HTTP,
//     TRANSPORT
// };


import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
import org.apache.commons.lang3.RandomStringUtils;
import com.github.alexcojocaru.mojo.elasticsearch.v2.NetUtil.ElasticsearchPort;
package com.github.alexcojocaru.mojo.elasticsearch.v2;





/**
 * Used by the groovy setup scripts executed at the beginning of each integration test.
 * 
 * @author alexcojocaru
 */
public class ItSetup
{
    /**
     * The base direction of the test execution (ie. the project directory)
     */
    private final File baseDir;
    
    /**
     * @param executionBaseDir
     */
    public ItSetup(File baseDir)
    {
        this.baseDir = baseDir;
    }

    /**
     * Generate a map of properties to be passed to the plugin
     * 
     * @param count the number of ES instances
     * @throws IOException
     */
    public Map<String, String> generateProperties(int count) throws IOException
    {
        String clusterName = RandomStringUtils.randomAlphanumeric(8);
// Path: src/test/java/com/github/alexcojocaru/mojo/elasticsearch/v2/NetUtil.java
// public enum ElasticsearchPort
// {
//     HTTP,
//     TRANSPORT
// };


// Path: src/test/java/com/github/alexcojocaru/mojo/elasticsearch/v2/ItSetup.java
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
import org.apache.commons.lang3.RandomStringUtils;
import com.github.alexcojocaru.mojo.elasticsearch.v2.NetUtil.ElasticsearchPort;

package com.github.alexcojocaru.mojo.elasticsearch.v2;





/**
 * Used by the groovy setup scripts executed at the beginning of each integration test.
 * 
 * @author alexcojocaru
 */
public class ItSetup
{
    /**
     * The base direction of the test execution (ie. the project directory)
     */
    private final File baseDir;
    
    /**
     * @param executionBaseDir
     */
    public ItSetup(File baseDir)
    {
        this.baseDir = baseDir;
    }

    /**
     * Generate a map of properties to be passed to the plugin
     * 
     * @param count the number of ES instances
     * @throws IOException
     */
    public Map<String, String> generateProperties(int count) throws IOException
    {
        String clusterName = RandomStringUtils.randomAlphanumeric(8);
        Map<ElasticsearchPort, Integer> esPorts = NetUtil.findOpenPortsForElasticsearch(count);