Search in sources :

Example 6 with DeliveryManifestHolder

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

the class OrderRequestImplTest method testMultipleTarGZipOrder.

@Test
public void testMultipleTarGZipOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getMultipleUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.TARGZIP.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)

Example 7 with DeliveryManifestHolder

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

the class OrderRequestImplTest method testSingleFilesGZipOrder.

@Test
public void testSingleFilesGZipOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.FILESGZIP.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)

Example 8 with DeliveryManifestHolder

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

the class OrderRequestImplTest method testSingleTarCompressOrder.

@Test
public void testSingleTarCompressOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.TARCOMPRESS.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)

Example 9 with DeliveryManifestHolder

use of org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder 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 10 with DeliveryManifestHolder

use of org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder 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)

Aggregations

DeliveryManifestHolder (org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder)22 OrderContents (org.codice.alliance.nsili.common.GIAS.OrderContents)22 Test (org.junit.Test)21 DeliveryDetails (org.codice.alliance.nsili.common.GIAS.DeliveryDetails)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 KeyManagementException (java.security.KeyManagementException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 CertificateException (java.security.cert.CertificateException)1 DeliveryManifest (org.codice.alliance.nsili.common.GIAS.DeliveryManifest)1 OrderRequest (org.codice.alliance.nsili.common.GIAS.OrderRequest)1 PackageElement (org.codice.alliance.nsili.common.GIAS.PackageElement)1 ValidationResults (org.codice.alliance.nsili.common.GIAS.ValidationResults)1 NameValue (org.codice.alliance.nsili.common.UCO.NameValue)1 Product (org.codice.alliance.nsili.common.UID.Product)1 Any (org.omg.CORBA.Any)1