use of org.apache.knox.test.mock.MockServer in project knox by apache.
the class GatewayPortMappingFailTest method setup.
/**
* Creates a deployment of a gateway instance that all test methods will share. This method also creates a
* registry of sorts for all of the services that will be used by the test methods.
* The createTopology method is used to create the topology file that would normally be read from disk.
* The driver.setupGateway invocation is where the creation of GATEWAY_HOME occurs.
* <p/>
* This would normally be done once for this suite but the failure tests start affecting each other depending
* on the state the last 'active' url
*
* @throws Exception Thrown if any failure occurs.
*/
@BeforeClass
public static void setup() throws Exception {
LOG_ENTER();
eeriePort = GatewayPortMappingFuncTest.getAvailablePort(1240, 49151);
ConcurrentHashMap<String, Integer> topologyPortMapping = new ConcurrentHashMap<String, Integer>();
topologyPortMapping.put("eerie", eeriePort);
masterServer = new MockServer("master", true);
GatewayTestConfig config = new GatewayTestConfig();
config.setGatewayPath("gateway");
config.setTopologyPortMapping(topologyPortMapping);
driver.setResourceBase(WebHdfsHaFuncTest.class);
driver.setupLdap(0);
driver.setupService("WEBHDFS", "http://vm.local:50070/webhdfs", "/eerie/webhdfs", USE_MOCK_SERVICES);
driver.setupGateway(config, "eerie", GatewayPortMappingFuncTest.createTopology("WEBHDFS", driver.getLdapUrl(), masterServer.getPort()), USE_GATEWAY);
LOG_EXIT();
}
Aggregations