use of org.ovirt.engine.core.common.businessentities.network.NameServer in project ovirt-engine by oVirt.
the class NetworkDaoTest method testUpdate.
/**
* Ensures updating a network works as expected.
*/
@Test
public void testUpdate() {
Network before = dao.getByNameAndCluster(EXISTING_NETWORK_NAME1, FixturesTool.CLUSTER);
before.setDescription("This is a completely changed description");
before.getDnsResolverConfiguration().getNameServers().add(new NameServer("1.1.1.1"));
dao.update(before);
Network after = dao.getByNameAndCluster(EXISTING_NETWORK_NAME1, FixturesTool.CLUSTER);
assertNotNull(after);
assertEquals(before, after);
}
use of org.ovirt.engine.core.common.businessentities.network.NameServer in project ovirt-engine by oVirt.
the class DnsResolverConfigurationDaoTest method generateNewEntity.
@Override
protected DnsResolverConfiguration generateNewEntity() {
DnsResolverConfiguration dnsResolverConfiguration = new DnsResolverConfiguration();
dnsResolverConfiguration.setNameServers(new ArrayList<>(Arrays.asList(new NameServer("1.1.1.1"))));
return dnsResolverConfiguration;
}
use of org.ovirt.engine.core.common.businessentities.network.NameServer in project ovirt-engine by oVirt.
the class DnsResolverConfigurationDaoTest method dnsResolverConfigurationFromFixtures.
public DnsResolverConfiguration dnsResolverConfigurationFromFixtures() {
DnsResolverConfiguration expected = new DnsResolverConfiguration();
expected.setId(FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION);
expected.setNameServers(Arrays.asList(new NameServer("192.168.1.2"), new NameServer("2002:0db8:85a3:0000:0000:8a2e:0370:7334")));
return expected;
}
use of org.ovirt.engine.core.common.businessentities.network.NameServer in project ovirt-engine by oVirt.
the class VdsDynamicDaoTest method testUpdateDnsResolverConfiguration.
@Test
public void testUpdateDnsResolverConfiguration() {
VdsDynamic before = dao.get(getExistingEntityId());
before.getReportedDnsResolverConfiguration().setNameServers(Collections.singletonList(new NameServer("1.1.1.1")));
dao.updateDnsResolverConfiguration(before.getId(), before.getReportedDnsResolverConfiguration());
VdsDynamic after = dao.get(getExistingEntityId());
assertEquals(before.getReportedDnsResolverConfiguration(), after.getReportedDnsResolverConfiguration());
}
use of org.ovirt.engine.core.common.businessentities.network.NameServer in project ovirt-engine by oVirt.
the class NetworkAttachmentDaoImplTest method testUpdate.
/**
* Ensures that the update is working correctly
*/
@Test
public void testUpdate() {
networkAttachment.setNicId(FixturesTool.NETWORK_ATTACHMENT_NIC);
dao.save(networkAttachment);
IpConfiguration ipConfiguration = populateIpConfiguration(networkAttachment.getIpConfiguration(), Ipv4BootProtocol.STATIC_IP, Ipv6BootProtocol.NONE);
networkAttachment.setIpConfiguration(ipConfiguration);
Map<String, String> properties = new HashMap<>();
properties.put("key", "value");
networkAttachment.setProperties(properties);
networkAttachment.setNicId(FixturesTool.NETWORK_ATTACHMENT_NIC2);
networkAttachment.getDnsResolverConfiguration().getNameServers().add(new NameServer("2.2.2.2"));
dao.update(networkAttachment);
NetworkAttachment result = dao.get(networkAttachment.getId());
assertNotNull(result);
assertNetworkAttachmentEquals(networkAttachment, result);
}
Aggregations