Cleanup package imports 59/1959/1
authorRobert Varga <rovarga@cisco.com>
Thu, 17 Oct 2013 10:02:22 +0000 (12:02 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 17 Oct 2013 10:06:05 +0000 (12:06 +0200)
This removes Import-Package instructions, relying on bundle plugin to
figure them out.

We rework the rib-mock API contract to not rely on static contructor, to
fix one of the failures.

We are removing test-tool bundle integration tests, as these should be
switched to jars.

Change-Id: Ia2ed528ae3d10975e6b99b88414e1b982b70804b
Signed-off-by: Robert Varga <rovarga@cisco.com>
18 files changed:
bgp/concepts/pom.xml
bgp/parser-api/pom.xml
bgp/parser-mock/pom.xml
bgp/parser-spi/pom.xml
bgp/rib-mock/pom.xml
bgp/rib-mock/src/main/java/org/opendaylight/protocol/bgp/rib/mock/BGPMock.java
bgp/rib-spi/pom.xml
bgp/util/pom.xml
concepts/pom.xml
framework/pom.xml
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpRibSpiBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpTesttoolBundleTest.java [deleted file]
integration-tests/src/test/java/org/opendaylight/protocol/integration/PcepImplBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/PcepSpiBundleTest.java
integration-tests/src/test/java/org/opendaylight/protocol/integration/PcepTesttoolBundleTest.java [deleted file]
pcep/impl/pom.xml
pcep/spi/pom.xml
util/pom.xml

index a6bdfbe73de724e064bf313a03e1509240fff7b3..860526ecf62a7a8ecef8a17996214abfe8477ad4 100644 (file)
                             org.opendaylight.protocol.bgp.concepts,
                             org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.*,
                                                </Export-Package>
-                                               <Import-Package>
-                                                       com.google.common.base,
-                                                       org.opendaylight.protocol.concepts,
-                            org.opendaylight.yang.gen.v1.*,
-                            org.opendaylight.yangtools.yang.binding
-                                               </Import-Package>
                                        </instructions>
                                </configuration>
                        </plugin>
index 4e123d15867200f21a4264d648befd0616f0777b..910b45312d57da4ba5c427bd4c2516405a5764f3 100644 (file)
                                <configuration>
                                        <instructions>
                                                <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                                               <Import-Package>
-                                                       com.google.common.base,
-                                                       com.google.common.collect,
-                                                       com.google.common.primitives,
-                                                       org.opendaylight.protocol.concepts,
-                                                       org.opendaylight.protocol.framework,
-                                                       org.opendaylight.protocol.util,
-                                                       org.slf4j,
-                                               </Import-Package>
                                                <Export-Package>
                             org.opendaylight.protocol.bgp.parser,
                             org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130918.*,
index 0cf4b32e83f163922dde04cea4f2fb14260982c0..ffa7981f8a3c08474e71f6de5aa583674b6354db 100644 (file)
                                                <Export-Package>
                                                        org.opendaylight.protocol.bgp.parser.mock
                                                </Export-Package>
-                                               <Import-Package>
-                                                       org.opendaylight.protocol.bgp.parser,
-                                                       org.opendaylight.protocol.framework,
-                                                       org.opendaylight.protocol.concepts
-                                               </Import-Package>
                                        </instructions>
                                </configuration>
                        </plugin>
index 8975be78d43ef1bc43358f2d5ccda1801be226f6..8b0309b1e8ac2e19744ba543fb77689a9d999455 100644 (file)
                                                <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
                                                <Export-Package>
                             org.opendaylight.protocol.bgp.parser.spi,
-                                               </Export-Package>
+                            org.opendaylight.protocol.bgp.parser.spi.osgi,
+                        </Export-Package>
+                        <Private-Package>
+                            org.opendaylight.protocol.bgp.parser.spi.pojo,
+                        </Private-Package>
                                        </instructions>
                                </configuration>
                        </plugin>
index c6440b7f1f8d3f1204b0265504f006d4465dc5f0..bd252f6fa7600d93b7971e12a37644e9b292e13e 100644 (file)
                                                <Export-Package>
                                                        org.opendaylight.protocol.bgp.rib.mock,
                                                </Export-Package>
-                                               <Import-Package>
-                                                       com.google.common.*,
-                                                       org.opendaylight.protocol.bgp.parser,
-                            org.opendaylight.protocol.bgp.parser.impl,
-                            org.opendaylight.protocol.bgp.rib.impl,
-                                                       org.opendaylight.protocol.concepts,
-                                                       org.opendaylight.protocol.framework,
-                            org.opendaylight.protocol.util,
-                                                       org.slf4j,
-                                               </Import-Package>
                                        </instructions>
                                </configuration>
                        </plugin>
index c4fe9488d60b18e54cf43e294a0dabf039f56bfb..4889114acc69b6a86594a4bbb8a326fdecdc9437 100644 (file)
@@ -18,7 +18,7 @@ import javax.annotation.concurrent.ThreadSafe;
 import org.opendaylight.protocol.bgp.parser.BGPError;
 import org.opendaylight.protocol.bgp.parser.BGPSessionListener;
 import org.opendaylight.protocol.bgp.parser.impl.BGPMessageFactoryImpl;
-import org.opendaylight.protocol.bgp.parser.impl.SingletonProviderContext;
+import org.opendaylight.protocol.bgp.parser.spi.MessageRegistry;
 import org.opendaylight.protocol.bgp.rib.impl.BGP;
 import org.opendaylight.protocol.concepts.ListenerRegistration;
 import org.opendaylight.protocol.framework.DeserializerException;
@@ -45,18 +45,19 @@ public final class BGPMock implements BGP, Closeable {
        private final List<byte[]> allPreviousByteMessages;
        private final List<Notification> allPreviousBGPMessages;
        private final EventBus eventBus;
+
        @GuardedBy("this")
        private final List<EventBusRegistration> openRegistrations = Lists.newLinkedList();
 
-       public BGPMock(final EventBus eventBus, final List<byte[]> bgpMessages) {
+       public BGPMock(final EventBus eventBus, final MessageRegistry registry, final List<byte[]> bgpMessages) {
                this.allPreviousByteMessages = Lists.newLinkedList(bgpMessages);
                this.eventBus = eventBus;
-               this.allPreviousBGPMessages = this.parsePrevious(this.allPreviousByteMessages);
+               this.allPreviousBGPMessages = this.parsePrevious(registry, this.allPreviousByteMessages);
        }
 
-       private List<Notification> parsePrevious(final List<byte[]> msgs) {
+       private List<Notification> parsePrevious(final MessageRegistry registry, final List<byte[]> msgs) {
                final List<Notification> messages = Lists.newArrayList();
-               final ProtocolMessageFactory<Notification> parser = new BGPMessageFactoryImpl(SingletonProviderContext.getInstance().getMessageRegistry());
+               final ProtocolMessageFactory<Notification> parser = new BGPMessageFactoryImpl(registry);
                try {
                        for (final byte[] b : msgs) {
 
index 98347b430c425cfe738793f8d1bfda43fae5e08f..342c5988231f313736b138b6a4d44f2078c2d0df 100644 (file)
@@ -70,9 +70,6 @@
                                <configuration>
                                        <instructions>
                                                <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                        <Import-Package>
-                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130918.*,
-                                               </Import-Package>
                                                <Export-Package>
                                                        org.opendaylight.protocol.bgp.rib.spi
                                                </Export-Package>
index 66089cccd5eb2dccdbb49297c0228b59e7420a0e..bc13fe58201326d1418f3bb1f72a85947c5b1e91 100644 (file)
                                                <Export-Package>
                                                        org.opendaylight.protocol.bgp.util,
                                                </Export-Package>
-                                               <Import-Package>
-                                                       org.opendaylight.protocol.bgp.concepts,
-                                                       org.opendaylight.protocol.bgp.parser,
-                                                       org.opendaylight.protocol.concepts,
-                            org.opendaylight.protocol.util,
-                                                       com.google.common.*, 
-                                                       org.apache.commons.*,
-                                                       org.slf4j
-                                               </Import-Package>
                                        </instructions>
                                </configuration>
                        </plugin>
index b9e897f7a53ef5347bb6a5da243cc3ee4dd639ca..8df83d8bf9fac123e154c346b5a37369bee728be 100644 (file)
                                <configuration>
                                        <instructions>
                                                <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                                               <Import-Package>
-                            org.opendaylight.protocol.util,
-                            com.google.common.base,
-                            com.google.common.collect,
-                            com.google.common.net,
-                            com.google.common.primitives,
-                                               </Import-Package>
                                                <Export-Package>
                             org.opendaylight.protocol.concepts,
                             org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.*,
index 89404be8740bc8caa939fae504610040ba8fc571..d841a3ca26c541870094dbca2ad85582e0d0274d 100644 (file)
                                <configuration>
                                        <instructions>
                                                <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                                               <Import-Package>
-                                                       com.google.common.base,
-                                                       com.google.common.collect,
-                                                       org.opendaylight.protocol.concepts,
-                                                       org.slf4j,
-                            javax.net.ssl,
-                            org.opendaylight.protocol.util,
-                                                       javax.annotation,
-                                                       javax.management,
-                                                       io.netty.*,
-                                               </Import-Package>
                                                <Export-Package>
                                                        org.opendaylight.protocol.framework,
                                                </Export-Package>
index 83533f17cd1c9e7b6ea3df7c9895a87ff7262a8d..26c628d13572c43ed7e93c38dd37e7b184b20ddc 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class BgpRibSpiBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("bgp-parser-api", "bgp-rib-api", "concepts", "framework", "util");
+               return Lists.newArrayList("bgp-concepts", "bgp-parser-api", "bgp-rib-api", "concepts", "framework", "util");
        }
 
        @Override
diff --git a/integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpTesttoolBundleTest.java b/integration-tests/src/test/java/org/opendaylight/protocol/integration/BgpTesttoolBundleTest.java
deleted file mode 100644 (file)
index d3bb834..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.protocol.integration;
-
-import java.util.Collection;
-
-import com.google.common.collect.Lists;
-
-public final class BgpTesttoolBundleTest extends AbstractBundleTest {
-       @Override
-       protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("bgp-parser-api", "bgp-concepts", "bgp-linkstate",
-                               "bgp-parser-impl", "bgp-parser-spi", "bgp-util", "concepts",
-                               "framework", "bgp-rib-api", "bgp-rib-impl", "bgp-rib-spi",
-                               "rsvp-api", "util");
-       }
-
-       @Override
-       protected Collection<String> requiredBundles() {
-               return Lists.newArrayList("bgp-testtool");
-       }
-}
index 2f128175fc2b3bc2c5f7f684c13cca9d05b9e714..ea3d07020182f09042d6b84dad7b32600ffbd079 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class PcepImplBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "framework", "pcep-api", "rsvp-api", "util");
+               return Lists.newArrayList("concepts", "framework", "pcep-api", "pcep-spi", "rsvp-api", "util");
        }
 
        @Override
index 45b0a4552f75667039ad20f99828bc8ee2070de9..b7dacff7648c7397b3fec34ad3d3d2de241a510c 100644 (file)
@@ -14,7 +14,7 @@ import com.google.common.collect.Lists;
 public final class PcepSpiBundleTest extends AbstractBundleTest {
        @Override
        protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "framework", "pcep-api", "util");
+               return Lists.newArrayList("concepts", "framework", "pcep-api", "rsvp-api", "util");
        }
 
        @Override
diff --git a/integration-tests/src/test/java/org/opendaylight/protocol/integration/PcepTesttoolBundleTest.java b/integration-tests/src/test/java/org/opendaylight/protocol/integration/PcepTesttoolBundleTest.java
deleted file mode 100644 (file)
index 4c6a660..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.protocol.integration;
-
-import java.util.Collection;
-
-import com.google.common.collect.Lists;
-
-public final class PcepTesttoolBundleTest extends AbstractBundleTest {
-       @Override
-       protected Collection<String> prerequisiteBundles() {
-               return Lists.newArrayList("concepts", "framework", "pcep-api", "pcep-impl", "rsvp-api", "util");
-       }
-
-       @Override
-       protected Collection<String> requiredBundles() {
-               return Lists.newArrayList("pcep-testtool");
-       }
-}
index 8cefc89306a99f55b07da1898e8f34fa5022123d..39aa9f233bd0bbf23f2dd1f6fcfddb2eaf9e56ac 100644 (file)
                                <configuration>
                                        <instructions>
                                                <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                                               <Import-Package>
-                                                       org.opendaylight.protocol.concepts,
-                                                       org.opendaylight.protocol.framework,
-                                                       com.google.common.base,
-                                                       com.google.common.collect,
-                                                       com.google.common.primitives,
-                                                       javax.annotation,
-                                                       javax.management,
-                            javax.net.ssl,
-                                                       org.opendaylight.protocol.pcep,
-                                                       org.opendaylight.protocol.pcep.concepts,
-                                                       org.opendaylight.protocol.pcep.message,
-                                                       org.opendaylight.protocol.pcep.object,
-                                                       org.opendaylight.protocol.pcep.subobject,
-                                                       org.opendaylight.protocol.pcep.tlv,
-                            org.opendaylight.protocol.util,
-                                                       org.slf4j,
-                                                       io.netty.channel, 
-                                                       io.netty.util.concurrent,
-                                               </Import-Package>
                                                <Export-Package>
                                                        org.opendaylight.protocol.pcep.impl.*,
                                                </Export-Package>
index 3bac3dab495ff4c22446d65776980724286360cf..6adf2e98ec8dc4bb947b6d4b926c115cd1f7e436 100644 (file)
                        <Export-Package>
                            org.opendaylight.protocol.pcep.spi,
                        </Export-Package>
-                       <Import-Package>
-                           org.opendaylight.protocol.concepts,
-                           org.opendaylight.protocol.framework,
-                           org.opendaylight.protocol.util,
-                           com.google.common.*,
-                           javax.management,
-                           org.slf4j.*
-                       </Import-Package>
                    </instructions>
                </configuration>
            </plugin>
index bb7db8e542009f8727202c662ed722f7ddcce2dd..e6a2c1c44d4607a379419fa57cd0846b9960cdab 100644 (file)
                                <configuration>
                                        <instructions>
                                                <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                                               <Import-Package>
-                            com.google.common.*, 
-                            javax.net.ssl,
-                                               </Import-Package>
                                                <Export-Package>
                                                        org.opendaylight.protocol.util
                                                </Export-Package>