use of org.nhindirect.config.service.impl.DNSServiceImpl in project nhin-d by DirectProject.
the class DNSServiceTest method testGetDNSByNameAndType.
/**
* Test the getDNSByNameAndType method.
*/
public void testGetDNSByNameAndType() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final String name = "example.domain.com";
final int type = Type.A;
context.checking(new Expectations() {
{
oneOf(dnsDao).get(name, type);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.getDNSByNameAndType(name, type);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.DNSServiceImpl in project nhin-d by DirectProject.
the class DNSServiceTest method testGetDNSByType.
/**
* Test the getDNSByType method.
*/
public void testGetDNSByType() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final int type = Type.A;
context.checking(new Expectations() {
{
oneOf(dnsDao).get(type);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.getDNSByType(type);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.DNSServiceImpl in project nhin-d by DirectProject.
the class DNSServiceTest method testGetDNSByRecordId.
/**
* Test the getDNSByRecordId method.
*/
public void testGetDNSByRecordId() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final long recId = 8387;
context.checking(new Expectations() {
{
oneOf(dnsDao).get(recId);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.getDNSByRecordId(recId);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.DNSServiceImpl in project nhin-d by DirectProject.
the class DNSServiceTest method testGetDNSByName.
/**
* Test the getDNSByName method.
*/
public void testGetDNSByName() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final String name = "example.domain.com";
context.checking(new Expectations() {
{
oneOf(dnsDao).get(name);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.getDNSByName(name);
} catch (Exception e) {
fail("Exception thrown");
}
}
use of org.nhindirect.config.service.impl.DNSServiceImpl in project nhin-d by DirectProject.
the class DNSServiceTest method testGetDNSByRecordIds.
/**
* Test the getDNSByRecordIds method.
*/
public void testGetDNSByRecordIds() {
final DNSDao dnsDao = context.mock(DNSDao.class);
final long[] recIds = new long[] { 8387 };
context.checking(new Expectations() {
{
oneOf(dnsDao).get(recIds);
}
});
DNSServiceImpl service = new DNSServiceImpl();
service.setDao(dnsDao);
try {
service.getDNSByRecordIds(recIds);
} catch (Exception e) {
fail("Exception thrown");
}
}
Aggregations