Search in sources :

Example 11 with DNSDao

use of org.nhindirect.config.store.dao.DNSDao 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 12 with DNSDao

use of org.nhindirect.config.store.dao.DNSDao 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)

Example 13 with DNSDao

use of org.nhindirect.config.store.dao.DNSDao in project nhin-d by DirectProject.

the class DNSServiceTest method testRemoveDNSByRecordId.

/**
     * Test the removeDNSByRecordId method.
     */
public void testRemoveDNSByRecordId() {
    final DNSDao dnsDao = context.mock(DNSDao.class);
    final long recId = 8387;
    context.checking(new Expectations() {

        {
            oneOf(dnsDao).remove(recId);
        }
    });
    DNSServiceImpl service = new DNSServiceImpl();
    service.setDao(dnsDao);
    try {
        service.removeDNSByRecordId(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)

Aggregations

DNSDao (org.nhindirect.config.store.dao.DNSDao)13 Expectations (org.jmock.Expectations)11 DNSServiceImpl (org.nhindirect.config.service.impl.DNSServiceImpl)11 DNSRecord (org.nhindirect.config.store.DNSRecord)5 ArrayList (java.util.ArrayList)2 Address (org.nhindirect.config.store.Address)2 Anchor (org.nhindirect.config.store.Anchor)2 CertPolicy (org.nhindirect.config.store.CertPolicy)2 CertPolicyGroup (org.nhindirect.config.store.CertPolicyGroup)2 Certificate (org.nhindirect.config.store.Certificate)2 Domain (org.nhindirect.config.store.Domain)2 Setting (org.nhindirect.config.store.Setting)2 TrustBundle (org.nhindirect.config.store.TrustBundle)2 AddressDao (org.nhindirect.config.store.dao.AddressDao)2 AnchorDao (org.nhindirect.config.store.dao.AnchorDao)2 CertPolicyDao (org.nhindirect.config.store.dao.CertPolicyDao)2 CertificateDao (org.nhindirect.config.store.dao.CertificateDao)2 DomainDao (org.nhindirect.config.store.dao.DomainDao)2 SettingDao (org.nhindirect.config.store.dao.SettingDao)2 TrustBundleDao (org.nhindirect.config.store.dao.TrustBundleDao)2