@@ -0,0 +1,2471 @@
+package org.project.openbaton.integration.test.parser;%0A%0Aimport com.google.gson.Gson;%0Aimport com.google.gson.GsonBuilder;%0Aimport com.google.gson.JsonElement;%0Aimport org.project.openbaton.catalogue.mano.descriptor.NetworkServiceDescriptor;%0Aimport org.project.openbaton.integration.test.utils.Tester;%0Aimport org.project.openbaton.integration.test.utils.Utils;%0A%0Aimport java.util.*;%0A%0A/**%0A * Created by mob on 27.07.15.%0A */%0Apublic class NSDParser %7B%0A%0A    private static Map%3CString, String%3E vnfdMap = new HashMap%3C%3E();%0A%0A    public static String randomize(String json, String param, String value)%7B%0A        String result=null;%0A        GsonBuilder builder = new GsonBuilder();%0A        Gson mapper = builder.create();%0A        Map%3CString, Object%3E javaRootMapObject = mapper.fromJson(json, Map.class);%0A%0A%0A        //%0A        for(String element : javaRootMapObject.keySet())%7B%0A            if(element.equals(param))%0A                javaRootMapObject.get(param)%0A        %7D%0A%0A        //%0A%0A%0A        ArrayList vnfdList = (ArrayList) javaRootMapObject.get(%22vnfd%22);%0A%0A        for(Object vnfdOb : vnfdList)%7B%0A            Map%3CString, Object%3E vnfd = (Map%3CString, Object%3E) vnfdOb;%0A            String vnfdName = (String) vnfd.get(%22name%22);%0A            vnfdMap.put(vnfdName, vnfdName + Math.random());%0A            System.out.println(vnfdMap.get(vnfdName));%0A        %7D%0A%0A        ArrayList listOfDependencies = (ArrayList)javaRootMapObject.get(%22vnf_dependency%22);%0A        for(Object dependencies : listOfDependencies)%7B%0A%0A        Map%3CString, Object%3E mapDependencies = (Map%3CString, Object%3E)dependencies;%0A%0A        String sourceName = (String)((Map%3CString, Object%3E)mapDependencies.get(%22source%22)).get(%22name%22);%0A        ((Map%3CString, Object%3E)mapDependencies.get(%22source%22)).put(%22name%22, vnfdMap.get(sourceName));%0A%0A        String target= (String)((Map%3CString, Object%3E)mapDependencies.get(%22target%22)).get(%22name%22);%0A        ((Map%3CString, Object%3E)mapDependencies.get(%22target%22)).put(%22name%22,vnfdMap.get(target));%0A        System.out.println(%22Source: %22 + ((Map%3CString, Object%3E) mapDependencies.get(%22source%22)).get(%22name%22) + %22%5CnTarget:%22 + ((Map%3CString, Object%3E) mapDependencies.get(%22target%22)).get(%22name%22));%0A        %7D%0A%0A        return result;%0A    %7D%0A%0A    public static void main(String%5B%5D args)%7B%0A        String body = Utils.getStringFromInputStream(Tester.class.getResourceAsStream(%22/etc/json_file/network_service_descriptors/NetworkServiceDescriptor-with-dependencies-without-allacation.json%22));%0A        NSDParser.randomize(body);%0A    %7D%0A%7D%0A

add NSDParser