Search in sources :

Example 16 with ClientEnv

use of org.openecard.common.ClientEnv in project open-ecard by ecsec.

the class CardInfoWrapperTest method test.

/**
 * Simple test for CardInfoWrapper-class. After getting the CardInfoWrapper for the npa we
 * check if the get-methods return the expected values.
 *
 * @throws Exception when something in this test went unexpectedly wrong
 */
@Test
public void test() throws Exception {
    new Expectations() {

        {
            cifp.getCardInfo(anyString);
            result = null;
        }
    };
    Environment env = new ClientEnv();
    env.setCIFProvider(cifp);
    CardRecognitionImpl recognition = new CardRecognitionImpl(env);
    CardInfoType cardInfo = recognition.getCardInfo("http://bsi.bund.de/cif/npa.xml");
    CardInfoWrapper cardInfoWrapper = new CardInfoWrapper(cardInfo, null);
    assertEquals(cardInfoWrapper.getCardType(), "http://bsi.bund.de/cif/npa.xml");
    assertEquals(cardInfoWrapper.getImplicitlySelectedApplication(), rootApplication);
    assertEquals(cardInfoWrapper.getCardApplications().size(), 3);
    assertEquals(cardInfoWrapper.getDataSetNameList(rootApplication).getDataSetName().size(), 5);
    assertEquals(cardInfoWrapper.getCardApplicationNameList().size(), 3);
// CardApplicationWrapper cardApplicationWrapper = cardInfoWrapper.getCardApplication(rootApplication);
}
Also used : Expectations(mockit.Expectations) ClientEnv(org.openecard.common.ClientEnv) CardInfoType(iso.std.iso_iec._24727.tech.schema.CardInfoType) Environment(org.openecard.common.interfaces.Environment) CardRecognitionImpl(org.openecard.recognition.CardRecognitionImpl) Test(org.testng.annotations.Test)

Aggregations

ClientEnv (org.openecard.common.ClientEnv)16 EstablishContext (iso.std.iso_iec._24727.tech.schema.EstablishContext)10 CardRecognitionImpl (org.openecard.recognition.CardRecognitionImpl)10 EstablishContextResponse (iso.std.iso_iec._24727.tech.schema.EstablishContextResponse)9 Test (org.testng.annotations.Test)9 Environment (org.openecard.common.interfaces.Environment)8 IFD (org.openecard.ifd.scio.IFD)8 MessageDispatcher (org.openecard.transport.dispatcher.MessageDispatcher)7 CardStateMap (org.openecard.common.sal.state.CardStateMap)6 SALStateCallback (org.openecard.common.sal.state.SALStateCallback)6 CardInfoType (iso.std.iso_iec._24727.tech.schema.CardInfoType)5 ListIFDs (iso.std.iso_iec._24727.tech.schema.ListIFDs)5 AddonManager (org.openecard.addon.AddonManager)5 SwingDialogWrapper (org.openecard.gui.swing.SwingDialogWrapper)5 SwingUserConsent (org.openecard.gui.swing.SwingUserConsent)5 TinySAL (org.openecard.sal.TinySAL)5 ConnectionHandleType (iso.std.iso_iec._24727.tech.schema.ConnectionHandleType)4 RecognitionInfo (iso.std.iso_iec._24727.tech.schema.ConnectionHandleType.RecognitionInfo)4 ListIFDsResponse (iso.std.iso_iec._24727.tech.schema.ListIFDsResponse)4 EventDispatcherImpl (org.openecard.common.event.EventDispatcherImpl)4