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.controller.datastore;
11 import org.junit.Test;
12 import org.junit.runner.RunWith;
13 import org.ops4j.pax.exam.Configuration;
14 import org.ops4j.pax.exam.Option;
15 import org.ops4j.pax.exam.junit.PaxExam;
16 import org.ops4j.pax.exam.util.PathUtils;
17 import org.osgi.framework.Bundle;
18 import org.osgi.framework.BundleContext;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
22 import javax.inject.Inject;
24 import static junit.framework.Assert.assertTrue;
25 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
26 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
27 import static org.ops4j.pax.exam.CoreOptions.options;
28 import static org.ops4j.pax.exam.CoreOptions.systemPackages;
29 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
32 @RunWith(PaxExam.class)
33 public class ClusteredDataStoreIT {
34 private Logger log = LoggerFactory
35 .getLogger(ClusteredDataStoreIT.class);
36 // get the OSGI bundle context
38 private BundleContext bc;
40 // Configure the OSGi container
42 public Option[] config() {
45 systemProperty("logback.configurationFile").value(
46 "file:" + PathUtils.getBaseDir()
47 + "/src/test/resources/logback.xml"),
48 // To start OSGi console for inspection remotely
49 systemProperty("osgi.console").value("2401"),
50 // Set the systemPackages (used by clustering)
51 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
52 // List framework bundles
53 mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
54 mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
55 mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
56 mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
57 mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
58 mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
59 mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
60 // List logger bundles
61 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
62 mavenBundle("org.slf4j", "log4j-over-slf4j")
63 .versionAsInProject(),
64 mavenBundle("ch.qos.logback", "logback-core")
65 .versionAsInProject(),
66 mavenBundle("ch.qos.logback", "logback-classic")
67 .versionAsInProject(),
68 // needed by statisticsmanager
69 mavenBundle("org.opendaylight.controller", "containermanager")
70 .versionAsInProject(),
71 mavenBundle("org.opendaylight.controller", "containermanager.it.implementation")
72 .versionAsInProject(),
73 mavenBundle("org.opendaylight.controller", "clustering.services")
74 .versionAsInProject(),
75 mavenBundle("org.opendaylight.controller", "clustering.stub")
76 .versionAsInProject(),
78 // List all the bundles on which the test case depends
79 mavenBundle("org.opendaylight.controller", "sal")
80 .versionAsInProject(),
81 mavenBundle("org.opendaylight.controller", "sal.implementation")
82 .versionAsInProject(),
83 mavenBundle("org.opendaylight.controller", "protocol_plugins.stub")
84 .versionAsInProject(),
86 // needed by hosttracker
87 mavenBundle("org.opendaylight.controller", "clustered-datastore-implementation")
88 .versionAsInProject(),
89 mavenBundle("org.jboss.spec.javax.transaction",
90 "jboss-transaction-api_1.1_spec").versionAsInProject(),
91 mavenBundle("org.apache.commons", "commons-lang3")
92 .versionAsInProject(),
93 mavenBundle("org.apache.felix",
94 "org.apache.felix.dependencymanager")
95 .versionAsInProject(), junitBundles());
98 private String stateToString(int state) {
102 case Bundle.INSTALLED:
104 case Bundle.RESOLVED:
106 case Bundle.UNINSTALLED:
107 return "UNINSTALLED";
109 return "Not CONVERTED";
114 public void testDoNothing() throws Exception{