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


Java NeutronPort.setFixedIPs方法代码示例

本文整理汇总了Java中org.opendaylight.controller.networkconfig.neutron.NeutronPort.setFixedIPs方法的典型用法代码示例。如果您正苦于以下问题:Java NeutronPort.setFixedIPs方法的具体用法?Java NeutronPort.setFixedIPs怎么用?Java NeutronPort.setFixedIPs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.controller.networkconfig.neutron.NeutronPort的用法示例。


在下文中一共展示了NeutronPort.setFixedIPs方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: defaultNeutronPortObject

import org.opendaylight.controller.networkconfig.neutron.NeutronPort; //导入方法依赖的package包/类
public NeutronPort defaultNeutronPortObject() {
    NeutronPort neutronPort = new NeutronPort();
    neutronPort.setPortUUID("64a271fe-0216-46bc-a3e6-1ff582fbd324");
    neutronPort.setNetworkUUID("54a271fe-0216-46bc-a3e6-1ff582fbd324");
    neutronPort.setMacAddress("02:70:72:93:4d:d6");
    neutronPort.setName("port12");
    neutronPort.setDeviceID("100071fe-0216-46bc-a3e6-1ff582fbd324");
    neutronPort.setTenantID("100071fe-0216-46bc-a3e6-1ff582fbd324");
    List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
    ips.add(mockNeutron_IPs);
    neutronPort.setFixedIPs(ips);
    return neutronPort;
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:14,代码来源:PortHandlerTest.java

示例2: detaNeutronPort

import org.opendaylight.controller.networkconfig.neutron.NeutronPort; //导入方法依赖的package包/类
public NeutronPort detaNeutronPort() {
    NeutronPort dummyNeutronPort = new NeutronPort();
    dummyNeutronPort.setPortUUID("64a271fe-0216-46bc-a3e6-1ff582fbd324");
    dummyNeutronPort.setNetworkUUID("54a271fe-0216-46bc-a3e6-1ff582fbd324");
    dummyNeutronPort.setName("port01");
    dummyNeutronPort.setDeviceID("100071fe-0216-46bc-a3e6-1ff582fbd324");
    dummyNeutronPort.setTenantID("100071fe-0216-46bc-a3e6-1ff582fbd324");
    List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
    ips.add(mockNeutron_IPs);
    dummyNeutronPort.setFixedIPs(ips);
    return dummyNeutronPort;
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:13,代码来源:PortHandlerTest.java

示例3: testcanUpdatePortCheck

import org.opendaylight.controller.networkconfig.neutron.NeutronPort; //导入方法依赖的package包/类
@Test
public void testcanUpdatePortCheck() throws IOException {
    Activator.apiConnector = mockedApiConnector;
    NeutronPort neutronPort = defaultNeutronPortObject();
    NeutronPort dummyNeutronPort = detaNeutronPort();
    dummyNeutronPort.setFixedIPs(null);
    when(mockedApiConnector.findById(Project.class, neutronPort.getTenantID())).thenReturn(mockedProject);
    when(mockedApiConnector.findById(VirtualMachineInterface.class, neutronPort.getPortUUID())).thenReturn(mockedVirtualMachineInterface);
    when(mockedApiConnector.findByName(VirtualMachineInterface.class, mockedProject, dummyNeutronPort.getName())).thenReturn(null);
    when(mockedApiConnector.findById(VirtualNetwork.class, neutronPort.getNetworkUUID())).thenReturn(mockedVirtualNetwork);
    assertEquals(HttpURLConnection.HTTP_BAD_REQUEST, porthandler.canUpdatePort(dummyNeutronPort, neutronPort));
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:13,代码来源:PortHandlerTest.java

示例4: testcanUpdatePortFixedIPsNotNull

import org.opendaylight.controller.networkconfig.neutron.NeutronPort; //导入方法依赖的package包/类
@Test
public void testcanUpdatePortFixedIPsNotNull() throws IOException {
    Activator.apiConnector = mockedApiConnector;
    NeutronPort neutronPort = defaultNeutronPortObject();
    NeutronPort dummyNeutronPort = detaNeutronPort();
    when(mockedApiConnector.findById(Project.class, neutronPort.getTenantID())).thenReturn(mockedProject);
    when(mockedApiConnector.findById(VirtualMachineInterface.class, neutronPort.getPortUUID())).thenReturn(mockedVirtualMachineInterface);
    when(mockedApiConnector.findByName(VirtualMachineInterface.class, mockedProject, dummyNeutronPort.getName())).thenReturn(null);
    List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
    Neutron_IPs fixedIP = new Neutron_IPs();
    fixedIP.setSubnetUUID("9b9570f2-17b1-4fc3-99ec-1b7f7778a29b");
    ips.add(fixedIP);
    dummyNeutronPort.setFixedIPs(ips);
    when(mockedApiConnector.findById(VirtualNetwork.class, neutronPort.getNetworkUUID())).thenReturn(mockedVirtualNetwork);
    VnSubnetsType vnSubnetType = new VnSubnetsType();
    ObjectReference<VnSubnetsType> ref = new ObjectReference<>();
    List<ObjectReference<VnSubnetsType>> ipamRefs = new ArrayList<ObjectReference<VnSubnetsType>>();
    List<VnSubnetsType.IpamSubnetType> subnets = new ArrayList<VnSubnetsType.IpamSubnetType>();
    VnSubnetsType.IpamSubnetType subnetType = new VnSubnetsType.IpamSubnetType();
    SubnetType type = new SubnetType();
    List<String> temp = new ArrayList<String>();
    for (int i = 0; i < 1; i++) {
        subnetType.setSubnet(type);
        subnetType.setSubnetUuid("0b9570f2-17b1-4fc3-99ec-1b7f7778a29b");
        subnetType.getSubnet().setIpPrefix("10.0.0.0");
        subnetType.getSubnet().setIpPrefixLen(24);
        subnets.add(subnetType);
        vnSubnetType.addIpamSubnets(subnetType);
        ref.setReference(temp, vnSubnetType, "", "");
        ipamRefs.add(ref);
    }
    when(mockedVirtualNetwork.getNetworkIpam()).thenReturn(ipamRefs);
    assertEquals(HttpURLConnection.HTTP_BAD_REQUEST, porthandler.canUpdatePort(dummyNeutronPort, neutronPort));
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:35,代码来源:PortHandlerTest.java

示例5: testcanUpdatePortok

import org.opendaylight.controller.networkconfig.neutron.NeutronPort; //导入方法依赖的package包/类
@Test
public void testcanUpdatePortok() throws IOException {
    Activator.apiConnector = mockedApiConnector;
    NeutronPort neutronPort = defaultNeutronPortObject();
    NeutronPort dummyNeutronPort = detaNeutronPort();
    when(mockedApiConnector.findById(Project.class, neutronPort.getTenantID())).thenReturn(mockedProject);
    when(mockedApiConnector.findById(VirtualMachineInterface.class, neutronPort.getPortUUID())).thenReturn(mockedVirtualMachineInterface);
    when(mockedApiConnector.findByName(VirtualMachineInterface.class, mockedProject, dummyNeutronPort.getName())).thenReturn(null);
    when(mockedApiConnector.findById(VirtualNetwork.class, dummyNeutronPort.getNetworkUUID())).thenReturn(null);
    dummyNeutronPort.setNetworkUUID(null);
    dummyNeutronPort.setFixedIPs(null);
    assertEquals(HttpURLConnection.HTTP_OK, porthandler.canUpdatePort(dummyNeutronPort, neutronPort));
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:14,代码来源:PortHandlerTest.java

示例6: defaultNeutronPortObject

import org.opendaylight.controller.networkconfig.neutron.NeutronPort; //导入方法依赖的package包/类
public NeutronPort defaultNeutronPortObject() {
    NeutronPort neutronPort = new NeutronPort();
    neutronPort.setPortUUID("64a271fe-0216-46bc-a3e6-1ff582fbd324");
    neutronPort.setNetworkUUID("54a271fe-0216-46bc-a3e6-1ff582fbd324");
    neutronPort.setMacAddress("02:70:72:93:4d:d6");
    neutronPort.setName("port12");
    neutronPort.setDeviceID("100071fe-0216-46bc-a3e6-1ff582fbd324");
    neutronPort.setTenantID("001570f2-17b1-4fc3-99ec-1b7f7778a29a");
    List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
    ips.add(mockNeutron_IPs);
    neutronPort.setFixedIPs(ips);
    return neutronPort;
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:14,代码来源:LoadBalancerPoolMemberHandlerTest.java

示例7: defaultNeutronPortObject

import org.opendaylight.controller.networkconfig.neutron.NeutronPort; //导入方法依赖的package包/类
public NeutronPort defaultNeutronPortObject() {
    NeutronPort neutronPort = new NeutronPort();
    neutronPort.setPortUUID("64a271fe-0216-46bc-a3e6-1ff582fbd324");
    neutronPort.setNetworkUUID("54a271fe-0216-46bc-a3e6-1ff582fbd324");
    neutronPort.setMacAddress("02:70:72:93:4d:d6");
    neutronPort.setName("port12");
    neutronPort.setDeviceID("100071fe-0216-46bc-a3e6-1ff582fbd324");
    List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
    ips.add(mockNeutron_IPs);
    neutronPort.setFixedIPs(ips);
    return neutronPort;
}
 
开发者ID:Juniper,项目名称:odl-opencontrail-plugin,代码行数:13,代码来源:PortHandlerTest.java

示例8: testCanCreateFixedIPNull

import org.opendaylight.controller.networkconfig.neutron.NeutronPort; //导入方法依赖的package包/类
@Test
public void testCanCreateFixedIPNull() {
    Activator.apiConnector = mockedApiConnector;
    NeutronPort neutronPort = defaultNeutronPortObject();
    neutronPort.setFixedIPs(null);
    when(mockedNeutronPort.getFixedIPs()).thenReturn(null);
    assertEquals(HttpURLConnection.HTTP_FORBIDDEN, porthandler.canCreatePort(neutronPort));
}
 
开发者ID:Juniper,项目名称:odl-opencontrail-plugin,代码行数:9,代码来源:PortHandlerTest.java


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