TinySAL implements SAL { @Override public CardApplicationPathResponse cardApplicationPath(CardApplicationPath request) { CardApplicationPathResponse response = WSHelper.makeResponse(CardApplicationPathResponse.class, WSHelper.makeResultOK()); try { CardApplicationPathType cardAppPath = request.getCardAppPathRequest(); Assert.assertIncorrectParameter(cardAppPath, "The parameter CardAppPathRequest is empty."); Set<CardStateEntry> entries = states.getMatchingEntries(cardAppPath); CardAppPathResultSet resultSet = new CardAppPathResultSet(); List<CardApplicationPathType> resultPaths = resultSet.getCardApplicationPathResult(); for (CardStateEntry entry : entries) { CardApplicationPathType pathCopy = entry.pathCopy(); if (cardAppPath.getCardApplication() != null) { pathCopy.setCardApplication(cardAppPath.getCardApplication()); } else { if (entry.getImplicitlySelectedApplicationIdentifier() != null) { pathCopy.setCardApplication(entry.getImplicitlySelectedApplicationIdentifier()); } else { LOG.warn("No CardApplication and ImplicitlySelectedApplication available using MF now."); pathCopy.setCardApplication(MF); } } resultPaths.add(pathCopy); } response.setCardAppPathResultSet(resultSet); } catch (IncorrectParameterException e) { response.setResult(e.getResult()); } return response; } TinySAL(Environment env, CardStateMap states); void setAddonManager(AddonManager manager); @Override InitializeResponse initialize(Initialize request); @Override TerminateResponse terminate(Terminate request); @Override CardApplicationPathResponse cardApplicationPath(CardApplicationPath request); @Override CardApplicationConnectResponse cardApplicationConnect(CardApplicationConnect request); @Override CardApplicationSelectResponse cardApplicationSelect(CardApplicationSelect request); @Override CardApplicationDisconnectResponse cardApplicationDisconnect(CardApplicationDisconnect request); @Publish @Override CardApplicationStartSessionResponse cardApplicationStartSession(CardApplicationStartSession request); @Publish @Override CardApplicationEndSessionResponse cardApplicationEndSession(CardApplicationEndSession request); @Publish @Override CardApplicationListResponse cardApplicationList(CardApplicationList request); @Override CardApplicationCreateResponse cardApplicationCreate(CardApplicationCreate request); @Override CardApplicationDeleteResponse cardApplicationDelete(CardApplicationDelete request); @Publish @Override CardApplicationServiceListResponse cardApplicationServiceList(CardApplicationServiceList request); @Override CardApplicationServiceCreateResponse cardApplicationServiceCreate(CardApplicationServiceCreate request); @Override CardApplicationServiceLoadResponse cardApplicationServiceLoad(CardApplicationServiceLoad request); @Override CardApplicationServiceDeleteResponse cardApplicationServiceDelete(CardApplicationServiceDelete request); @Publish @Override CardApplicationServiceDescribeResponse cardApplicationServiceDescribe(CardApplicationServiceDescribe request); @Override ExecuteActionResponse executeAction(ExecuteAction request); @Publish @Override DataSetListResponse dataSetList(DataSetList request); @Override DataSetCreateResponse dataSetCreate(DataSetCreate request); @Publish @Override DataSetSelectResponse dataSetSelect(DataSetSelect request); @Override DataSetDeleteResponse dataSetDelete(DataSetDelete request); @Publish @Override DSIListResponse dsiList(DSIList request); @Override DSICreateResponse dsiCreate(DSICreate request); @Override DSIDeleteResponse dsiDelete(DSIDelete request); @Publish @Override DSIWriteResponse dsiWrite(DSIWrite request); @Publish @Override DSIReadResponse dsiRead(DSIRead request); @Publish @Override EncipherResponse encipher(Encipher request); @Override DecipherResponse decipher(Decipher request); @Publish @Override GetRandomResponse getRandom(GetRandom request); @Publish @Override HashResponse hash(Hash request); @Override SignResponse sign(Sign request); @Override VerifySignatureResponse verifySignature(VerifySignature request); @Override VerifyCertificateResponse verifyCertificate(VerifyCertificate request); @Publish @Override DIDListResponse didList(DIDList request); @Override DIDCreateResponse didCreate(DIDCreate request); @Publish @Override DIDGetResponse didGet(DIDGet request); @Override DIDUpdateResponse didUpdate(DIDUpdate request); @Override DIDDeleteResponse didDelete(DIDDelete request); @Publish @Override DIDAuthenticateResponse didAuthenticate(DIDAuthenticate request); @Publish @Override ACLListResponse aclList(ACLList request); @Override ACLModifyResponse aclModify(ACLModify request); void setGUI(UserConsent uc);  }
@Test(enabled = TESTS_ENABLED) public void testCardApplicationPath() { System.out.println("cardApplicationPath"); CardApplicationPath cardApplicationPath = new CardApplicationPath(); CardApplicationPathType cardApplicationPathType = new CardApplicationPathType(); cardApplicationPathType.setCardApplication(this.appIdentifier_ESIGN); cardApplicationPathType.setContextHandle(contextHandle); cardApplicationPathType.setSlotIndex(new BigInteger("0")); cardApplicationPath.setCardAppPathRequest(cardApplicationPathType); CardApplicationPathResponse cardApplicationPathResponse = instance.cardApplicationPath(cardApplicationPath); assertTrue(cardApplicationPathResponse.getCardAppPathResultSet().getCardApplicationPathResult().size()>0); assertEquals(cardApplicationPathResponse.getResult().getResultMajor(), ECardConstants.Major.OK); cardApplicationPath = new CardApplicationPath(); cardApplicationPathType = new CardApplicationPathType(); cardApplicationPath.setCardAppPathRequest(cardApplicationPathType); cardApplicationPathResponse = instance.cardApplicationPath(cardApplicationPath); assertTrue(cardApplicationPathResponse.getCardAppPathResultSet().getCardApplicationPathResult().size()>0); assertNotNull(cardApplicationPathResponse.getCardAppPathResultSet().getCardApplicationPathResult().get(0).getCardApplication()); assertEquals(cardApplicationPathResponse.getResult().getResultMajor(), ECardConstants.Major.OK); cardApplicationPathType = new CardApplicationPathType(); cardApplicationPathType.setCardApplication(Hex.decode("C0CA")); cardApplicationPathType.setContextHandle(contextHandle); cardApplicationPathType.setSlotIndex(new BigInteger("0")); cardApplicationPath.setCardAppPathRequest(cardApplicationPathType); cardApplicationPathResponse = instance.cardApplicationPath(cardApplicationPath); assertEquals(cardApplicationPathResponse.getCardAppPathResultSet().getCardApplicationPathResult().size(), 0); assertEquals(cardApplicationPathResponse.getResult().getResultMajor(), ECardConstants.Major.OK); cardApplicationPath.setCardAppPathRequest(null); cardApplicationPathResponse = instance.cardApplicationPath(cardApplicationPath); assertEquals(cardApplicationPathResponse.getResult().getResultMajor(), ECardConstants.Major.ERROR); assertEquals(cardApplicationPathResponse.getResult().getResultMinor(), ECardConstants.Minor.App.INCORRECT_PARM); }