// Path: src/main/java/org/jboss/elasticsearch/river/jira/IJiraRiverMgm.java
// public interface IJiraRiverMgm {
// 
// 	/**
// 	 * Stop jira river, but leave instance existing in {@link #riverInstances} so it can be found over management REST
// 	 * calls and/or reconfigured and started later again. Note that standard ES river {@link #close()} method
// 	 * implementation removes river instance from {@link #riverInstances}.
// 	 * 
// 	 * @param permanent set to true if info about river stopped can be persisted
// 	 */
// 	public abstract void stop(boolean permanent);
// 
// 	/**
// 	 * Restart jira river. Configuration of river is updated.
// 	 */
// 	public abstract void restart();
// 
// 	/**
// 	 * Force full index update for some project(s) in this jira river. Used for REST management operations handling.
// 	 * 
// 	 * @param jiraProjectKey optional key of project to reindex, if null or empty then all projects are forced to full
// 	 *          reindex
// 	 * @return CSV list of projects forced to reindex. <code>null</code> if project passed over
// 	 *         <code>jiraProjectKey</code> parameter was not found in this indexer
// 	 * @throws Exception
// 	 */
// 	public abstract String forceFullReindex(String jiraProjectKey) throws Exception;
// 
// 	/**
// 	 * Force incremental index update for some project(s) in this jira river. Used for REST management operations
// 	 * handling.
// 	 * 
// 	 * @param jiraProjectKey optional key of project to reindex, if null or empty then all projects are forced to reindex
// 	 * @return CSV list of projects forced to reindex. <code>null</code> if project passed over
// 	 *         <code>jiraProjectKey</code> parameter was not found in this indexer
// 	 * @throws Exception
// 	 */
// 	public abstract String forceIncrementalReindex(String jiraProjectKey) throws Exception;
// 
// 	/**
// 	 * Get info about current operation of this river. Used for REST management operations handling.
// 	 * 
// 	 * @return String with JSON formatted info.
// 	 * @throws Exception
// 	 */
// 	public abstract String getRiverOperationInfo(DiscoveryNode esNode, Date currentDate) throws Exception;
// 
// 	/**
// 	 * Get name of river.
// 	 * 
// 	 * @return name of jira river
// 	 */
// 	public abstract RiverName riverName();
// 
// }


import java.util.Date;
import junit.framework.Assert;
import org.elasticsearch.Version;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.DummyTransportAddress;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.Transport;
import org.elasticsearch.transport.TransportService;
import org.jboss.elasticsearch.river.jira.IJiraRiverMgm;
import org.junit.Test;
import org.mockito.Mockito;
		NodeJRStateResponse resp = tested.newNodeResponse();
		Assert.assertNotNull(resp);
		Assert.assertEquals(dn, resp.getNode());
	}

	@Test
	public void newNodeResponseArray() {
		TransportJRStateAction tested = prepareTestedInstance(clusterName);
		NodeJRStateResponse[] array = tested.newNodeResponseArray(2);
		Assert.assertNotNull(array);
		Assert.assertEquals(2, array.length);
	}

	@Test
	public void newResponse() {
		TransportJRStateAction tested = prepareTestedInstance(clusterName);

		NodeJRStateResponse[] array = new NodeJRStateResponse[0];
		JRStateResponse resp = tested.newResponse(clusterName, array);
		Assert.assertNotNull(resp);
		Assert.assertEquals(resp.getClusterName(), clusterName);
		Assert.assertEquals(resp.getNodes(), array);

	}

	@Test
	public void performOperationOnJiraRiver() throws Exception {

		TransportJRStateAction tested = prepareTestedInstance(clusterName);

// Path: src/main/java/org/jboss/elasticsearch/river/jira/IJiraRiverMgm.java
// public interface IJiraRiverMgm {
// 
// 	/**
// 	 * Stop jira river, but leave instance existing in {@link #riverInstances} so it can be found over management REST
// 	 * calls and/or reconfigured and started later again. Note that standard ES river {@link #close()} method
// 	 * implementation removes river instance from {@link #riverInstances}.
// 	 * 
// 	 * @param permanent set to true if info about river stopped can be persisted
// 	 */
// 	public abstract void stop(boolean permanent);
// 
// 	/**
// 	 * Restart jira river. Configuration of river is updated.
// 	 */
// 	public abstract void restart();
// 
// 	/**
// 	 * Force full index update for some project(s) in this jira river. Used for REST management operations handling.
// 	 * 
// 	 * @param jiraProjectKey optional key of project to reindex, if null or empty then all projects are forced to full
// 	 *          reindex
// 	 * @return CSV list of projects forced to reindex. <code>null</code> if project passed over
// 	 *         <code>jiraProjectKey</code> parameter was not found in this indexer
// 	 * @throws Exception
// 	 */
// 	public abstract String forceFullReindex(String jiraProjectKey) throws Exception;
// 
// 	/**
// 	 * Force incremental index update for some project(s) in this jira river. Used for REST management operations
// 	 * handling.
// 	 * 
// 	 * @param jiraProjectKey optional key of project to reindex, if null or empty then all projects are forced to reindex
// 	 * @return CSV list of projects forced to reindex. <code>null</code> if project passed over
// 	 *         <code>jiraProjectKey</code> parameter was not found in this indexer
// 	 * @throws Exception
// 	 */
// 	public abstract String forceIncrementalReindex(String jiraProjectKey) throws Exception;
// 
// 	/**
// 	 * Get info about current operation of this river. Used for REST management operations handling.
// 	 * 
// 	 * @return String with JSON formatted info.
// 	 * @throws Exception
// 	 */
// 	public abstract String getRiverOperationInfo(DiscoveryNode esNode, Date currentDate) throws Exception;
// 
// 	/**
// 	 * Get name of river.
// 	 * 
// 	 * @return name of jira river
// 	 */
// 	public abstract RiverName riverName();
// 
// }


// Path: src/test/java/org/jboss/elasticsearch/river/jira/mgm/state/TransportJRStateActionTest.java
import java.util.Date;
import junit.framework.Assert;
import org.elasticsearch.Version;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.DummyTransportAddress;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.Transport;
import org.elasticsearch.transport.TransportService;
import org.jboss.elasticsearch.river.jira.IJiraRiverMgm;
import org.junit.Test;
import org.mockito.Mockito;

		NodeJRStateResponse resp = tested.newNodeResponse();
		Assert.assertNotNull(resp);
		Assert.assertEquals(dn, resp.getNode());
	}

	@Test
	public void newNodeResponseArray() {
		TransportJRStateAction tested = prepareTestedInstance(clusterName);
		NodeJRStateResponse[] array = tested.newNodeResponseArray(2);
		Assert.assertNotNull(array);
		Assert.assertEquals(2, array.length);
	}

	@Test
	public void newResponse() {
		TransportJRStateAction tested = prepareTestedInstance(clusterName);

		NodeJRStateResponse[] array = new NodeJRStateResponse[0];
		JRStateResponse resp = tested.newResponse(clusterName, array);
		Assert.assertNotNull(resp);
		Assert.assertEquals(resp.getClusterName(), clusterName);
		Assert.assertEquals(resp.getNodes(), array);

	}

	@Test
	public void performOperationOnJiraRiver() throws Exception {

		TransportJRStateAction tested = prepareTestedInstance(clusterName);

		IJiraRiverMgm river = Mockito.mock(IJiraRiverMgm.class);