Package uk.gov.nationalarchives.droid.core.interfaces.config

Examples of uk.gov.nationalarchives.droid.core.interfaces.config.DroidGlobalConfig


        System.clearProperty(RuntimeConfig.DROID_USER);
    }
   
    @Test
    public void testDefaultHome() throws IOException {
        DroidGlobalConfig config = new DroidGlobalConfig();
        File expectedHome = new File(System.getProperty("user.home"), ".droid6");
        assertEquals(expectedHome, config.getDroidWorkDir());
    }
View Full Code Here


   
    @Test
    public void testSystemPropertyHome() throws IOException {
        System.setProperty(RuntimeConfig.DROID_USER, "custom_home");
        try {
            DroidGlobalConfig config = new DroidGlobalConfig();
            File expectedHome = new File("custom_home");
            assertEquals(expectedHome, config.getDroidWorkDir());
        } finally {
            System.clearProperty(RuntimeConfig.DROID_USER);
        }
    }
View Full Code Here

    }

    @Test
    public void testInitialisationWritesDefaultConfigInDefaultLocation() throws Exception {
       
        DroidGlobalConfig config = new DroidGlobalConfig();
        config.init();
       
        PropertiesConfiguration props = new PropertiesConfiguration(droidProperties);
        assertEquals(0, props.getInt(DroidGlobalProperty.DEFAULT_THROTTLE.getName()));
    }
View Full Code Here

    }

    @Test
    public void testGetProfileProperties() throws Exception {
       
        DroidGlobalConfig config = new DroidGlobalConfig();
        config.init();
       
        Properties profileProperties = config.getProfileProperties();
        assertEquals("0", profileProperties.getProperty("defaultThrottle"));
    }
View Full Code Here

        assertEquals("0", profileProperties.getProperty("defaultThrottle"));
    }
   
    @Test
    public void testUpdate() throws Exception {
        DroidGlobalConfig config = new DroidGlobalConfig();
        config.init();
       
        Map<String, Object> changedProperties = new HashMap<String, Object>();
        changedProperties.put(DroidGlobalProperty.DEFAULT_THROTTLE.getName(), "123");

        config.update(changedProperties);
       
        assertEquals(123, config.getProperties().getInt(DroidGlobalProperty.DEFAULT_THROTTLE.getName()));
       
        PropertiesConfiguration props = new PropertiesConfiguration(droidProperties);
        assertEquals(123, props.getInt(DroidGlobalProperty.DEFAULT_THROTTLE.getName()));
    }
View Full Code Here

    }
   
    @Before
    public void setup() {
        reportTransformer = new ReportTransformerImpl();
        DroidGlobalConfig globalConfig = mock(DroidGlobalConfig.class);
        reportTransformer.setConfig(globalConfig);
    }
View Full Code Here

       
        // Create a tmp dir
        File tmp = new File("tmp");
        tmp.mkdir();
       
        DroidGlobalConfig globalConfig = mock(DroidGlobalConfig.class);
        when(globalConfig.getTempDir()).thenReturn(tmp);
        reportTransformer.setConfig(globalConfig);
       
        assertFalse(pdf.exists());
       
        InputStream in = getClass().getClassLoader().getResourceAsStream("test-report.xml");
View Full Code Here

        properties.put(DroidGlobalProperty.UPDATE_USE_PROXY.getName(), Boolean.FALSE);
        properties.put(DroidGlobalProperty.UPDATE_FREQUENCY_DAYS.getName(), 7);
        properties.put(DroidGlobalProperty.UPDATE_ON_STARTUP.getName(), Boolean.FALSE);
        properties.put(DroidGlobalProperty.UPDATE_AUTOSET_DEFAULT.getName(), Boolean.FALSE);
       
        DroidGlobalConfig globalConfig = mock(DroidGlobalConfig.class);
        when(globalConfig.getPropertiesMap()).thenReturn(properties);
       
        GlobalContext globalContext = mock(GlobalContext.class);
        when(globalContext.getGlobalConfig()).thenReturn(globalConfig);
       
        configDialog = new ConfigDialog(null, globalContext);
View Full Code Here

        profileSpecDao = mock(ProfileSpecDao.class);
        profileContextLocator = mock(ProfileContextLocator.class);
        profileManager.setProfileSpecDao(profileSpecDao);
       
        profileManager.setProfileContextLocator(profileContextLocator);
        globalConfig = new DroidGlobalConfig();
        profileContextLocator.setGlobalConfig(globalConfig);
    }
View Full Code Here

        profileInstance.setUuid("profileName");
        when(profileContextLocator.getProfileInstance("profileName")).thenReturn(profileInstance);
       
        profileManager.setProfileDiskAction(profileDiskAction);
       
        DroidGlobalConfig config = mock(DroidGlobalConfig.class);
        when(config.getProfilesDir()).thenReturn(new File("profiles"));
       
        profileManager.setConfig(config);

        File destination = new File("tmp/myProfile.drd");
       
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.core.interfaces.config.DroidGlobalConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.