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 /** OFLibrary package */
31 public static final String OFLIBRARY = "org.opendaylight.openflowjava";
32 /** OFLibrary package */
33 public static final String OFPLUGIN = "org.opendaylight.openflowplugin";
34 /** controller.model package */
35 public static final String CONTROLLER_MODEL = "org.opendaylight.controller.model";
37 public static final String YANGTOOLS = "org.opendaylight.yangtools";
41 * Works only if property -DinspectOsgi is used
42 * @return equinox console setup (in order to inspect running IT through osgi console (telnet))
43 * and remote debugging on port {@link #DEBUG_PORT}
45 public static Option osgiConsoleBundles() {
46 DefaultCompositeOption option = new DefaultCompositeOption();
47 if (System.getProperty(INSPECT_OSGI) != null) {
49 .add(CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address="+DEBUG_PORT))
50 .add(CoreOptions.mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject())
51 .add(CoreOptions.mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject())
52 .add(CoreOptions.mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject())
53 .add(CoreOptions.mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject());
60 * @return OFLibrary bundles
62 public static Option ofLibraryBundles() {
63 return new DefaultCompositeOption(
64 mavenBundle(OFLIBRARY, "util").versionAsInProject(),
65 mavenBundle(OFLIBRARY, "openflow-protocol-impl").versionAsInProject(),
66 mavenBundle(OFLIBRARY, "openflow-protocol-api").versionAsInProject(),
67 mavenBundle(OFLIBRARY, "openflow-protocol-spi").versionAsInProject(),
68 mavenBundle(OFLIBRARY, "simple-client").versionAsInProject().start());
72 * @return OFLibrary + OFPlugin bundles
74 public static Option ofPluginBundles() {
75 return new DefaultCompositeOption(
78 mavenBundle(CONTROLLER_MODEL, "model-flow-statistics").versionAsInProject(),
79 mavenBundle(OFPLUGIN, "openflowplugin-api").versionAsInProject(),
80 mavenBundle(OFPLUGIN, "openflowplugin-extension-api").versionAsInProject(),
81 mavenBundle(OFPLUGIN, "openflowplugin").versionAsInProject(),
82 mavenBundle("org.openexi", "nagasena").versionAsInProject()
87 * @return logging bundles
89 public static Option loggingBudles() {
90 return new DefaultCompositeOption(
91 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
92 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
93 mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
94 mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject());
98 * @return sal + dependencymanager
100 public static Option baseSalBundles() {
101 return new DefaultCompositeOption(
102 mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
103 mavenBundle(CONTROLLER, "sal").versionAsInProject(),
104 mavenBundle(YANGTOOLS + ".thirdparty", "antlr4-runtime-osgi-nohead").versionAsInProject());