@Test
public void testFriendlyTokenDescriptionGenerator() throws Exception {

	//---------------------------------------------------
	//Store credential specifications
	//---------------------------------------------------
	Map<URI,CredentialSpecification> uriCredspecs = new HashMap<URI, CredentialSpecification>();
	CredentialSpecification creditCardSpec =
			(CredentialSpecification) XmlUtils.getObjectFromXML(this.getClass().getResourceAsStream(
					"/eu/abc4trust/sampleXml/credspecs/credentialSpecificationCreditcardVisaForFriendlyGenTest.xml"), true);
	if (creditCardSpec !=null){
		uriCredspecs.put(creditCardSpec.getSpecificationUID(), creditCardSpec);
	}
	CredentialSpecification passportSpec =
			(CredentialSpecification) XmlUtils.getObjectFromXML(this.getClass().getResourceAsStream(
					"/eu/abc4trust/sampleXml/credspecs/credentialSpecificationPassport.xml"), true);
	if (passportSpec !=null){
		uriCredspecs.put(passportSpec.getSpecificationUID(), passportSpec);
	}
	//---------------------------------------------------
	//Retrieve presentation tokens
	//---------------------------------------------------
	PresentationToken ptCard =
			(PresentationToken) XmlUtils.getObjectFromXML(this.getClass().getResourceAsStream(
					"/eu/abc4trust/sampleXml/presentationTokens/presentationTokenCreditCardForFriendlyGenTest.xml"), true);
	PresentationToken ptHotel =
			(PresentationToken) XmlUtils.getObjectFromXML(this.getClass().getResourceAsStream(
					"/eu/abc4trust/sampleXml/presentationTokens/presentationTokenHotelOption1.xml"), true);
	//---------------------------------------------------
	//Generate friendly descriptions of revealed facts and attribute values
	//---------------------------------------------------
	RevealedFactsAndAttributeValues rvs = RevealedAttrsAndFactsdDescrGenerator.generateFriendlyDesciptions(ptCard.getPresentationTokenDescription(),uriCredspecs);
	printRevealedAttributes(rvs,
			new String[][] {
			{ "en: The value of Card Type from Visa Credit Card: gold" }
			, {"sv: Värdet av Status från INGEN VÄNLIG BESKRIVNING: 123123"
				, "en: The value of Status from Visa Credit Card: 123123" }
	});
	printRevealedFacts(rvs
			, new String[][] {
			{ "sv: Värdet av Utgångsdatum från INGEN VÄNLIG BESKRIVNING är efter eller lika med 06.01.2012 01:00"
				,"en: The value of Expiration Date from Visa Credit Card is after or on 06.01.2012 01:00" }
			,{"sv: Värdet av Utgångsdatum från INGEN VÄNLIG BESKRIVNING är före eller lika med 06.01.2014 01:00"
				, "en: The value of Expiration Date from Visa Credit Card is before or on 06.01.2014 01:00"
			}});
	RevealedFactsAndAttributeValues rvs2 = RevealedAttrsAndFactsdDescrGenerator.generateFriendlyDesciptions(ptHotel.getPresentationTokenDescription(), uriCredspecs);
	printRevealedAttributes(rvs2, new String[][] {{}, {}});
	printRevealedFacts(rvs2, new String[][] { 
			{ "sv: Värdet av Utgångsdatum från INGEN VÄNLIG BESKRIVNING är efter eller lika med 06.01.2012",
			"en: The value of Expiration Date from Visa Credit Card is after or on 06.01.2012" }
	});
}