diff --git a/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/WarGenerator.java b/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/WarGenerator.java index 465754fe74fc437d47c9c3635a493f041daadf3b..a37cc4b6928a6ec7d77160d5374648384d04164a 100644 --- a/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/WarGenerator.java +++ b/bc-generators/artifact-generators/src/main/java/eu/chorevolution/vsb/artifact/generators/WarGenerator.java @@ -16,16 +16,10 @@ import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; import org.jboss.shrinkwrap.resolver.api.maven.Maven; -<<<<<<< HEAD import eu.chorevolution.vsb.bc.manager.VsbOutput; import eu.chorevolution.vsb.gmdl.utils.Constants; -======= -import org.json.simple.JSONObject; -import eu.chorevolution.vsb.bc.manager.VsbOutput; -import eu.chorevolution.vsb.gmdl.utils.Constants; ->>>>>>> new-gm-api public class WarGenerator { private WebArchive archive = null; diff --git a/binding-components/pom.xml b/binding-components/pom.xml index 87131b8fb14955ba1b18dfdd350c3969ef1a88e1..c26c06cde1af86d1cf64458ab485945aca527ddc 100644 --- a/binding-components/pom.xml +++ b/binding-components/pom.xml @@ -11,13 +11,10 @@ <description>Manual binding components for various services, using the VSB libraries</description> <packaging>pom</packaging> <modules> -<<<<<<< HEAD - <module>bc-gui</module> + <!-- <module>bc-gui</module> <module>weather-bc</module> <module>rest-bc</module> -======= - <module>examples</module> + <module>examples</module> --> <module>one-way-bc</module> ->>>>>>> new-gm-api </modules> </project> \ No newline at end of file diff --git a/gmdl-tools/pom.xml b/gmdl-tools/pom.xml index 4fa3cb227993e26bf9066652eccf1c690a0d8cbc..d3d244f9b95d93ad62e542e1b6ec391e64442eb1 100644 --- a/gmdl-tools/pom.xml +++ b/gmdl-tools/pom.xml @@ -27,10 +27,7 @@ <module>service-parser</module> <module>wadl2gmdl</module> <module>wsdl2gmdl</module> -<<<<<<< HEAD -======= <module>monitor</module> <module>experiment</module> ->>>>>>> new-gm-api </modules> </project> \ No newline at end of file diff --git a/playgrounds/client-server/rest-playground/src/test/java/eu/chorevolution/vsb/playgrounds/clientserver/rest/RestClientExample.java b/playgrounds/client-server/rest-playground/src/test/java/eu/chorevolution/vsb/playgrounds/clientserver/rest/RestClientExample.java index 1195a99f7b8ed546260bb3953170709a9e404319..34853417fe0d544275844b734538fa22684c2ca2 100644 --- a/playgrounds/client-server/rest-playground/src/test/java/eu/chorevolution/vsb/playgrounds/clientserver/rest/RestClientExample.java +++ b/playgrounds/client-server/rest-playground/src/test/java/eu/chorevolution/vsb/playgrounds/clientserver/rest/RestClientExample.java @@ -19,16 +19,8 @@ public class RestClientExample { obj.put("lon", "57.7361989724"); obj.put("op_name", "bridgeNextClosure"); String content = obj.toJSONString(); -<<<<<<< HEAD:playgrounds/client-server/rest-playground/src/test/java/eu/chorevolution/vsb/playgrounds/clientserver/restclient/RestClientExample.java - String url = "http://127.0.0.1:8891/interface"; - - Response resp = RestClientExample.post(url, content); - -======= String url = "http://localhost:8080"; Response resp = RestClientExample.post(url, content); ->>>>>>> new-gm-api:playgrounds/client-server/rest-playground/src/test/java/eu/chorevolution/vsb/playgrounds/clientserver/rest/RestClientExample.java - System.out.println(resp.getEntityAsText()); } diff --git a/protocol-pool/gm-coap/pom.xml b/protocol-pool/gm-coap/pom.xml index 63401f28fff64c2558b60cacda17304ab74c0af0..807b370a9b76494101af06b5d595ae519a8afc92 100644 --- a/protocol-pool/gm-coap/pom.xml +++ b/protocol-pool/gm-coap/pom.xml @@ -55,14 +55,10 @@ <artifactId>californium-osgi</artifactId> <version>1.0.4</version> </dependency> -<<<<<<< HEAD -======= <dependency> <groupId>eu.chorevolution.vsb</groupId> <artifactId>monitor</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> - ->>>>>>> new-gm-api </dependencies> </project> diff --git a/protocol-pool/pom.xml b/protocol-pool/pom.xml index a9b7e4ceb3f0a984157e44080d41769f17870241..89960a54407b75e3bf2389a963217c2fef762151 100644 --- a/protocol-pool/pom.xml +++ b/protocol-pool/pom.xml @@ -14,12 +14,8 @@ <module>gm-soap</module> <module>gm-mqtt</module> <module>gm-coap</module> -<<<<<<< HEAD -<!-- <module>gm-dpws</module> --> -======= <module>gm-dpws</module> <module>gm-websocket</module> ->>>>>>> new-gm-api </modules> <dependencies> <!-- Chorevolution --> diff --git a/scenarios-end-to-end-test/pom.xml b/scenarios-end-to-end-test/pom.xml index 4d1f79b538dc852d485d2445e56e2a5d3961d5fc..e4a025a48e6caef91754f02075bbcec88425bb9a 100644 --- a/scenarios-end-to-end-test/pom.xml +++ b/scenarios-end-to-end-test/pom.xml @@ -126,11 +126,6 @@ <version>2.3.1</version> </dependency> <!-- JSON parsing & Mapping --> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - <version>2.6.2</version> - </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-jxc</artifactId> diff --git a/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/RestLegacyServiceMock.java b/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/RestLegacyServiceMock.java index 3b7c3060b0ee405c7d391dac1f307207da606234..a073b36738df24a14bcd408072b2ffcdb9618b42 100644 --- a/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/RestLegacyServiceMock.java +++ b/scenarios-end-to-end-test/src/main/java/eu/chorevolution/vsb/test/trafficlight/mock/RestLegacyServiceMock.java @@ -12,7 +12,7 @@ import java.util.logging.Logger; import eu.chorevolution.vsb.test.trafficlight.mock.restservice.JaxRsTrafficLightResource; public class RestLegacyServiceMock { -<<<<<<< HEAD + // private static final URI BASE_URI = URI.create("http://localhost:8282/"); // public static final String ROOT_PATH = "traffic-lights"; // @@ -35,30 +35,4 @@ public class RestLegacyServiceMock { // Logger.getLogger(RestLegacyServiceMock.class.getName()).log(Level.SEVERE,null, ex); // } // } -======= - private static final URI BASE_URI = URI.create("http://localhost:8282/"); - public static final String ROOT_PATH = "traffic-lights"; - - public static void main(String[] args) { - try{ - - final ResourceConfig resourceConfig = new ResourceConfig(JaxRsTrafficLightResource.class); - final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, resourceConfig, false); - Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { - @Override - public void run() { - server.shutdownNow(); - } - })); - server.start(); - - System.out.println(String.format("Application started.\nTry out %s%s\nStop the application using CTRL+C", BASE_URI, ROOT_PATH)); - Thread.currentThread().join(); - - } catch (IOException | InterruptedException ex){ - - Logger.getLogger(RestLegacyServiceMock.class.getName()).log(Level.SEVERE,null, ex); - } - } ->>>>>>> new-gm-api } \ No newline at end of file diff --git a/vsb-manager-service-bundle/pom.xml b/vsb-manager-service-bundle/pom.xml index 3d8a4ab2e09fa351fd6a3c8a11dc9d0e41b3b4c5..7b7324abfd68d955c42695bc2e0fddf1f7065e29 100644 --- a/vsb-manager-service-bundle/pom.xml +++ b/vsb-manager-service-bundle/pom.xml @@ -56,7 +56,7 @@ <groupId>eu.chorevolution.vsb</groupId> <artifactId>vsb-manager</artifactId> <version>0.0.1-SNAPSHOT</version> - <classifier>jar-with-dependencies</classifier> + <!-- <classifier>jar-with-dependencies</classifier> --> </dependency> <dependency> <groupId>junit</groupId> diff --git a/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.java b/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.java index 751fd23edec49134c0544f91bcb56aabf52a83fb..c55c2f2d09446dd531e48bb6ab2680890ac9f851 100644 --- a/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.java +++ b/vsb-manager/src/main/java/eu/chorevolution/vsb/manager/VsbManager.java @@ -72,7 +72,6 @@ public class VsbManager { } } -<<<<<<< HEAD /******************************** * Public method to call ***********************************************/ @@ -80,11 +79,6 @@ public class VsbManager { /** * Returns VsbOutput object which contains the generated 1 byte array of * archive war and 1 array bytes of wsdl file -======= - /** - * Returns VsbOutput object which contains the generated 1 byte array of archive war - * and 1 array bytes of wsdl file ->>>>>>> new-gm-api * <p> * * @param interfaceDescriptionPath @@ -352,7 +346,7 @@ public class VsbManager { File classDir = new File(Constants.generatedCodePath); // Array of imported classes -<<<<<<< HEAD + Class[] classes = new Class[] { BcManagerRestService.class, BcGmSubcomponent.class, BcGmSubcomponent.class, @@ -361,16 +355,7 @@ public class VsbManager { String[] compileOptions = new String[] { "-d", classDir.getAbsolutePath(), "-cp", PathResolver.myClassPath(classes) }; -======= - Class[] classes = new Class[]{ - - BcManagerRestService.class, BcGmSubcomponent.class,BcGmSubcomponent.class, - BcRestSubcomponent.class, BcSoapSubcomponent.class,ServiceDescriptionParser.class,BcConfiguration.class - }; - - - String[] compileOptions = new String[]{"-d", classDir.getAbsolutePath(),"-cp", PathResolver.myClassPath(classes)} ; ->>>>>>> new-gm-api + Iterable<String> compilationOptions = Arrays.asList(compileOptions); CompilationTask compilerTask = compiler.getTask(null, fileManager, null, compilationOptions, null, javaObjects); @@ -419,7 +404,6 @@ public class VsbManager { } } -<<<<<<< HEAD private static List<JavaFileObject> scanRecursivelyForJavaFiles(File dir, StandardJavaFileManager fileManager) { List<JavaFileObject> javaObjects = new LinkedList<JavaFileObject>(); File[] files = dir.listFiles(); @@ -447,35 +431,6 @@ public class VsbManager { private static void generateBindingComponentClass(GmServiceRepresentation gmServiceRepresentation, ProtocolType busProtocol) { -======= - private static List<JavaFileObject> scanRecursivelyForJavaFiles(File dir, StandardJavaFileManager fileManager) { - List<JavaFileObject> javaObjects = new LinkedList<JavaFileObject>(); - File[] files = dir.listFiles(); - for (File file : files){ - if (file.isDirectory()) { - javaObjects.addAll(scanRecursivelyForJavaFiles(file, fileManager)); - } - else if (file.isFile() && file.getName().toLowerCase().endsWith(".java")) { - javaObjects.add(readJavaObject(file, fileManager)); - } - } - return javaObjects; - } - - - private static JavaFileObject readJavaObject(File file, StandardJavaFileManager fileManager) { - Iterable<? extends JavaFileObject> javaFileObjects = fileManager.getJavaFileObjects(file); - Iterator<? extends JavaFileObject> it = javaFileObjects.iterator(); - if (it.hasNext()) { - return it.next(); - } - throw new RuntimeException("Could not load " + file.getAbsolutePath() + " java file object"); - } - - private static void generateBindingComponentClass(GmServiceRepresentation gmServiceRepresentation, ProtocolType busProtocol) { - - ->>>>>>> new-gm-api String configTemplatePath = ""; JSONParser parser = new JSONParser(); JSONObject jsonObject = null; @@ -556,14 +511,9 @@ public class VsbManager { extension = interfaceDescPieces[interfaceDescPieces.length - 1]; JInvocation getInterfaceRepresentation = null; -<<<<<<< HEAD + switch (extension) { -======= - System.out.println(" extension "+extension); - switch(extension){ - ->>>>>>> new-gm-api case "gmdl": getInterfaceRepresentation = serviceDescriptionClass.staticInvoke("getRepresentationFromGMDL") .arg(interfaceDescriptionPathVar); @@ -595,24 +545,13 @@ public class VsbManager { GmServiceRepresentationVar.invoke("getInterfaces").invoke("get").arg(ivar)); JClass RoleTypeClass = jCodeModel.ref(eu.chorevolution.vsb.gmdl.utils.enums.RoleType.class); -<<<<<<< HEAD - JClass BcRestSubcomponentClass = jCodeModel - .ref(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class); - JClass BcSoapSubcomponentClass = jCodeModel - .ref(eu.chorevolution.vsb.gm.protocols.soap.BcSoapSubcomponent.class); - JClass BcMQTTSubcomponentClass = jCodeModel - .ref(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class); - JClass BcCoapSubcomponentClass = jCodeModel - .ref(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class); - -======= + JClass BcRestSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.rest.BcRestSubcomponent.class); JClass BcSoapSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.soap.BcSoapSubcomponent.class); JClass BcMQTTSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.mqtt.BcMQTTSubcomponent.class); JClass BcCoapSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.coap.BcCoapSubcomponent.class); JClass BcDpwsSubcomponentClass = jCodeModel.ref(eu.chorevolution.vsb.gm.protocols.dpws.BcDPWSSubcomponent.class); - ->>>>>>> new-gm-api + JClass BcConfigurationClass = jCodeModel.ref(eu.chorevolution.vsb.gmdl.utils.BcConfiguration.class); JClass SystemClass = jCodeModel.ref(System.class); @@ -668,14 +607,8 @@ public class VsbManager { .plus(JExpr._new(StringClass).arg("config")).plus(FileClass.staticRef("separator")) .plus(JExpr._new(StringClass).arg("config_block2_interface_")) .plus(jCodeModel.ref(java.lang.String.class).staticInvoke("valueOf").arg(ivar.plus(intOneVar)))); - forBlock.add(parseInvocation2); -<<<<<<< HEAD - + forBlock.add(parseInvocation2); switch (busProtocol) { -======= - System.out.println(" busProtocol "+busProtocol); - switch(busProtocol) { ->>>>>>> new-gm-api case REST: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) createConfigFile(ProtocolType.REST, Constants.webapp_src_artifact + File.separator + "config" @@ -725,13 +658,8 @@ public class VsbManager { default: break; } -<<<<<<< HEAD - switch (gmServiceRepresentation.getProtocol()) { -======= - - System.out.println(" gmServiceRepresentation.getProtocol() "+gmServiceRepresentation.getProtocol()); switch(gmServiceRepresentation.getProtocol()){ ->>>>>>> new-gm-api + case REST: for (int i = 1; i <= gmServiceRepresentation.getInterfaces().size(); i++) createConfigFile(ProtocolType.REST, Constants.webapp_src_artifact + File.separator + "config" @@ -761,9 +689,6 @@ public class VsbManager { forBlock.assign(JExpr.ref("subcomponent[i][1]"), JExpr._new(BcCoapSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); break; -<<<<<<< HEAD - -======= case DPWS: for(int i=1; i<=gmServiceRepresentation.getInterfaces().size(); i++) @@ -771,7 +696,7 @@ public class VsbManager { forBlock.assign(JExpr.ref("subcomponent[i][1]"), JExpr._new(BcDpwsSubcomponentClass).arg(bcConfig2Var).arg(GmServiceRepresentationVar)); break; ->>>>>>> new-gm-api + case JMS: break; case PUB_NUB: @@ -913,13 +838,9 @@ public class VsbManager { e.printStackTrace(); } -<<<<<<< HEAD if (protocol == ProtocolType.SOAP) { -======= - if(protocol==ProtocolType.SOAP){ - ->>>>>>> new-gm-api + jsonObject.put("target_namespace", Constants.target_namespace); jsonObject.put("service_name", Constants.soap_service_name); jsonObject.put("subcomponent_port", Constants.service_port); diff --git a/vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java b/vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java index 73c6dce522bde1c83229d206295ac4fb49b2e35f..86a2c4fdaaf26f411167124d027415edd53b4ec8 100644 --- a/vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java +++ b/vsb-manager/src/test/java/eu/chorevolution/vsb/manager/VsbManagerTest.java @@ -6,34 +6,9 @@ import eu.chorevolution.vsb.gmdl.utils.enums.ProtocolType; public class VsbManagerTest{ -<<<<<<< HEAD + public static void main(String[] args){ -======= - - String interfaceDescriptionPath = null; - - @Before - public void setUp(){ - - interfaceDescriptionPath = PathResolver.myFilePath(BcManagerRestService.class,"mqtt.gidl"); - } - - @Test - public void generateWarFile(){ - - boolean generateWarFile = true; - try { - - VsbManager vsbm = new VsbManager(); - vsbm.generateWar(interfaceDescriptionPath, ProtocolType.COAP); -// vsbm.deleteGeneratedFiles(); - - } catch (Exception e){ - - generateWarFile = false; - } - //assertTrue(generateWarFile); ->>>>>>> new-gm-api + // String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/urban-traffic-coordination/bindingcomponents/bcDTS-ACCIDENTS/model/dts-accidents.gidl"; // String interfaceDescriptionPath = "/home/pntumba/inria_code/repositories/urban-traffic-coordination/bindingcomponents/bcDTS-WEATHER/model/dts-weather.gidl";