5f8757aa2bd2e9fe90f44684493d9e31b2fff52b
[ccsdk/sli.git] /
1 package org.onap.ccsdk.sli.core.sli.provider.base;\r
2 \r
3 import static org.junit.Assert.assertNotNull;\r
4 import static org.junit.Assert.assertNull;\r
5 import static org.junit.Assert.assertTrue;\r
6 import java.util.Properties;\r
7 import org.junit.Test;\r
8 import org.onap.ccsdk.sli.core.sli.SvcLogicGraph;\r
9 \r
10 public class InMemorySvcLogicStoreTest {\r
11     @Test\r
12     public void simpleTest() throws Exception {\r
13         InMemorySvcLogicStore store = new InMemorySvcLogicStore();\r
14         store.init(new Properties());\r
15         SvcLogicGraph graph = new SvcLogicGraph();\r
16         String module = "TEST";\r
17         String rpc = "NOTIFICATION";\r
18         String mode = "sync";\r
19         String version = "1";\r
20 \r
21         graph.setModule(module);\r
22         graph.setRpc(rpc);\r
23         graph.setMode(mode);\r
24         graph.setVersion(version);\r
25 \r
26         store.store(graph);\r
27         assertTrue(store.hasGraph(module, rpc, version, mode));\r
28         assertNotNull(store.fetch(module, rpc, version, mode));\r
29         store.activate(graph);\r
30         store.activate(module, rpc, version, mode);\r
31 \r
32         store.delete(module, rpc, version, mode);\r
33         assertNull(store.fetch(module, rpc, version, mode));\r
34     }\r
35 }\r