Search in sources :

Example 1 with LatLong

use of eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong in project UVMS-Docker by UnionVMS.

the class ReportingRestIT method createTestAssetWithTerminalAndPositions.

/**
 * Creates the test asset with terminal and positions.
 */
@BeforeClass
public static void createTestAssetWithTerminalAndPositions() {
    try {
        testAsset = AssetTestHelper.createTestAsset();
        MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
        MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
        List<LatLong> route = movementHelper.createRuttVarbergGrena(-1);
        for (LatLong position : route) {
            final CreateMovementRequest createMovementRequest = movementHelper.createMovementRequest(testAsset, mobileTerminalType, position);
            CreateMovementResponse createMovementResponse = movementHelper.createMovement(testAsset, mobileTerminalType, createMovementRequest);
            assertNotNull(createMovementResponse);
        }
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : CreateMovementRequest(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest) CreateMovementResponse(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse) MobileTerminalType(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType) LatLong(eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong) ClientProtocolException(org.apache.http.client.ClientProtocolException) JsonParseException(com.fasterxml.jackson.core.JsonParseException) IOException(java.io.IOException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) BeforeClass(org.junit.BeforeClass)

Example 2 with LatLong

use of eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong in project UVMS-Docker by UnionVMS.

the class SetMovementReportRequestJmsIT method setMovementReportRequestTest.

/**
 * Creates the movement request test.
 *
 * @throws Exception
 *             the exception
 */
@Test(timeout = 5000)
public void setMovementReportRequestTest() throws Exception {
    Asset testAsset = AssetTestHelper.createTestAsset();
    MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
    MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
    LatLong latLong = movementHelper.createRutt(1).get(0);
    final CreateMovementRequest createMovementRequest = movementHelper.createMovementRequest(testAsset, mobileTerminalType, latLong);
    MessageHelper.sendMessage("UVMSExchangeEvent", marshall(createSetReportMovementType(testAsset, mobileTerminalType, createMovementRequest)));
}
Also used : CreateMovementRequest(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest) Asset(eu.europa.ec.fisheries.wsdl.asset.types.Asset) MobileTerminalType(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType) LatLong(eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Example 3 with LatLong

use of eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong in project UVMS-Docker by UnionVMS.

the class SpatialJmsIT method createSpatialEnrichmentRequestForRuttTest.

@Test(timeout = 40000)
public void createSpatialEnrichmentRequestForRuttTest() throws Exception {
    List<LatLong> position = movementHelper.createRutt(10);
    for (LatLong latLong : position) {
        SpatialEnrichmentRQ spatialEnrichmentRQ = new SpatialEnrichmentRQ();
        AreaTypes areaTypes = new AreaTypes();
        areaTypes.getAreaTypes().add(AreaType.COUNTRY);
        areaTypes.getAreaTypes().add(AreaType.RFMO);
        areaTypes.getAreaTypes().add(AreaType.EEZ);
        spatialEnrichmentRQ.setAreaTypes(areaTypes);
        LocationTypes locationTypes = new LocationTypes();
        locationTypes.getLocationTypes().add(LocationType.PORT);
        spatialEnrichmentRQ.setLocationTypes(locationTypes);
        spatialEnrichmentRQ.setMethod(SpatialModuleMethod.GET_ENRICHMENT);
        spatialEnrichmentRQ.setUnit(UnitType.NAUTICAL_MILES);
        PointType pointType = new PointType();
        spatialEnrichmentRQ.setPoint(pointType);
        pointType.setLatitude(latLong.latitude);
        pointType.setLongitude(latLong.longitude);
        pointType.setCrs(4326);
        SpatialEnrichmentRS spatialEnrichmentRS = spatialHelper.createSpatialEnrichment(spatialEnrichmentRQ);
        assertNotNull(spatialEnrichmentRS);
    }
}
Also used : LocationTypes(eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ.LocationTypes) SpatialEnrichmentRQ(eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ) AreaTypes(eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ.AreaTypes) SpatialEnrichmentRS(eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRS) PointType(eu.europa.ec.fisheries.uvms.spatial.model.schemas.PointType) LatLong(eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Example 4 with LatLong

use of eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong in project UVMS-Docker by UnionVMS.

the class SpatialJmsPerformanceIT method createSpatialEnrichmentRequestPerformanceTest.

/**
 * Creates the spatial enrichment request performance test.
 *
 * @throws Exception the exception
 */
@Test
@PerfTest(threads = 2, duration = 10000)
@Required(max = 6900, average = 2500, percentile95 = 2500, throughput = 1)
public void createSpatialEnrichmentRequestPerformanceTest() throws Exception {
    LatLong position = createRutt.get(ThreadLocalRandom.current().nextInt(0, 30));
    SpatialEnrichmentRQ spatialEnrichmentRQ = new SpatialEnrichmentRQ();
    AreaTypes areaTypes = new AreaTypes();
    areaTypes.getAreaTypes().add(AreaType.COUNTRY);
    areaTypes.getAreaTypes().add(AreaType.PORT);
    areaTypes.getAreaTypes().add(AreaType.FMZ);
    spatialEnrichmentRQ.setAreaTypes(areaTypes);
    LocationTypes locationTypes = new LocationTypes();
    locationTypes.getLocationTypes().add(LocationType.PORT);
    spatialEnrichmentRQ.setLocationTypes(locationTypes);
    spatialEnrichmentRQ.setMethod(SpatialModuleMethod.GET_ENRICHMENT);
    spatialEnrichmentRQ.setUnit(UnitType.NAUTICAL_MILES);
    PointType pointType = new PointType();
    spatialEnrichmentRQ.setPoint(pointType);
    pointType.setLatitude(position.latitude);
    pointType.setLongitude(position.longitude);
    pointType.setCrs(4326);
    SpatialEnrichmentRS spatialEnrichmentRS = spatialHelper.createSpatialEnrichment(spatialEnrichmentRQ);
    assertNotNull(spatialEnrichmentRS);
}
Also used : LocationTypes(eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ.LocationTypes) SpatialEnrichmentRQ(eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ) AreaTypes(eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ.AreaTypes) SpatialEnrichmentRS(eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRS) PointType(eu.europa.ec.fisheries.uvms.spatial.model.schemas.PointType) LatLong(eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong) Required(org.databene.contiperf.Required) PerfTest(org.databene.contiperf.PerfTest) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest) PerfTest(org.databene.contiperf.PerfTest)

Example 5 with LatLong

use of eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong in project UVMS-Docker by UnionVMS.

the class SetMovementReportRequestJmsIT method setMovementReportRequestRouteTest.

/**
 * Sets the movement report request route test.
 *
 * @throws Exception
 *             the exception
 */
@Test(timeout = 25000)
public void setMovementReportRequestRouteTest() throws Exception {
    Asset testAsset = AssetTestHelper.createTestAsset();
    MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
    MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
    List<LatLong> latLongList = movementHelper.createRutt(2);
    for (LatLong latLong : latLongList) {
        final CreateMovementRequest createMovementRequest = movementHelper.createMovementRequest(testAsset, mobileTerminalType, latLong);
        MessageHelper.sendMessage("UVMSExchangeEvent", marshall(createSetReportMovementType(testAsset, mobileTerminalType, createMovementRequest)));
    }
}
Also used : CreateMovementRequest(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest) Asset(eu.europa.ec.fisheries.wsdl.asset.types.Asset) MobileTerminalType(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType) LatLong(eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Aggregations

LatLong (eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong)6 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)5 Test (org.junit.Test)5 MobileTerminalType (eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType)3 CreateMovementRequest (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest)3 PointType (eu.europa.ec.fisheries.uvms.spatial.model.schemas.PointType)3 SpatialEnrichmentRQ (eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ)3 AreaTypes (eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ.AreaTypes)3 LocationTypes (eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRQ.LocationTypes)3 SpatialEnrichmentRS (eu.europa.ec.fisheries.uvms.spatial.model.schemas.SpatialEnrichmentRS)3 Asset (eu.europa.ec.fisheries.wsdl.asset.types.Asset)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)1 CreateMovementResponse (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse)1 IOException (java.io.IOException)1 ClientProtocolException (org.apache.http.client.ClientProtocolException)1 PerfTest (org.databene.contiperf.PerfTest)1 Required (org.databene.contiperf.Required)1 BeforeClass (org.junit.BeforeClass)1