当前位置: 首页>>代码示例>>Java>>正文


Java ApiConnectorMock.create方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:Juniper,项目名称:contrail-vrouter-java-api,代码行数:26,代码来源:ContrailVRouterApiTest.java

示例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;
}
 
开发者ID:Juniper,项目名称:contrail-vcenter-plugin,代码行数:37,代码来源:VncDBTest.java

示例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());
}
 
开发者ID:Juniper,项目名称:contrail-vcenter-plugin,代码行数:30,代码来源:VCenterAsComputeVncDBTest.java

示例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;
}
 
开发者ID:Juniper,项目名称:contrail-vcenter-plugin,代码行数:31,代码来源:VirtualNetworkInfoTest.java


注:本文中的net.juniper.contrail.api.ApiConnectorMock.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。