From 468b1719e364d0baadde65a426d1afe09c36b46a Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Fri, 15 Dec 2017 09:02:04 -0500 Subject: [PATCH] Bump to yangtools-2.0.0 and odlparent-3.0.2 This patch also embeds MOXy inside northbound-api in order to deal with javax.ws.rs version mismatch between jersey (1.1.x) and jackson (2.0.1), where MOXy has a revisionless import and hence binding to jackson version -- preventing it from working with jersey; see NEUTRON-154 for full background. Change-Id: I9663ad4df3bae44e9de27ee0c7659cb2e3fa578a Signed-off-by: Tom Pantelis Signed-off-by: Michael Vorburger Signed-off-by: Robert Varga --- .gitignore | 1 + artifacts/pom.xml | 2 +- features/production/features-neutron/pom.xml | 2 +- .../odl-neutron-hostconfig-ovs/pom.xml | 2 +- .../odl-neutron-hostconfig-vpp/pom.xml | 2 +- .../production/odl-neutron-logger/pom.xml | 2 +- .../odl-neutron-northbound-api/pom.xml | 6 +-- .../production/odl-neutron-service/pom.xml | 2 +- features/production/odl-neutron-spi/pom.xml | 2 +- .../odl-neutron-transcriber/pom.xml | 2 +- features/production/pom.xml | 2 +- features/test/features-neutron-test/pom.xml | 2 +- features/test/odl-neutron-logger-test/pom.xml | 2 +- features/test/pom.xml | 2 +- integration/test/pom.xml | 1 - .../neutron/e2etest/ITNeutronE2E.java | 19 ++------- .../neutron/e2etest/NeutronNetworkTests.java | 10 ++--- karaf/pom.xml | 2 +- neutron-hostconfig/pom.xml | 2 +- .../utils/NeutronHostconfigUtils.java | 15 ------- .../vpp/NeutronHostconfigVppListener.java | 12 +++--- northbound-api/pom.xml | 40 +++++++++++++++++-- parent/pom.xml | 4 +- 23 files changed, 67 insertions(+), 69 deletions(-) diff --git a/.gitignore b/.gitignore index 6c6cdb3bc..a2903aeaf 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ target-ide/ yang-gen-config yang-gen-sal maven-metadata-local.xml +.factorypath diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 61fc838af..a25aac992 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent odlparent-lite - 2.0.5 + 3.0.2 4.0.0 diff --git a/features/production/features-neutron/pom.xml b/features/production/features-neutron/pom.xml index 37c2fa379..d7dc491ec 100644 --- a/features/production/features-neutron/pom.xml +++ b/features/production/features-neutron/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent feature-repo-parent - 2.0.5 + 3.0.2 diff --git a/features/production/odl-neutron-hostconfig-ovs/pom.xml b/features/production/odl-neutron-hostconfig-ovs/pom.xml index a3e4159f7..f4e27ef60 100644 --- a/features/production/odl-neutron-hostconfig-ovs/pom.xml +++ b/features/production/odl-neutron-hostconfig-ovs/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent single-feature-parent - 2.0.5 + 3.0.2 diff --git a/features/production/odl-neutron-hostconfig-vpp/pom.xml b/features/production/odl-neutron-hostconfig-vpp/pom.xml index f2a563fce..1a56a82fc 100644 --- a/features/production/odl-neutron-hostconfig-vpp/pom.xml +++ b/features/production/odl-neutron-hostconfig-vpp/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent single-feature-parent - 2.0.5 + 3.0.2 diff --git a/features/production/odl-neutron-logger/pom.xml b/features/production/odl-neutron-logger/pom.xml index 025a3a4cf..a42c0b7e6 100644 --- a/features/production/odl-neutron-logger/pom.xml +++ b/features/production/odl-neutron-logger/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent single-feature-parent - 2.0.5 + 3.0.2 diff --git a/features/production/odl-neutron-northbound-api/pom.xml b/features/production/odl-neutron-northbound-api/pom.xml index 39c444824..f993d5171 100644 --- a/features/production/odl-neutron-northbound-api/pom.xml +++ b/features/production/odl-neutron-northbound-api/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent single-feature-parent - 2.0.5 + 3.0.2 @@ -58,10 +58,6 @@ com.sun.jersey jersey-servlet - - org.eclipse.persistence - org.eclipse.persistence.moxy - org.eclipse.persistence org.eclipse.persistence.core diff --git a/features/production/odl-neutron-service/pom.xml b/features/production/odl-neutron-service/pom.xml index 8c726bfd1..9ca1ae64f 100644 --- a/features/production/odl-neutron-service/pom.xml +++ b/features/production/odl-neutron-service/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent single-feature-parent - 2.0.5 + 3.0.2 diff --git a/features/production/odl-neutron-spi/pom.xml b/features/production/odl-neutron-spi/pom.xml index 133f7cd25..0ff695f8d 100644 --- a/features/production/odl-neutron-spi/pom.xml +++ b/features/production/odl-neutron-spi/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent single-feature-parent - 2.0.5 + 3.0.2 diff --git a/features/production/odl-neutron-transcriber/pom.xml b/features/production/odl-neutron-transcriber/pom.xml index d1d01f491..fab42be07 100644 --- a/features/production/odl-neutron-transcriber/pom.xml +++ b/features/production/odl-neutron-transcriber/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent single-feature-parent - 2.0.5 + 3.0.2 diff --git a/features/production/pom.xml b/features/production/pom.xml index 04cbc370b..6a4bd0c33 100644 --- a/features/production/pom.xml +++ b/features/production/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 2.0.5 + 3.0.2 diff --git a/features/test/features-neutron-test/pom.xml b/features/test/features-neutron-test/pom.xml index 553ee52e8..ad9a786a8 100644 --- a/features/test/features-neutron-test/pom.xml +++ b/features/test/features-neutron-test/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent feature-repo-parent - 2.0.5 + 3.0.2 diff --git a/features/test/odl-neutron-logger-test/pom.xml b/features/test/odl-neutron-logger-test/pom.xml index 2159d2861..9e39159d3 100644 --- a/features/test/odl-neutron-logger-test/pom.xml +++ b/features/test/odl-neutron-logger-test/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent single-feature-parent - 2.0.5 + 3.0.2 diff --git a/features/test/pom.xml b/features/test/pom.xml index 869380130..0698dd668 100644 --- a/features/test/pom.xml +++ b/features/test/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 2.0.5 + 3.0.2 diff --git a/integration/test/pom.xml b/integration/test/pom.xml index 0d7e26bfc..8fd5644ee 100644 --- a/integration/test/pom.xml +++ b/integration/test/pom.xml @@ -11,7 +11,6 @@ org.opendaylight.neutron integration-test 0.10.0-SNAPSHOT - bundle diff --git a/integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java index 564a7d290..2a1456061 100644 --- a/integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java +++ b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/ITNeutronE2E.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.neutron.e2etest; import static org.ops4j.pax.exam.CoreOptions.maven; @@ -40,30 +39,16 @@ import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel; import org.ops4j.pax.exam.options.MavenUrlReference; import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - @RunWith(PaxExam.class) @ExamReactorStrategy(PerClass.class) public class ITNeutronE2E extends AbstractMdsalTestBase { - private static final Logger LOG = LoggerFactory.getLogger(ITNeutronE2E.class); private static final String KARAF_DEBUG_PORT = "5005"; private static final String KARAF_DEBUG_PROP = "karaf.debug"; final String base = "http://127.0.0.1:8181/controller/nb/v2/neutron"; - @Override - public String getKarafDistro() { - return maven() - .groupId("org.opendaylight.neutron") - .artifactId("neutron-karaf") - .versionAsInProject() - .type("zip") - .getURL(); - } - @Override public MavenUrlReference getFeatureRepo() { return maven() @@ -79,6 +64,7 @@ public class ITNeutronE2E extends AbstractMdsalTestBase { return "odl-neutron-logger-test"; } + @Override @Configuration public Option[] config() { Option[] options = super.config(); @@ -282,7 +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.isJsonArray()); + Assert.assertTrue("E2E Tests Failed - Collection not Array: " + jsonElementValue, + jsonElementValue.isJsonArray()); JsonArray jsonArray = jsonElementValue.getAsJsonArray(); Assert.assertNotEquals(context, jsonArray.size(), 0); } diff --git a/integration/test/src/test/java/org/opendaylight/neutron/e2etest/NeutronNetworkTests.java b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/NeutronNetworkTests.java index 7175f5013..eee371a15 100644 --- a/integration/test/src/test/java/org/opendaylight/neutron/e2etest/NeutronNetworkTests.java +++ b/integration/test/src/test/java/org/opendaylight/neutron/e2etest/NeutronNetworkTests.java @@ -31,29 +31,27 @@ public class NeutronNetworkTests { } public void network_collection_get_test_with_wait() throws IOException, InterruptedException { - String urlS = base + "/networks"; + URL url = new URL(base + "/networks"); for (int retry = 0; retry < TIMEOUT; retry++) { - URL url = new URL(urlS); HttpURLConnection httpConn = ITNeutronE2E.httpURLConnectionFactoryGet(url); int responseCode; try { responseCode = httpConn.getResponseCode(); } catch (ConnectException e) { - LOG.info("connection " + Integer.toString(retry) + ": failed", e); + LOG.info("connection trial {} failed to URL {}", retry, url, e); Thread.sleep(1000); continue; } if (responseCode != 200) { - LOG.info("trial " + Integer.toString(retry) + ": failed with: " - + Integer.toString(httpConn.getResponseCode())); + LOG.info("trial {} to URL {} failed with {}", retry, url, httpConn.getResponseCode()); Thread.sleep(1000); } else { Assert.assertEquals("Network Collection GET failed", 200, httpConn.getResponseCode()); return; } } - Assert.assertFalse("Network Collection GET with wait failed", true); + Assert.assertFalse("Network Collection GET to URL " + url + " with wait failed", true); } //TODO handle SB check diff --git a/karaf/pom.xml b/karaf/pom.xml index e5977bb71..337067449 100644 --- a/karaf/pom.xml +++ b/karaf/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.odlparent karaf4-parent - 2.0.5 + 3.0.2 4.0.0 diff --git a/neutron-hostconfig/pom.xml b/neutron-hostconfig/pom.xml index 332093cf3..8c297417b 100644 --- a/neutron-hostconfig/pom.xml +++ b/neutron-hostconfig/pom.xml @@ -6,7 +6,7 @@ org.opendaylight.odlparent odlparent - 2.0.5 + 3.0.2 diff --git a/neutron-hostconfig/utils/src/main/java/org/opendaylight/neutron/hostconfig/utils/NeutronHostconfigUtils.java b/neutron-hostconfig/utils/src/main/java/org/opendaylight/neutron/hostconfig/utils/NeutronHostconfigUtils.java index fcab6e31c..c42aa0d40 100644 --- a/neutron-hostconfig/utils/src/main/java/org/opendaylight/neutron/hostconfig/utils/NeutronHostconfigUtils.java +++ b/neutron-hostconfig/utils/src/main/java/org/opendaylight/neutron/hostconfig/utils/NeutronHostconfigUtils.java @@ -8,9 +8,6 @@ package org.opendaylight.neutron.hostconfig.utils; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.concurrent.ExecutionException; import org.opendaylight.controller.md.sal.binding.api.DataBroker; @@ -80,16 +77,4 @@ public class NeutronHostconfigUtils { return InstanceIdentifier.create(Neutron.class).child(Hostconfigs.class) .child(Hostconfig.class, hostconfig.getKey()); } - - /** - * Used for parsing model revisions. - */ - public static Date parseDate(final String strDate) { - final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - try { - return formatter.parse(strDate); - } catch (final ParseException e) { - throw new IllegalArgumentException("Date " + strDate + " not valid.", e); - } - } } diff --git a/neutron-hostconfig/vpp/src/main/java/org/opendaylight/neutron/hostconfig/vpp/NeutronHostconfigVppListener.java b/neutron-hostconfig/vpp/src/main/java/org/opendaylight/neutron/hostconfig/vpp/NeutronHostconfigVppListener.java index fb40b2ac4..7faa9aaa0 100644 --- a/neutron-hostconfig/vpp/src/main/java/org/opendaylight/neutron/hostconfig/vpp/NeutronHostconfigVppListener.java +++ b/neutron-hostconfig/vpp/src/main/java/org/opendaylight/neutron/hostconfig/vpp/NeutronHostconfigVppListener.java @@ -9,7 +9,6 @@ package org.opendaylight.neutron.hostconfig.vpp; import com.google.common.base.Preconditions; - import java.net.URI; import java.util.ArrayList; import java.util.Collection; @@ -19,9 +18,7 @@ import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.stream.Collectors; - import javax.annotation.Nonnull; - import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.DataObjectModification; @@ -41,6 +38,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Revision; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,15 +53,15 @@ public class NeutronHostconfigVppListener implements ClusteredDataTreeChangeList private static final TopologyId TOPOLOGY_NETCONF = new TopologyId("topology-netconf"); private static final QName V3PO_1704_CAPABILITY = QName.create( URI.create("urn:opendaylight:params:xml:ns:yang:v3po"), - NeutronHostconfigUtils.parseDate("2017-03-15"), "v3po"); + Revision.of("2017-03-15"), "v3po"); private static final QName V3PO_1701_CAPABILITY = QName.create( URI.create("urn:opendaylight:params:xml:ns:yang:v3po"), - NeutronHostconfigUtils.parseDate("2016-12-14"), "v3po"); + Revision.of("2016-12-14"), "v3po"); private static final QName INTERFACES_CAPABILITY = QName.create(URI.create("urn:ietf:params:xml:ns:yang:ietf-interfaces"), - NeutronHostconfigUtils.parseDate("2014-05-08"), "ietf-interfaces"); + Revision.of("2014-05-08"), "ietf-interfaces"); private static final List REQUIRED_CAPABILITIES = new ArrayList<>(); - private SocketInfo socketInfo; + private final SocketInfo socketInfo; public NeutronHostconfigVppListener(final DataBroker dataBroker, String spath, String sname, String vhostMode) { LOG.info("Initializing Neutron-Hostconfig-Vpp-Listener"); diff --git a/northbound-api/pom.xml b/northbound-api/pom.xml index 1f595c446..ee1ff1155 100644 --- a/northbound-api/pom.xml +++ b/northbound-api/pom.xml @@ -81,12 +81,46 @@ org.opendaylight.aaa.shiro.web.env, org.apache.shiro.web.env, !org.codehaus.enunciate.jaxrs, - javax.validation, - javax.ws.rs.ext, - javax.xml.bind, + + com.sun.xml.bind;resolution:=optional, + com.sun.xml.bind.annotation;resolution:=optional, + com.sun.xml.bind.api;resolution:=optional, + com.sun.xml.bind.api.impl;resolution:=optional, + com.sun.codemodel;resolution:=optional, + com.sun.xml.xsom;resolution:=optional, + com.sun.xml.xsom.impl;resolution:=optional, + com.sun.xml.xsom.impl.parser;resolution:=optional, + com.sun.tools.xjc;resolution:=optional, + com.sun.tools.xjc.model;resolution:=optional, + com.sun.tools.xjc.outline;resolution:=optional, + javax.activation;resolution:=optional, + javax.json;resolution:=optional, + javax.json.stream;resolution:=optional, + javax.naming;resolution:=optional, + javax.validation;resolution:=optional, + javax.validation.constraints;resolution:=optional; + javax.validation.groups;resolution:=optional; + javax.ws.rs;resolution:=optional, + javax.ws.rs.core;resolution:=optional, + javax.ws.rs.ext;resolution:=optional, + javax.xml.namespace;resolution:=optional, + javax.xml.parsers;resolution:=optional, + javax.xml.stream;resolution:=optional, + javax.xml.transform;resolution:=optional, + javax.xml.transform.dom;resolution:=optional, + javax.xml.transform.sax;resolution:=optional, + javax.xml.transform.stax;resolution:=optional, + javax.xml.transform.stream;resolution:=optional, + javax.xml.validation;resolution:=optional, + org.eclipse.persistence.internal.libraries.asm;resolution:=optional, * + /controller/nb/v2/neutron + + + true + org.eclipse.persistence.moxy;inline diff --git a/parent/pom.xml b/parent/pom.xml index b6a84f719..75e10b403 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -8,7 +8,7 @@ org.opendaylight.odlparent odlparent - 2.0.5 + 3.0.2 @@ -26,7 +26,7 @@ 1.4.0-SNAPSHOT src/main/yang-gen-sal 0.12.0-SNAPSHOT - 1.2.0 + 2.0.0 2013.09.07.12.0-SNAPSHOT target/jacoco.exec ../target/jacoco-it.exec -- 2.36.6