use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.
the class DNSServiceTest method testAddDNS.
/**
* Test the addDNS method.
*/
public void testAddDNS() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final Collection<DNSRecord> records = Arrays.asList(DNSRecordUtils.createARecord("example.domain.com", 84000L, "10.45.84.12"));
context.checking(new Expectations() {
{
oneOf(dnsDao).add(records);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.addDNS(records);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.
the class DNSServiceTest method testRemoveDNSByRecordIds.
/**
* Test the removeDNSByRecordIds method.
*/
public void testRemoveDNSByRecordIds() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final long[] recIds = new long[] { 8387 };
context.checking(new Expectations() {
{
oneOf(dnsDao).remove(recIds);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.removeDNSByRecordIds(recIds);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.
the class DNSServiceTest method testRemoveDNS.
/**
* Test the removeDNS method.
*/
public void testRemoveDNS() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final Collection<DNSRecord> records = Arrays.asList(DNSRecordUtils.createARecord("example.domain.com", 84000L, "10.45.84.12"));
context.checking(new Expectations() {
{
oneOf(dnsDao).remove(records);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.removeDNS(records);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.
the class DNSServiceTest method testUpdateDNS.
/**
* Test the updateDNS method.
*/
public void testUpdateDNS() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final DNSRecord record = DNSRecordUtils.createARecord("example.domain.com", 84000L, "10.45.84.12");
final long recId = 8387;
context.checking(new Expectations() {
{
oneOf(dnsDao).update(recId, record);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.updateDNS(recId, record);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.
the class DNSServiceTest method testGetCount.
/**
* Test the getDNSCount method.
*/
public void testGetCount() {
final DNSDao dnsDao = context.mock(DNSDao.class);
context.checking(new Expectations() {
{
oneOf(dnsDao).count();
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.getDNSCount();
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations