Search in sources :

Example 1 with Status

use of org.geotoolkit.wps.xml.v200.Status in project core by authzforce.

the class BaseXacmlJsonResultPostprocessor method processClientError.

@Override
public JSONObject processClientError(final IndeterminateEvaluationException error) {
    assert maxDepthOfErrorCauseIncludedInResult == 0;
    final Status finalStatus = error.getTopLevelStatus();
    // FIXME: maxDepthOfErrorCauseIncludedInResult > 0 not supported so far
    final JSONObject result = new JSONObject(HashCollections.newImmutableMap("Decision", DecisionType.INDETERMINATE.value(), "Status", toJson(finalStatus)));
    return new JSONObject(HashCollections.newImmutableMap("Response", new JSONArray(Collections.singleton(result))));
}
Also used : Status(oasis.names.tc.xacml._3_0.core.schema.wd_17.Status) JSONObject(org.json.JSONObject) JSONArray(org.json.JSONArray)

Example 2 with Status

use of org.geotoolkit.wps.xml.v200.Status in project geotoolkit by Geomatys.

the class WPS2Process method execute.

@Override
protected void execute() throws ProcessException {
    final Result result;
    try {
        if (jobId != null) {
            try {
                // It's an already running process we've got here. All we have to do
                // is checking its status, to ensure/wait its completion.
                result = checkResult(getStatus());
            } catch (JAXBException | IOException ex) {
                throw new ProcessException("Cannot get process status", this, ex);
            }
        } else {
            final ExecuteRequest exec = createRequest();
            exec.setDebug(debug);
            exec.setClientSecurity(security);
            result = sendExecuteRequest(exec);
        }
    } catch (InterruptedException e) {
        throw new DismissProcessException("Process interrupted while executing", this, e);
    }
    if (!isDimissed()) {
        fillOutputs(result);
    }
}
Also used : ExecuteRequest(org.geotoolkit.wps.client.ExecuteRequest) ProcessException(org.geotoolkit.process.ProcessException) DismissProcessException(org.geotoolkit.process.DismissProcessException) JAXBException(javax.xml.bind.JAXBException) IOException(java.io.IOException) DismissProcessException(org.geotoolkit.process.DismissProcessException) Result(org.geotoolkit.wps.xml.v200.Result)

Example 3 with Status

use of org.geotoolkit.wps.xml.v200.Status in project yakc by manusa.

the class ServiceLegacyIT method deleteNamespacedService.

@Test
@DisplayName("deleteNamespacedService, should delete existing Service")
void deleteNamespacedService() throws IOException {
    // When
    // Apparently they have corrected this in the API, it will have different results depending on the target cluster
    final Status result = KC.create(CoreV1Api.class).deleteNamespacedService(serviceName, NAMESPACE).get(Status.class);
    // Then
    assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
Also used : Status(com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 4 with Status

use of org.geotoolkit.wps.xml.v200.Status in project yakc by manusa.

the class DeploymentIT method deleteNamespacedDeployment.

@Test
@DisplayName("deleteNamespacedDeployment, should delete existing Pod")
void deleteNamespacedDeployment() throws IOException {
    // When
    final Status result = KC.create(AppsV1Api.class).deleteNamespacedDeployment(deploymentName, NAMESPACE).get();
    // Then
    assertThat(result).isNotNull().hasFieldOrPropertyWithValue("status", "Success");
}
Also used : Status(com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 5 with Status

use of org.geotoolkit.wps.xml.v200.Status in project yakc by manusa.

the class NetworkPolicyIT method deleteNamespacedNetworkPolicy.

@Test
@DisplayName("deleteNamespacedNetworkPolicy, should delete existing NetworkPolicy")
void deleteNamespacedNetworkPolicy() throws IOException {
    // When
    final Status result = KC.create(NetworkingV1Api.class).deleteNamespacedNetworkPolicy(networkPolicyName, NAMESPACE, DeleteOptions.builder().gracePeriodSeconds(1).build()).get();
    // Then
    assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
Also used : Status(com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

Status (com.microsoft.z3.Status)63 BoolExpr (com.microsoft.z3.BoolExpr)55 Test (org.junit.Test)49 Test (org.junit.jupiter.api.Test)17 IOException (java.io.IOException)11 Expr (com.microsoft.z3.Expr)10 JsonMapper.convertObjectToJsonString (com.arbindo.mimock.helpers.general.JsonMapper.convertObjectToJsonString)9 RandomDataGenerator.generateRandomAlphabeticString (com.arbindo.mimock.helpers.general.RandomDataGenerator.generateRandomAlphabeticString)9 Status (com.arbindo.mimock.manage.mimocks.models.v1.Status)9 Context (com.microsoft.z3.Context)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)9 WebMvcTest (org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)9 Pageable (org.springframework.data.domain.Pageable)9 HttpStatus (org.springframework.http.HttpStatus)9 MvcResult (org.springframework.test.web.servlet.MvcResult)9 Mock (com.arbindo.mimock.entities.Mock)8 List (java.util.List)7 Solver (com.microsoft.z3.Solver)6 PageImpl (org.springframework.data.domain.PageImpl)6