TEST(TestContainerManagement,TestStartContainer){
	ContainerManagement client;
	MockContainerManagementStub stub;
	string nmHost("localhost");
	string nmPort("8032");
	string tokenService = "";
	Yarn::Config config;
	Yarn::Internal::SessionConfig sessionConfig(config);
	Yarn::Internal::UserInfo user = Yarn::Internal::UserInfo::LocalUser();
	Yarn::Internal::RpcAuth rpcAuth(user, Yarn::Internal::AuthMethod::SIMPLE);
	MockContainerManagementProtocol *protocol =new MockContainerManagementProtocol(nmHost,nmPort,tokenService,sessionConfig,rpcAuth);
	
	StringBytesMap map;
	string key("key");
	string value("value");
	map.setKey(key);
	map.setValue(value);
	list<StringBytesMap> maps;
	maps.push_back(map);
	ContainerId containerId;
	containerId.setId(501);
	list<ContainerId> containerIds;
	containerIds.push_back(containerId);
	ContainerExceptionMap exceptionMap;
	exceptionMap.setContainerId(containerId);
	SerializedException exception;
	string message("message");
	string trace("trace");
	string className("className");
	exception.setMessage(message);
	exception.setTrace(trace);
	exception.setClassName(className);
	SerializedException cause;
	string message2("message2");
	cause.setMessage(message2);
	exception.setCause(cause);
	exceptionMap.setSerializedException(exception);
	list<ContainerExceptionMap> exceptionMaps;
	exceptionMaps.push_back(exceptionMap);
	StartContainersResponse response;
	response.setServicesMetaData(maps);
	response.setSucceededRequests(containerIds);
	response.setFailedRequests(exceptionMaps);
	EXPECT_CALL(*protocol, startContainers(_)).Times(AnyNumber()).WillOnce(Return(response));
	client.stub = &stub;
	EXPECT_CALL(stub, getContainerManagementProtocol()).Times(AnyNumber()).WillOnce(Return(protocol));

	Container container;
	StartContainerRequest request;
	libyarn::Token nmToken;
	StartContainerResponse ret = client.startContainer(container,request,nmToken);
	list<StringBytesMap>::iterator itMap = ret.getServicesMetaData().begin();
	//EXPECT_EQ(itMap->getKey(), "key");
	//EXPECT_EQ(itMap->getValue(), "value");
}
void SerializedException::setCause(SerializedException &cause) {
	SerializedExceptionProto* proto = new SerializedExceptionProto();
	proto->CopyFrom(cause.getProto());
	exceptionProto.set_allocated_cause(proto);
}
void ContainerExceptionMap::setSerializedException(
		SerializedException & exception) {
	SerializedExceptionProto* proto = new SerializedExceptionProto();
	proto->CopyFrom(exception.getProto());
	ceProto.set_allocated_exception(proto);
}