+public class ITCaseSvcLogicGraphExecutor {
+
+ private static final Logger LOG = LoggerFactory.getLogger(SvcLogicGraph.class);
+ private static final Map<String, SvcLogicNodeExecutor> BUILTIN_NODES = new HashMap<String, SvcLogicNodeExecutor>() {
+ {
+ put("block", new BlockNodeExecutor());
+ put("call", new CallNodeExecutor());
+ put("configure", new ConfigureNodeExecutor());
+ put("delete", new DeleteNodeExecutor());
+ put("execute", new ExecuteNodeExecutor());
+ put("exists", new ExistsNodeExecutor());
+ put("for", new ForNodeExecutor());
+ put("get-resource", new GetResourceNodeExecutor());
+ put("is-available", new IsAvailableNodeExecutor());
+ put("notify", new NotifyNodeExecutor());
+ put("record", new RecordNodeExecutor());
+ put("release", new ReleaseNodeExecutor());
+ put("reserve", new ReserveNodeExecutor());
+ put("return", new ReturnNodeExecutor());
+ put("save", new SaveNodeExecutor());
+ put("set", new SetNodeExecutor());
+ put("switch", new SwitchNodeExecutor());
+ put("update", new UpdateNodeExecutor());
+
+ }
+ };
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+
+ LOG.info("before class");
+
+ InputStream propStr = ITCaseSvcLogicGraphExecutor.class.getResourceAsStream("/svclogic.properties");
+
+ Properties svcprops = new Properties();
+ svcprops.load(propStr);
+
+ // Start MariaDB4j database
+ DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder();
+ config.setPort(0); // 0 => autom. detect free port
+ DB db = DB.newEmbeddedDB(config.build());
+ db.start();
+
+ // Override jdbc URL and database name
+ svcprops.setProperty("org.onap.ccsdk.sli.jdbc.database", "test");
+ svcprops.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test"));
+
+ SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
+
+ assertNotNull(store);
+
+ SvcLogicParser parser = new SvcLogicParser();
+
+ SvcLogicPropertiesProvider resourceProvider = new SvcLogicPropertiesProviderImpl();
+ SvcLogicServiceImpl svc = new SvcLogicServiceImpl(resourceProvider);
+
+ for (String nodeType : BUILTIN_NODES.keySet()) {
+ LOG.info("SLI - registering node executor for node type " + nodeType);
+ svc.registerExecutor(nodeType, BUILTIN_NODES.get(nodeType));
+ }
+
+
+