Search in sources :

Example 6 with SettingDao

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

the class SettingServiceTest method testAddSetting.

/**
     * Test the addAnchors method.
     */
public void testAddSetting() {
    final SettingDao settingDao = context.mock(SettingDao.class);
    final String name = UUID.randomUUID().toString();
    final String value = UUID.randomUUID().toString();
    context.checking(new Expectations() {

        {
            oneOf(settingDao).add(name, value);
        }
    });
    SettingServiceImpl service = new SettingServiceImpl();
    service.setDao(settingDao);
    try {
        service.addSetting(name, value);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) SettingServiceImpl(org.nhindirect.config.service.impl.SettingServiceImpl) SettingDao(org.nhindirect.config.store.dao.SettingDao)

Example 7 with SettingDao

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

the class SettingServiceTest method testUpdateSetting.

/**
     * Test the addAnchors method.
     */
public void testUpdateSetting() {
    final SettingDao settingDao = context.mock(SettingDao.class);
    final String name = UUID.randomUUID().toString();
    final String value = UUID.randomUUID().toString();
    context.checking(new Expectations() {

        {
            oneOf(settingDao).update(name, value);
        }
    });
    SettingServiceImpl service = new SettingServiceImpl();
    service.setDao(settingDao);
    try {
        service.updateSetting(name, value);
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) SettingServiceImpl(org.nhindirect.config.service.impl.SettingServiceImpl) SettingDao(org.nhindirect.config.store.dao.SettingDao)

Example 8 with SettingDao

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

the class SettingServiceTest method testAllSettings.

/**
     * Test the addAnchors method.
     */
public void testAllSettings() {
    final SettingDao settingDao = context.mock(SettingDao.class);
    context.checking(new Expectations() {

        {
            oneOf(settingDao).getAll();
        }
    });
    SettingServiceImpl service = new SettingServiceImpl();
    service.setDao(settingDao);
    try {
        service.getAllSettings();
    } catch (Exception e) {
        fail("Exception thrown");
    }
}
Also used : Expectations(org.jmock.Expectations) SettingServiceImpl(org.nhindirect.config.service.impl.SettingServiceImpl) SettingDao(org.nhindirect.config.store.dao.SettingDao)

Aggregations

SettingDao (org.nhindirect.config.store.dao.SettingDao)8 Expectations (org.jmock.Expectations)6 SettingServiceImpl (org.nhindirect.config.service.impl.SettingServiceImpl)6 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 DNSRecord (org.nhindirect.config.store.DNSRecord)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 DNSDao (org.nhindirect.config.store.dao.DNSDao)2 DomainDao (org.nhindirect.config.store.dao.DomainDao)2 TrustBundleDao (org.nhindirect.config.store.dao.TrustBundleDao)2