summaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/test/java/com/yahoo/jdisc/core/ExportPackagesTestCase.java
blob: b6b1eba6719b1d9916287d6611c066264c2a38ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.core;

import org.junit.Test;

import java.io.File;
import java.io.FileReader;
import java.util.Properties;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

/**
 * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen Hult</a>
 */
public class ExportPackagesTestCase {

    @Test
    public void requireThatPropertiesAreWritten() throws Exception {
        File file = new File("target", ExportPackages.PROPERTIES_FILE);
        file.deleteOnExit();
        ExportPackages.main(new String[] { file.getAbsolutePath() });
        assertTrue(file.exists());
        Properties props = new Properties();
        try (FileReader reader = new FileReader(file)) {
            props.load(reader);
            assertNotNull(props.getProperty(ExportPackages.EXPORT_PACKAGES));
        }
    }
}