本文整理匯總了Java中net.juniper.contrail.api.ApiConnectorMock.create方法的典型用法代碼示例。如果您正苦於以下問題:Java ApiConnectorMock.create方法的具體用法?Java ApiConnectorMock.create怎麽用?Java ApiConnectorMock.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.juniper.contrail.api.ApiConnectorMock
的用法示例。
在下文中一共展示了ApiConnectorMock.create方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: globalSetUp
import net.juniper.contrail.api.ApiConnectorMock; //導入方法依賴的package包/類
@Before
public void globalSetUp() throws IOException {
vrouterApi = new ContrailVRouterApi(null, 0);
api = new ApiConnectorMock(null, 0);
vrouterApi.setApiConnector(api);
// Create default-domain,default-project
Project vProject = new Project();
vProject.setName("default-project");
try {
if (!api.create(vProject)) {
s_logger.error("Unable to create project: " + vProject.getName());
fail("default-project creation failed");
return;
}
} catch (IOException e) {
s_logger.error("Exception : " + e);
e.printStackTrace();
fail("default-project creation failed");
return;
}
}
示例2: globalSetUp
import net.juniper.contrail.api.ApiConnectorMock; //導入方法依賴的package包/類
@Before
public void globalSetUp() throws IOException {
_api = new ApiConnectorMock(null, 0);
assertNotNull(_api);
// Create default-domain,default-project
Project vProject = new Project();
vProject.setName("default-project");
try {
if (!_api.create(vProject)) {
s_logger.error("Unable to create project: " + vProject.getName());
fail("default-project creation failed");
return;
}
} catch (IOException e) {
s_logger.error("Exception : " + e);
e.printStackTrace();
fail("default-project creation failed");
return;
}
// Setup vnc object
vncDB = new VncDB(null,0, Mode.VCENTER_ONLY);
vncDB.setApiConnector(_api);
assertNotNull(vncDB.getApiConnector());
assertTrue(vncDB.isVncApiServerAlive());
assertTrue(vncDB.Initialize());
MainDB.vncDB = vncDB;
VirtualNetworkInfoTest.vncDB = vncDB;
VirtualNetworkInfoTest.api = _api;
VirtualMachineInfoTest.vncDB = vncDB;
VirtualMachineInfoTest.api = _api;
VirtualMachineInterfaceInfoTest.vncDB = vncDB;
VirtualMachineInterfaceInfoTest.api = _api;
}
示例3: globalSetUp
import net.juniper.contrail.api.ApiConnectorMock; //導入方法依賴的package包/類
@Before
public void globalSetUp() throws IOException {
_api = new ApiConnectorMock(null, 0);
assertNotNull(_api);
// Create default-domain,default-project
Project vProject = new Project();
vProject.setName("default-project");
try {
if (!_api.create(vProject)) {
s_logger.error("Unable to create project: " + vProject.getName());
fail("default-project creation failed");
return;
}
} catch (IOException e) {
s_logger.error("Exception : " + e);
e.printStackTrace();
fail("default-project creation failed");
return;
}
// Setup vnc object
vncDB = new VncDB(null,0, "admin", "admin", "admin",
"keystone", "http://127.0.0.1:35357/v2.0", Mode.VCENTER_AS_COMPUTE);
vncDB.setApiConnector(_api);
assertNotNull(vncDB.getApiConnector());
assertTrue(vncDB.isVncApiServerAlive());
assertTrue(vncDB.Initialize());
}
示例4: globalSetUp
import net.juniper.contrail.api.ApiConnectorMock; //導入方法依賴的package包/類
@Before
public void globalSetUp() throws IOException {
api = new ApiConnectorMock(null, 0);
assertNotNull(api);
// Create default-domain,default-project
Project vProject = new Project();
vProject.setName("default-project");
try {
if (!api.create(vProject)) {
s_logger.error("Unable to create project: " + vProject.getName());
fail("default-project creation failed");
return;
}
} catch (IOException e) {
s_logger.error("Exception : " + e);
e.printStackTrace();
fail("default-project creation failed");
return;
}
// Setup vnc object
vncDB = new VncDB(null,0, Mode.VCENTER_ONLY);
vncDB.setApiConnector(api);
assertNotNull(vncDB.getApiConnector());
assertTrue(vncDB.isVncApiServerAlive());
assertTrue(vncDB.Initialize());
MainDB.vncDB = vncDB;
}