aboutsummaryrefslogtreecommitdiffstats
path: root/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestSvcLogicLoader.java
blob: 2dd83e86d87feb68c7a6f4f7ca6e7d843c9f3ea4 (plain)
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
31
32
33
34
35
36
37
38
package org.onap.ccsdk.sli.core.sli;

import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;
import org.junit.Test;

public class TestSvcLogicLoader {

    @Test
    public void testLoadAndActivate() throws IOException, SvcLogicException {
        URL propUrl = ITCaseSvcLogicParser.class.getResource("/svclogic.properties");

        InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/svclogic.properties");

        Properties props = new Properties();

        props.load(propStr);

        SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(props);

        File graphDirectory =  new File(getClass().getClassLoader().getResource("graphs").getFile());

        if (graphDirectory == null) {
            fail("Cannot find graphs directory");
        }
        SvcLogicLoader loader = new SvcLogicLoader(graphDirectory.getAbsolutePath(), store);
        loader.loadAndActivate();


    }



}