2 * Copyright © 2015 Red Hat, 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.ovsdb.lib.it;
11 import static org.ops4j.pax.exam.CoreOptions.composite;
12 import static org.ops4j.pax.exam.CoreOptions.maven;
13 import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperties;
14 import static org.ops4j.pax.exam.CoreOptions.vmOption;
15 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
16 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
18 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
19 import org.ops4j.pax.exam.Configuration;
20 import org.ops4j.pax.exam.Option;
21 import org.ops4j.pax.exam.karaf.options.LogLevelOption;
22 import org.ops4j.pax.exam.options.MavenUrlReference;
25 * Base class for library IT.
27 public abstract class LibraryIntegrationTestBase extends AbstractMdsalTestBase {
29 public String getModuleName() {
34 public String getInstanceName() {
35 return "library-default";
39 public MavenUrlReference getFeatureRepo() {
41 .groupId("org.opendaylight.ovsdb")
42 .artifactId("library-features")
43 .classifier("features")
45 .versionAsInProject();
49 public String getFeatureName() {
50 return "odl-ovsdb-library";
55 public Option[] config() {
56 Option[] parentOptions = super.config();
57 Option[] propertiesOptions = getPropertiesOptions();
58 Option[] otherOptions = getOtherOptions();
59 Option[] options = new Option[parentOptions.length + propertiesOptions.length + otherOptions.length];
60 System.arraycopy(parentOptions, 0, options, 0, parentOptions.length);
61 System.arraycopy(propertiesOptions, 0, options, parentOptions.length, propertiesOptions.length);
62 System.arraycopy(otherOptions, 0, options, parentOptions.length + propertiesOptions.length,
67 private Option[] getOtherOptions() {
69 vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"),
74 public Option[] getPropertiesOptions() {
76 propagateSystemProperties(
77 LibraryIntegrationTestUtils.SERVER_IPADDRESS,
78 LibraryIntegrationTestUtils.SERVER_PORT,
79 LibraryIntegrationTestUtils.CONNECTION_TYPE),
84 public Option getLoggingOption() {
85 Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
86 logConfiguration(getClass()),
87 LogLevelOption.LogLevel.INFO.name());
88 option = composite(option, super.getLoggingOption());