Search in sources :

Example 6 with DNSServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) DNSDao(org.nhindirect.config.store.dao.DNSDao) DNSServiceImpl(org.nhindirect.config.service.impl.DNSServiceImpl)

Example 7 with DNSServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) DNSDao(org.nhindirect.config.store.dao.DNSDao) DNSServiceImpl(org.nhindirect.config.service.impl.DNSServiceImpl)

Example 8 with DNSServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) DNSDao(org.nhindirect.config.store.dao.DNSDao) DNSServiceImpl(org.nhindirect.config.service.impl.DNSServiceImpl)

Example 9 with DNSServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) DNSDao(org.nhindirect.config.store.dao.DNSDao) DNSServiceImpl(org.nhindirect.config.service.impl.DNSServiceImpl)

Example 10 with DNSServiceImpl

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");
    }
}
Also used : Expectations(org.jmock.Expectations) DNSDao(org.nhindirect.config.store.dao.DNSDao) DNSServiceImpl(org.nhindirect.config.service.impl.DNSServiceImpl)

Aggregations

Expectations (org.jmock.Expectations)11 DNSServiceImpl (org.nhindirect.config.service.impl.DNSServiceImpl)11 DNSDao (org.nhindirect.config.store.dao.DNSDao)11 DNSRecord (org.nhindirect.config.store.DNSRecord)3