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);
}
Aggregations