Ignore:
Timestamp:
02/18/13 09:30:13 (12 years ago)
Author:
pharms
Message:
  • forwarded problems in GUI element mapping to parser to allow better handling of this exception
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/HTMLLogParser.java

    r1069 r1084  
    2525import de.ugoe.cs.autoquest.eventcore.IEventType; 
    2626import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel; 
     27import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModelException; 
    2728import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement; 
    2829import de.ugoe.cs.autoquest.plugin.html.eventcore.HTMLEventTypeFactory; 
     
    133134 
    134135        if (specification != null) { 
    135             super.getGUIElementTree().add(id, parentId, specification); 
     136            try { 
     137                super.getGUIElementTree().add(id, parentId, specification); 
     138            } 
     139            catch (GUIModelException e) { 
     140                throw new SAXException("could not handle GUI element with id " + 
     141                                       id + ": " + e.getMessage(), e); 
     142            } 
    136143            return true; 
    137144        } 
     
    174181            HTMLEventTypeFactory.getInstance().getEventType(type, parameters, target); 
    175182         
    176         Event event = new Event(eventType, target); 
    177  
    178         String timestampStr = parameters.get("timestamp"); 
    179          
    180         if (timestampStr != null) { 
    181             event.setTimestamp(Long.parseLong(timestampStr)); 
    182         } 
    183  
    184         ((HTMLGUIElement) event.getTarget()).markUsed(); 
    185          
    186         super.addToSequence(event); 
     183        if (eventType != null) { 
     184            Event event = new Event(eventType, target); 
     185 
     186            String timestampStr = parameters.get("timestamp"); 
     187         
     188            if (timestampStr != null) { 
     189                event.setTimestamp(Long.parseLong(timestampStr)); 
     190            } 
     191 
     192            ((HTMLGUIElement) event.getTarget()).markUsed(); 
     193         
     194            super.addToSequence(event); 
     195        } 
     196        // else ignore unknown event type 
    187197 
    188198        return true; 
Note: See TracChangeset for help on using the changeset viewer.