2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowplugin.openflow.md.it;
12 import org.ops4j.pax.exam.CoreOptions;
13 import org.ops4j.pax.exam.Option;
14 import org.ops4j.pax.exam.options.DefaultCompositeOption;
16 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
22 public abstract class OFPaxOptionsAssistant {
24 /** system property required to enable osgi console and remote debugging, only presence matters */
25 private static final String INSPECT_OSGI = "inspectOsgi";
26 /** default remote debug port */
27 public static final String DEBUG_PORT = "6000";
28 /** base controller package */
29 public static final String CONTROLLER = "org.opendaylight.controller";
30 /** base controller.md package */
31 public static final String CONTROLLER_MD = "org.opendaylight.controller.md";
32 /** OFLibrary package */
33 public static final String OFLIBRARY = "org.opendaylight.openflowjava";
34 /** OFLibrary package */
35 public static final String OFPLUGIN = "org.opendaylight.openflowplugin";
36 /** controller.model package */
37 public static final String CONTROLLER_MODEL = "org.opendaylight.controller.model";
39 public static final String YANGTOOLS = "org.opendaylight.yangtools";
43 * Works only if property -DinspectOsgi is used
44 * @return equinox console setup (in order to inspect running IT through osgi console (telnet))
45 * and remote debugging on port {@link #DEBUG_PORT}
47 public static Option osgiConsoleBundles() {
48 DefaultCompositeOption option = new DefaultCompositeOption();
49 if (System.getProperty(INSPECT_OSGI) != null) {
51 .add(CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address="+DEBUG_PORT))
52 .add(CoreOptions.mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject())
53 .add(CoreOptions.mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject())
54 .add(CoreOptions.mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject())
55 .add(CoreOptions.mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject());
62 * @return OFLibrary bundles
64 public static Option ofLibraryBundles() {
65 return new DefaultCompositeOption(
66 mavenBundle(OFLIBRARY, "util").versionAsInProject(),
67 mavenBundle(OFLIBRARY, "openflow-protocol-impl").versionAsInProject(),
68 mavenBundle(OFLIBRARY, "openflow-protocol-api").versionAsInProject(),
69 mavenBundle(OFLIBRARY, "openflow-protocol-spi").versionAsInProject(),
70 mavenBundle(OFLIBRARY, "simple-client").versionAsInProject().start());
74 * @return OFLibrary + OFPlugin bundles
76 public static Option ofPluginBundles() {
77 return new DefaultCompositeOption(
80 mavenBundle(CONTROLLER_MODEL, "model-flow-statistics").versionAsInProject(),
81 mavenBundle(OFPLUGIN, "openflowplugin-api").versionAsInProject(),
82 mavenBundle(OFPLUGIN, "openflowplugin-extension-api").versionAsInProject(),
83 mavenBundle(OFPLUGIN, "openflowplugin").versionAsInProject(),
84 mavenBundle(CONTROLLER_MD, "forwardingrules-manager").versionAsInProject(),
85 mavenBundle(CONTROLLER_MD, "inventory-manager").versionAsInProject(),
86 mavenBundle("org.openexi", "nagasena").versionAsInProject()
91 * @return logging bundles
93 public static Option loggingBudles() {
94 return new DefaultCompositeOption(
95 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
96 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
97 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
98 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject());
102 * @return sal + dependencymanager
104 public static Option baseSalBundles() {
105 return new DefaultCompositeOption(
106 // mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
107 // mavenBundle(CONTROLLER, "sal").versionAsInProject(),
108 mavenBundle(YANGTOOLS + ".thirdparty", "antlr4-runtime-osgi-nohead").versionAsInProject());