Skip to content

Commit

Permalink
[Polishing the core] - more javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobrz committed Sep 2, 2024
1 parent 34aedae commit 9869075
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
import cz.xtf.core.openshift.OpenShifts;
import lombok.extern.slf4j.Slf4j;

/**
* Implements a JUnit {@link ExecutionCondition} that is used to control whether a test class workflow can be managed by
* {@link IntersmashExtension}
*/
@Slf4j
public class IntersmashExecutionCondition implements ExecutionCondition {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
import cz.xtf.core.openshift.OpenShifts;
import lombok.extern.slf4j.Slf4j;

/**
* Intersmash JUnit extension that handles the process of provisioning a cross-product scenario before starting the
* test execution.
*/
@Slf4j
public class IntersmashExtension implements BeforeAllCallback, AfterAllCallback, TestInstancePostProcessor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.jboss.intersmash.application.Application;

/**
* Application provisioner for deploying and undeploying the application.
* Application provisioner for deploying and undeploying a service, represented by a given {@link Application} instance.
*/
public interface Provisioner<T extends Application> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

import org.jboss.intersmash.application.Application;

/**
* Define the contract for classes that return a suitable {@link Provisioner} for a given {@link Application} class.
* @param <T> The type of the {@link Provisioner} that the factory implementation shall return.
*/
public interface ProvisionerFactory<T extends Provisioner> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@

import org.jboss.intersmash.application.Application;

/**
* Manager class to load the suitable {@link Provisioner} for a given {@link Application} instance, based on SPI.
*/
public class ProvisionerManager {

/**
* Get application provisioner based on interfaces the application does implement.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@

import java.time.ZonedDateTime;

import cz.xtf.core.openshift.OpenShift;
import cz.xtf.core.openshift.OpenShiftWaiters;
import cz.xtf.core.openshift.OpenShifts;
import cz.xtf.core.waiting.failfast.FailFastBuilder;
import cz.xtf.core.waiting.failfast.FailFastCheck;

/**
* Helper class that leverages the XTF library fail-fast APIs in methods that can be used to control the
* Intersmash provisioning workflow.
*/
public class FailFastUtils {
private static String[] failFastEventMessages = new String[] {
"Failed to pull image.*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

import cz.xtf.core.openshift.OpenShift;

/**
* Helper class that leverages the XTF library {@link OpenShift} APIs in methods that can be used to control the
* Intersmash provisioning workflow.
*/
public class OpenShiftUtils {
public static void deleteResourcesWithLabel(OpenShift openShift, String labelKey, String labelValue) {
openShift.deploymentConfigs().withLabel(labelKey, labelValue).delete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
import io.fabric8.kubernetes.api.model.EndpointSubset;
import io.fabric8.kubernetes.api.model.Endpoints;

/**
* Helper class that leverages the XTF library {@link Waiter} APIs in methods that can be used to control the
* Intersmash provisioning workflow.
*/
public class WaitersUtil {
public static Waiter serviceEndpointsAreReady(OpenShift openShift, String serviceName, int numOfPods, Integer... ports) {
return new SimpleWaiter(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

import io.fabric8.openshift.api.model.operatorhub.v1alpha1.CatalogSourceBuilder;

/**
* Wrapper for creating and using {@link io.fabric8.openshift.api.model.operatorhub.v1alpha1.CatalogSource}
*/
public class CatalogSource extends io.fabric8.openshift.api.model.operatorhub.v1alpha1.CatalogSource
implements OpenShiftResource<CatalogSource> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
import io.fabric8.openshift.api.model.operatorhub.v1alpha1.SubscriptionFluent;

/**
* <p>
* The Subscription configures when and how to update a ClusterService, binds a ClusterService to a channel in a
* CatalogSource and configures the update strategy for a ClusterService (automatic, manual approval, etc).
* </p>
*
* <p>This class is a wrapper for {@link io.fabric8.openshift.api.model.operatorhub.v1alpha1.Subscription} which
* adds some capabilities</p>
* <p>
Expand Down

0 comments on commit 9869075

Please sign in to comment.