Merge "Remove MOXyJsonProvider from resources"
authorIsaku Yamahata <isaku.yamahata@gmail.com>
Wed, 17 Jan 2018 00:59:43 +0000 (00:59 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 17 Jan 2018 00:59:43 +0000 (00:59 +0000)
features/production/odl-neutron-northbound-api/pom.xml
integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java
neutron-spi/pom.xml
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronObject.java
neutron-spi/src/main/java/org/opendaylight/neutron/spi/NeutronPort.java
neutron-spi/src/test/java/org/opendaylight/neutron/spi/NeutronPortJAXBTest.java
northbound-api/src/main/resources/org/opendaylight/neutron/northbound/api/jaxb.properties [moved from northbound-api/src/main/resources/org/opendaylight/controller/networkconfig/neutron/northbound/jaxb.properties with 100% similarity]
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronPortInterface.java

index f993d5171e9c581fce276a0c1e1775d7150df629..8614ffa122cb183a655e216def2fadae609681a2 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
             <artifactId>northbound-api</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-server</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.enunciate</groupId>
-            <artifactId>enunciate-core-annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-servlet</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.persistence</groupId>
-            <artifactId>org.eclipse.persistence.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.persistence</groupId>
-            <artifactId>org.eclipse.persistence.antlr</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.validation</groupId>
-            <artifactId>validation-api</artifactId>
-        </dependency>
-    </dependencies>
-
+     </dependencies>
 </project>
index 2a14560618095cb68b4fca39732811cbac000fd4..166b01664aed5ef89a5dca649b50b0e339e7a8e8 100644 (file)
@@ -268,8 +268,8 @@ public class ITNeutronE2E  extends AbstractMdsalTestBase {
         JsonElement jsonElementValue = entrySet.iterator().next().getValue();
         String key = entrySet.iterator().next().getKey();
         Assert.assertEquals(context, collectionName, key);
-        Assert.assertTrue("E2E Tests Failed - Collection not Array: " + jsonElementValue,
-                jsonElementValue.isJsonArray());
+        Assert.assertTrue("E2E Tests Failed - Collection not Array: " + jsonElementValue + "; URL: " + urlStr
+                + "; full response: " + response, jsonElementValue.isJsonArray());
         JsonArray jsonArray = jsonElementValue.getAsJsonArray();
         Assert.assertNotEquals(context, jsonArray.size(), 0);
     }
index c6e4d23ef30b02e9d8182b341eb5ba1666c03830..1995ba01c20e9767518d8874942e15cc22a1717d 100644 (file)
        <artifactId>org.eclipse.persistence.moxy</artifactId>
        <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-annotations</artifactId>
-    </dependency>
   </dependencies>
   <build>
     <plugins>
index 5a2c1dcfdbff45909c212898ffdd96761f821c76..cfd4302f5c875babac49b1d65cf8575f3a47909c 100644 (file)
@@ -9,7 +9,6 @@
 
 package org.opendaylight.neutron.spi;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
 import java.io.Serializable;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
@@ -18,6 +17,7 @@ import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -61,7 +61,7 @@ public abstract class NeutronObject<T extends NeutronObject> extends NeutronID
     }
 
     @Override
-    @JsonIgnore
+    @XmlTransient
     public void setTenantID(Uuid tenantID) {
         this.tenantID = tenantID.getValue().replace("-", "");
     }
index 141b41018f1a22cf5392b0a96b2e7e72a899d8d3..f990d371480395ef747ce02f1d207f9f0c7137fa 100644 (file)
@@ -60,6 +60,10 @@ public final class NeutronPort extends NeutronAdminAttributes<NeutronPort> imple
     @XmlElement(namespace = "binding", name = "vif_type")
     String bindingvifType;
 
+    //@XmlElement (name = "binding:profile")
+    @XmlElement(namespace = "binding", name = "profile")
+    String bindingProfile;
+
     //@XmlElement (name = "binding:vif_details")
     @XmlElement(namespace = "binding", name = "vif_details")
     @XmlJavaTypeAdapter(NeutronResourceMapPropertyAdapter.class)
@@ -165,6 +169,14 @@ public final class NeutronPort extends NeutronAdminAttributes<NeutronPort> imple
         this.bindinghostID = bindinghostID;
     }
 
+    public String getProfile() {
+        return bindingProfile;
+    }
+
+    public void setProfile(String newBindingProfile) {
+        this.bindingProfile = newBindingProfile;
+    }
+
     public String getBindingvnicType() {
         return bindingvnicType;
     }
@@ -234,6 +246,9 @@ public final class NeutronPort extends NeutronAdminAttributes<NeutronPort> imple
             case "binding:vif_type":
                 ans.setBindingvifType(this.getBindingvifType());
                 break;
+            case "binding:profile":
+                ans.setProfile(this.getProfile());
+                break;
             case "binding:vif_details":
                 ans.setVIFDetails(new HashMap<>(this.getVIFDetails()));
                 break;
@@ -270,7 +285,8 @@ public final class NeutronPort extends NeutronAdminAttributes<NeutronPort> imple
                 + ", deviceID=" + deviceID + ", deviceOwner=" + deviceOwner + ", tenantID=" + tenantID
                 + ", securityGroups=" + securityGroups + ", allowedAddressPairs" + allowedAddressPairs
                 + ", bindinghostID=" + bindinghostID + ", bindingvnicType=" + bindingvnicType + ", bindingvifType="
-                + bindingvifType + ", vifDetails=" + vifDetails + ", extraDHCPOptions=" + extraDHCPOptions
+                + bindingvifType + ", vifDetails=" + vifDetails + ", bindingProfile=" + bindingProfile
+                + ", extraDHCPOptions=" + extraDHCPOptions
                 + ", portSecurityEnabled=" + portSecurityEnabled + ", qosPolicyId=" + qosPolicyId + "]";
     }
 }
index 6846daa2527f8501580b9fa2cd2824f6ab60657f..e054b4de75e1171e1c6c2ed43fa5b4ff7292eb84 100644 (file)
@@ -24,8 +24,8 @@ public class NeutronPortJAXBTest {
             + "\"extra_dhcp_opts\": [\"\"], " + "\"security_groups\": [\"\"], " + "\"allowed_address_pairs\": [\"\"], "
             + "\"device_id\": \"257614cc-e178-4c92-9c61-3b28d40eca44\", " + "\"device_owner\": \"\", "
             + "\"binding:host_id\": \"\", " + "\"binding:vif_type\": \"unbound\", "
-            + "\"binding:vnic_type\": \"normal\", " + "\"mac_address\": \"fa:16:3e:c9:cb:f0\", "
-            + "\"network_id\": \"e9330b1f-a2ef-4160-a991-169e56ab17f5\", "
+            + "\"binding:vnic_type\": \"normal\", " + "\"binding:profile\": \"{\'capabilities\': [\'switchdev\']}\", "
+            + "\"mac_address\": \"fa:16:3e:c9:cb:f0\", " + "\"network_id\": \"e9330b1f-a2ef-4160-a991-169e56ab17f5\", "
             + "\"id\": \"4e8e5957-649f-477b-9e5b-f1f75b21c03c\" }";
 
     @Test
@@ -97,7 +97,7 @@ public class NeutronPortJAXBTest {
         Assert.assertEquals("NeutronPort JAXB Test 16: Testing device_owner failed", "",
                 neutronObject.getDeviceOwner());
 
-        Assert.assertEquals("NeutronPort JAXB Test 17: Testing binding:host_id failed", "",
-                neutronObject.getBindinghostID());
+        Assert.assertEquals("NeutronPort JAXB Test 17: Testing binding:profile failed",
+                "{\'capabilities\': [\'switchdev\']}", neutronObject.getProfile());
     }
 }
index 44c7d1807ad6513a7c277969803a002b6a370265..68917c6163b38de83376bcd6507cec5791d47024 100644 (file)
@@ -75,6 +75,7 @@ public final class NeutronPortInterface extends AbstractNeutronInterface<Port, P
             }
             result.setVIFDetails(details);
         }
+        result.setProfile(binding.getProfile());
         result.setBindingvifType(binding.getVifType());
         result.setBindingvnicType(binding.getVnicType());
     }
@@ -176,6 +177,9 @@ public final class NeutronPortInterface extends AbstractNeutronInterface<Port, P
         if (neutronPort.getBindingvnicType() != null) {
             bindingBuilder.setVnicType(neutronPort.getBindingvnicType());
         }
+        if (neutronPort.getProfile() != null) {
+            bindingBuilder.setProfile(neutronPort.getProfile());
+        }
 
         final PortSecurityExtensionBuilder portSecurityBuilder = new PortSecurityExtensionBuilder();
         if (neutronPort.getPortSecurityEnabled() != null) {