Search in sources :

Example 1 with DataSetCreateResponse

use of iso.std.iso_iec._24727.tech.schema.DataSetCreateResponse in project open-ecard by ecsec.

the class TinySALTest method testDataSetCreate.

/**
 * Test of dataSetCreate method, of class TinySAL.
 */
@Test(enabled = TESTS_ENABLED)
public void testDataSetCreate() {
    System.out.println("dataSetCreate");
    DataSetCreate parameters = new DataSetCreate();
    // get path to esign
    CardApplicationPath cardApplicationPath = new CardApplicationPath();
    CardApplicationPathType cardApplicationPathType = new CardApplicationPathType();
    cardApplicationPathType.setCardApplication(appIdentifier_ESIGN);
    cardApplicationPath.setCardAppPathRequest(cardApplicationPathType);
    CardApplicationPathResponse cardApplicationPathResponse = instance.cardApplicationPath(cardApplicationPath);
    // connect to esign
    CardApplicationConnect cardApplicationConnect = new CardApplicationConnect();
    cardApplicationConnect.setCardApplicationPath(cardApplicationPathResponse.getCardAppPathResultSet().getCardApplicationPathResult().get(0));
    CardApplicationConnectResponse result = instance.cardApplicationConnect(cardApplicationConnect);
    assertEquals(ECardConstants.Major.OK, result.getResult().getResultMajor());
    AccessControlListType accessControlList = new AccessControlListType();
    parameters.setConnectionHandle(result.getConnectionHandle());
    String dataSetName = "DataSetTest";
    parameters.setDataSetName(dataSetName);
    parameters.setDataSetACL(accessControlList);
    DataSetCreateResponse resultDataSetCreate = instance.dataSetCreate(parameters);
    assertEquals(ECardConstants.Major.OK, resultDataSetCreate.getResult().getResultMajor());
    // list datasets of esign
    DataSetList dataSetList = new DataSetList();
    dataSetList.setConnectionHandle(result.getConnectionHandle());
    DataSetListResponse dataSetListResponse = instance.dataSetList(dataSetList);
    Iterator<String> it = dataSetListResponse.getDataSetNameList().getDataSetName().iterator();
    boolean appFound = false;
    while (it.hasNext()) {
        String val = it.next();
        if (val.equals(dataSetName)) {
            appFound = true;
        }
    }
    assertTrue(appFound);
    assertEquals(ECardConstants.Major.OK, dataSetListResponse.getResult().getResultMajor());
}
Also used : DataSetCreateResponse(iso.std.iso_iec._24727.tech.schema.DataSetCreateResponse) DataSetCreate(iso.std.iso_iec._24727.tech.schema.DataSetCreate) CardApplicationPathResponse(iso.std.iso_iec._24727.tech.schema.CardApplicationPathResponse) AccessControlListType(iso.std.iso_iec._24727.tech.schema.AccessControlListType) CardApplicationConnectResponse(iso.std.iso_iec._24727.tech.schema.CardApplicationConnectResponse) CardApplicationPathType(iso.std.iso_iec._24727.tech.schema.CardApplicationPathType) CardApplicationPath(iso.std.iso_iec._24727.tech.schema.CardApplicationPath) DataSetListResponse(iso.std.iso_iec._24727.tech.schema.DataSetListResponse) CardApplicationConnect(iso.std.iso_iec._24727.tech.schema.CardApplicationConnect) DataSetList(iso.std.iso_iec._24727.tech.schema.DataSetList) Test(org.testng.annotations.Test)

Aggregations

AccessControlListType (iso.std.iso_iec._24727.tech.schema.AccessControlListType)1 CardApplicationConnect (iso.std.iso_iec._24727.tech.schema.CardApplicationConnect)1 CardApplicationConnectResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationConnectResponse)1 CardApplicationPath (iso.std.iso_iec._24727.tech.schema.CardApplicationPath)1 CardApplicationPathResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationPathResponse)1 CardApplicationPathType (iso.std.iso_iec._24727.tech.schema.CardApplicationPathType)1 DataSetCreate (iso.std.iso_iec._24727.tech.schema.DataSetCreate)1 DataSetCreateResponse (iso.std.iso_iec._24727.tech.schema.DataSetCreateResponse)1 DataSetList (iso.std.iso_iec._24727.tech.schema.DataSetList)1 DataSetListResponse (iso.std.iso_iec._24727.tech.schema.DataSetListResponse)1 Test (org.testng.annotations.Test)1