import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackages;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperties;
import static org.ops4j.pax.exam.CoreOptions.systemPackages;
import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
.toArray(Option[]::new);
}
- static Option[] probePropertiesOptions() {
- return new Option[]{propagateSystemProperties(TestProbe.ALL_PROPERTY_KEYS)};
- }
-
private static MavenArtifactUrlReference urlReferenceOf(final Artifact artifact) {
return maven().groupId(artifact.getGroupId()).artifactId(artifact.getArtifactId())
.type(artifact.getExtension()).classifier(artifact.getClassifier())
import static org.opendaylight.odlparent.features.test.plugin.PaxOptionUtils.karafConfigOptions;
import static org.opendaylight.odlparent.features.test.plugin.PaxOptionUtils.karafDistroOptions;
import static org.opendaylight.odlparent.features.test.plugin.PaxOptionUtils.miscOptions;
-import static org.opendaylight.odlparent.features.test.plugin.PaxOptionUtils.probePropertiesOptions;
import static org.opendaylight.odlparent.features.test.plugin.PaxOptionUtils.profileOptions;
import static org.opendaylight.odlparent.features.test.plugin.PaxOptionUtils.vmOptions;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import java.io.File;
import java.io.IOException;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.repository.RemoteRepository;
import org.ops4j.pax.exam.ExamSystem;
+import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.karaf.container.internal.KarafTestContainerFactory;
import org.ops4j.pax.exam.spi.PaxExamRuntime;
import org.slf4j.Logger;
karafConfigOptions(buildDir, localRepository),
dependencyFeaturesOptions(pluginDependencyFeatures),
dependencyFeaturesOptions(projectDependencyFeatures),
- probePropertiesOptions(),
+
+ // probe parameters
+ new Option[] {
+ systemProperty(TestProbe.FEATURE_FILE_URI_PROP).value(featureFile.toURI().toString()),
+ systemProperty(TestProbe.BUNDLE_CHECK_SKIP).value(String.valueOf(bundleStateCheckSkip)),
+ systemProperty(TestProbe.BUNDLE_CHECK_TIMEOUT_SECONDS).value(String.valueOf(bundleStateCheckTimeout)),
+ systemProperty(TestProbe.BUNDLE_CHECK_INTERVAL_SECONDS).value(String.valueOf(bundleStateCheckInterval))
+ },
+
miscOptions()
);
- // probe parameters
- System.setProperty(TestProbe.FEATURE_FILE_URI_PROP, featureFile.toURI().toString());
- System.setProperty(TestProbe.BUNDLE_CHECK_SKIP, String.valueOf(bundleStateCheckSkip));
- System.setProperty(TestProbe.BUNDLE_CHECK_TIMEOUT_SECONDS, String.valueOf(bundleStateCheckTimeout));
- System.setProperty(TestProbe.BUNDLE_CHECK_INTERVAL_SECONDS, String.valueOf(bundleStateCheckInterval));
final ExamSystem system;
try {
* All dependencies which are absent on target environment expected to be packaged using same
* {@link org.ops4j.pax.exam.ProbeBuilder}. Input parameters are passed through system properties. in order to be
* delivered properly all affected properties require explicit declaration using associated Pax options -- see
- * {@link PaxOptionUtils#probePropertiesOptions()}.
+ * {@link PaxOptionUtils} and setup in {@link TestFeaturesMojo#execute()}.
*
* <p>
* Pax Exam module references:
* <ul>
* <li>Probe bundle deployment handling is served by pax-exam-extender-service</li>
* <li>Service instances lookup and injection into probe instance is served by pax-exam-inject</li>
- * <li>Test method invocation is served by pax-exam-invoker-junit, uses JUnitCore v.4, which requires @Test
- * annotation for method to be eligible for invocation</li>
+ * <li>Test method invocation is served by pax-exam-invoker-junit, uses JUnitCore v.4, which requires {@code @Test}
+ * annotation for method to be eligible for invocation</li>
* </ul>
*/
public final class TestProbe {
static final String DEFAULT_TIMEOUT = "300";
static final String DEFAULT_INTERVAL = "1";
- static final String[] ALL_PROPERTY_KEYS = {
- FEATURE_FILE_URI_PROP,
- BUNDLE_CHECK_SKIP,
- BUNDLE_CHECK_TIMEOUT_SECONDS,
- BUNDLE_CHECK_INTERVAL_SECONDS
- };
-
private static final Logger LOG = LoggerFactory.getLogger(TestProbe.class);
private static final Map<String, ContainerState> ELIGIBLE_STATES = Map.of(
"slf4j.log4j12", ContainerState.INSTALLED,