Search in sources :

Example 66 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method setMaintenancePolicyTest.

@Test
public void setMaintenancePolicyTest() throws Exception {
    Operation expectedResponse = Operation.newBuilder().setName("name3373707").setZone("zone3744684").setDetail("detail-1335224239").setStatusMessage("statusMessage-958704715").setSelfLink("selfLink1191800166").setTargetLink("targetLink486368555").setLocation("location1901043637").setStartTime("startTime-2129294769").setEndTime("endTime-1607243192").setProgress(OperationProgress.newBuilder().build()).addAllClusterConditions(new ArrayList<StatusCondition>()).addAllNodepoolConditions(new ArrayList<StatusCondition>()).setError(Status.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build();
    Operation actualResponse = client.setMaintenancePolicy(projectId, zone, clusterId, maintenancePolicy);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    SetMaintenancePolicyRequest actualRequest = ((SetMaintenancePolicyRequest) actualRequests.get(0));
    Assert.assertEquals(projectId, actualRequest.getProjectId());
    Assert.assertEquals(zone, actualRequest.getZone());
    Assert.assertEquals(clusterId, actualRequest.getClusterId());
    Assert.assertEquals(maintenancePolicy, actualRequest.getMaintenancePolicy());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Operation(com.google.container.v1beta1.Operation) MaintenancePolicy(com.google.container.v1beta1.MaintenancePolicy) SetMaintenancePolicyRequest(com.google.container.v1beta1.SetMaintenancePolicyRequest) StatusCondition(com.google.container.v1beta1.StatusCondition) Test(org.junit.Test)

Example 67 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method listOperationsTest.

@Test
public void listOperationsTest() throws Exception {
    ListOperationsResponse expectedResponse = ListOperationsResponse.newBuilder().addAllOperations(new ArrayList<Operation>()).addAllMissingZones(new ArrayList<String>()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    ListOperationsResponse actualResponse = client.listOperations(projectId, zone);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    ListOperationsRequest actualRequest = ((ListOperationsRequest) actualRequests.get(0));
    Assert.assertEquals(projectId, actualRequest.getProjectId());
    Assert.assertEquals(zone, actualRequest.getZone());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ListOperationsResponse(com.google.container.v1beta1.ListOperationsResponse) ArrayList(java.util.ArrayList) ListOperationsRequest(com.google.container.v1beta1.ListOperationsRequest) Operation(com.google.container.v1beta1.Operation) Test(org.junit.Test)

Example 68 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method deleteNodePoolTest.

@Test
public void deleteNodePoolTest() throws Exception {
    Operation expectedResponse = Operation.newBuilder().setName("name3373707").setZone("zone3744684").setDetail("detail-1335224239").setStatusMessage("statusMessage-958704715").setSelfLink("selfLink1191800166").setTargetLink("targetLink486368555").setLocation("location1901043637").setStartTime("startTime-2129294769").setEndTime("endTime-1607243192").setProgress(OperationProgress.newBuilder().build()).addAllClusterConditions(new ArrayList<StatusCondition>()).addAllNodepoolConditions(new ArrayList<StatusCondition>()).setError(Status.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    String nodePoolId = "nodePoolId1121557241";
    Operation actualResponse = client.deleteNodePool(projectId, zone, clusterId, nodePoolId);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    DeleteNodePoolRequest actualRequest = ((DeleteNodePoolRequest) actualRequests.get(0));
    Assert.assertEquals(projectId, actualRequest.getProjectId());
    Assert.assertEquals(zone, actualRequest.getZone());
    Assert.assertEquals(clusterId, actualRequest.getClusterId());
    Assert.assertEquals(nodePoolId, actualRequest.getNodePoolId());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Operation(com.google.container.v1beta1.Operation) DeleteNodePoolRequest(com.google.container.v1beta1.DeleteNodePoolRequest) StatusCondition(com.google.container.v1beta1.StatusCondition) Test(org.junit.Test)

Example 69 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method createNodePoolTest.

@Test
public void createNodePoolTest() throws Exception {
    Operation expectedResponse = Operation.newBuilder().setName("name3373707").setZone("zone3744684").setDetail("detail-1335224239").setStatusMessage("statusMessage-958704715").setSelfLink("selfLink1191800166").setTargetLink("targetLink486368555").setLocation("location1901043637").setStartTime("startTime-2129294769").setEndTime("endTime-1607243192").setProgress(OperationProgress.newBuilder().build()).addAllClusterConditions(new ArrayList<StatusCondition>()).addAllNodepoolConditions(new ArrayList<StatusCondition>()).setError(Status.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    NodePool nodePool = NodePool.newBuilder().build();
    Operation actualResponse = client.createNodePool(projectId, zone, clusterId, nodePool);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    CreateNodePoolRequest actualRequest = ((CreateNodePoolRequest) actualRequests.get(0));
    Assert.assertEquals(projectId, actualRequest.getProjectId());
    Assert.assertEquals(zone, actualRequest.getZone());
    Assert.assertEquals(clusterId, actualRequest.getClusterId());
    Assert.assertEquals(nodePool, actualRequest.getNodePool());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) NodePool(com.google.container.v1beta1.NodePool) ArrayList(java.util.ArrayList) Operation(com.google.container.v1beta1.Operation) StatusCondition(com.google.container.v1beta1.StatusCondition) CreateNodePoolRequest(com.google.container.v1beta1.CreateNodePoolRequest) Test(org.junit.Test)

Example 70 with Operation

use of org.osate.aadl2.Operation in project geo-platform by geosdi.

the class CatalogCapabilitiesTest method testGetCapabilitiesWithConnector.

@Test
public void testGetCapabilitiesWithConnector() throws Exception {
    URL url = new URL("http://catalog.geosdi.org/geonetwork/srv/eng/csw");
    GPCatalogConnectorStore serverConnector = newConnector().withServerUrl(url).build();
    CatalogGetCapabilitiesRequest<CapabilitiesType> request = serverConnector.createGetCapabilitiesRequest();
    CapabilitiesType response = request.getResponse();
    logger.info("CSW GET_CAPABILITIES VERSION @@@@@@@@@@@@@@@@@@@@@@@ {}", response.getVersion());
    List<Operation> operationList = response.getOperationsMetadata().getOperation();
    for (Operation operation : operationList) {
        String operationName = operation.getName();
        if ("GetRecordById".equals(operationName)) {
            List<DomainType> parameterList = operation.getParameter();
            for (DomainType parameter : parameterList) {
                String parameterName = parameter.getName();
                if ("outputSchema".equals(parameterName)) {
                    List<String> valueList = parameter.getValue();
                    logger.info("########################### outputSchema\n");
                    for (String value : valueList) {
                        logger.info("*** {}", value);
                    }
                }
            }
        }
    }
}
Also used : DomainType(org.geosdi.geoplatform.xml.ows.v100.DomainType) CapabilitiesType(org.geosdi.geoplatform.xml.csw.v202.CapabilitiesType) Operation(org.geosdi.geoplatform.xml.ows.v100.Operation) URL(java.net.URL) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)86 Test (org.junit.Test)75 AbstractMessage (com.google.protobuf.AbstractMessage)65 Operation (com.google.cloud.compute.v1.Operation)49 Operation (com.google.container.v1.Operation)43 StatusCondition (com.google.container.v1.StatusCondition)40 Operation (com.google.container.v1beta1.Operation)24 StatusCondition (com.google.container.v1beta1.StatusCondition)23 InstancesClient (com.google.cloud.compute.v1.InstancesClient)20 Operation (com.reprezen.kaizen.oasparser.model3.Operation)16 Path (com.reprezen.kaizen.oasparser.model3.Path)15 Operation (net.opengis.ows.v_1_0_0.Operation)15 Instance (com.google.cloud.compute.v1.Instance)13 Parameter (com.reprezen.kaizen.oasparser.model3.Parameter)13 DomainType (net.opengis.ows.v_1_0_0.DomainType)13 AttachedDisk (com.google.cloud.compute.v1.AttachedDisk)12 AadlPackage (org.osate.aadl2.AadlPackage)12 InsertInstanceRequest (com.google.cloud.compute.v1.InsertInstanceRequest)11 List (java.util.List)9 Optional (java.util.Optional)9