Search in sources :

Example 11 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method getUncompressedTestOrder.

private OrderContents getUncompressedTestOrder() {
    OrderContents order = new OrderContents();
    PackagingSpec packagingSpec = new PackagingSpec();
    packagingSpec.package_identifier = "pkg1234";
    packagingSpec.packaging_format_and_compression = PackagingSpecFormatType.FILESUNC.name();
    order.pSpec = packagingSpec;
    ProductDetails productDetail = new ProductDetails();
    productDetail.aProduct = mockProduct1;
    order.prod_list = new ProductDetails[] { productDetail };
    DeliveryDetails deliveryDetail = new DeliveryDetails();
    deliveryDetail.dests = getTestDestination();
    order.del_list = new DeliveryDetails[] { deliveryDetail };
    return order;
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) ProductDetails(org.codice.alliance.nsili.common.GIAS.ProductDetails) DeliveryDetails(org.codice.alliance.nsili.common.GIAS.DeliveryDetails) PackagingSpec(org.codice.alliance.nsili.common.GIAS.PackagingSpec)

Example 12 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testMultipleCompressedOrder.

@Test
public void testMultipleCompressedOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getMultipleUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.FILESCOMPRESS.name();
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, accessManager, mockCatalogFramework, destination -> Optional.of(mock(DestinationSink.class)));
    DeliveryManifestHolder holder = new DeliveryManifestHolder();
    orderRequest.complete(holder);
    assertThat(holder.value, notNullValue());
    assertThat(holder.value.elements[0].files.length, is(2));
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) DeliveryManifestHolder(org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder) Test(org.junit.Test)

Example 13 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testSetUserInfo.

@Test
public void testSetUserInfo() throws InvalidInputParameter, SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, PROTOCOL, PORT, accessManager, mockCatalogFramework, emailConfiguration);
    orderRequest.set_user_info("test user");
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) Test(org.junit.Test)

Example 14 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testUnsetOutputName.

@Test
public void testUnsetOutputName() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    order.pSpec.package_identifier = null;
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, accessManager, mockCatalogFramework, destination -> Optional.of(mock(DestinationSink.class)));
    DeliveryManifestHolder holder = new DeliveryManifestHolder();
    orderRequest.complete(holder);
    assertThat(holder.value, notNullValue());
    assertThat(holder.value.elements[0].files.length, is(1));
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) DeliveryManifestHolder(org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder) Test(org.junit.Test)

Example 15 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testMultipleTarZipOrder.

@Test
public void testMultipleTarZipOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getMultipleUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.TARZIP.name();
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, accessManager, mockCatalogFramework, destination -> Optional.of(mock(DestinationSink.class)));
    DeliveryManifestHolder holder = new DeliveryManifestHolder();
    orderRequest.complete(holder);
    assertThat(holder.value, notNullValue());
    assertThat(holder.value.elements[0].files.length, is(1));
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) DeliveryManifestHolder(org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder) Test(org.junit.Test)

Aggregations

OrderContents (org.codice.alliance.nsili.common.GIAS.OrderContents)31 Test (org.junit.Test)26 DeliveryManifestHolder (org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder)22 DeliveryDetails (org.codice.alliance.nsili.common.GIAS.DeliveryDetails)6 PackagingSpec (org.codice.alliance.nsili.common.GIAS.PackagingSpec)4 ProductDetails (org.codice.alliance.nsili.common.GIAS.ProductDetails)4 Any (org.omg.CORBA.Any)3 Calendar (java.util.Calendar)2 AlterationSpec (org.codice.alliance.nsili.common.GIAS.AlterationSpec)2 Destination (org.codice.alliance.nsili.common.GIAS.Destination)2 ImageSpec (org.codice.alliance.nsili.common.GIAS.ImageSpec)2 MediaType (org.codice.alliance.nsili.common.GIAS.MediaType)2 TailoringSpec (org.codice.alliance.nsili.common.GIAS.TailoringSpec)2 AbsTime (org.codice.alliance.nsili.common.UCO.AbsTime)2 Coordinate2d (org.codice.alliance.nsili.common.UCO.Coordinate2d)2 Date (org.codice.alliance.nsili.common.UCO.Date)2 NameName (org.codice.alliance.nsili.common.UCO.NameName)2 Rectangle (org.codice.alliance.nsili.common.UCO.Rectangle)2 Time (org.codice.alliance.nsili.common.UCO.Time)2 IOException (java.io.IOException)1