public void testChoiceMissingIconErrorHandling(){
  String xml="";
  xml+=createStartMissionXml("start","Name");
  xml+=createStartChoiceMomentXml("start",0.5,"Example ChoiceMoment Description","choice_2");
  xml+=createChoiceXml("fire","Example Choice Description 1","start",true,false,"test_icon");
  xml+=createChoiceXml("choice_2","Example Choice Description 2","start",false,false,null);
  xml+=createEndChoiceMomentXml();
  xml+=createEndMissionXml();
  Utils.logDebug(TAG,xml);
  InputStream momentInputStream=new ByteArrayInputStream(xml.getBytes());
  mMission=new Mission(mMissionData);
  boolean didMissionParseFail=false;
  try {
    mMission.readMoments(momentInputStream);
  }
 catch (  MissionParseException e) {
    e.printStackTrace();
    didMissionParseFail=true;
  }
  Assert.assertEquals(true,didMissionParseFail);
}

public void testChoiceMissingIconErrorHandling ( ) { String xml = "" ; xml += createStartMissionXml ( "start" , "Name" ) ; xml += createStartChoiceMomentXml ( "start" , 0.5 , "Example ChoiceMoment Description" , "choice_2" ) ; xml += createChoiceXml ( "fire" , "Example Choice Description 1" , "start" , true , false , "test_icon" ) ; xml += createChoiceXml ( "choice_2" , "Example Choice Description 2" , "start" , false , false , null ) ; xml += createEndChoiceMomentXml ( ) ; xml += createEndMissionXml ( ) ; Utils . logDebug ( TAG , xml ) ; InputStream momentInputStream = new ByteArrayInputStream ( xml . getBytes ( ) ) ; mMission = new Mission ( mMissionData ) ; boolean didMissionParseFail = false ; try { mMission . readMoments ( momentInputStream ) ; } catch ( MissionParseException e ) { e . printStackTrace ( ) ; didMissionParseFail = true ; } Assert . assertEquals ( true , didMissionParseFail ) ; }
test for correct error handling for a choice that has no icon element .
