summaryrefslogtreecommitdiffstats
path: root/sli/common/src/test/java/org/onap/ccsdk/sli/core/sli/TestSvcLogicLoader.java
blob: 8998382ec113f6ce223a70eb2464d504286eeef8 (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.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);

        URL graphUrl = TestSvcLogicLoader.class.getClassLoader().getResource("graphs");

        if (graphUrl == null) {
            fail("Cannot find graphs directory");
        }

        SvcLogicLoader loader = new SvcLogicLoader(graphUrl.getPath(), store);
        loader.loadAndActivate();


    }



}