Ignore:
Timestamp:
04/22/16 09:32:33 (8 years ago)
Author:
pharms
Message:
  • added and corrected pseudonymization support
Location:
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html
Files:
2 added
1 edited

Legend:

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

    r1353 r2125  
    234234             
    235235            if ("tagname".equals(param.getKey())) { 
    236                 if ("input_text".equals(param.getValue()) || 
     236                if ("input_text".equals(param.getValue()) || "textarea".equals(param.getValue()) || 
     237                    "input_password".equals(param.getValue()) || 
    237238                    (pseudomizeSearchInputs && "input_search".equals(param.getValue())) || 
    238239                    (pseudomizeFileInputs && "input_file".equals(param.getValue()))) 
     
    253254    @Override 
    254255    protected boolean handleEvent(String type, Map<String, String> parameters) throws SAXException { 
    255         String timestampStr = parameters.get("timestamp"); 
    256          
    257         long timestamp = Long.MAX_VALUE; 
    258          
    259         if (timestampStr != null) { 
    260             timestamp = Long.parseLong(timestampStr); 
    261         } 
    262          
    263         EventEntry newEvent = new EventEntry(type, parameters, timestamp); 
    264          
    265         int start = 0; 
    266         int end = sortedEvents.size(); 
    267         int center = 0; 
    268         long centerTimestamp; 
    269          
    270         while (start != end) { 
    271             center = start + ((end - start) / 2); 
    272              
    273             if ((center != start) || (center != end)) { 
    274                 centerTimestamp = sortedEvents.get(center).timestamp; 
    275              
    276                 if (centerTimestamp < newEvent.timestamp) { 
    277                     start = Math.max(center, start + 1); 
    278                 } 
    279                 else if (centerTimestamp > newEvent.timestamp) { 
    280                     end = Math.min(center, end - 1); 
    281                 } 
    282                 else { 
    283                     // add the event directly where the center is, as the timestamps of the center 
    284                     // and the new event are equal 
    285                     end = center; 
    286                     start = end; 
    287                     break; 
    288                 } 
    289             } 
    290             else { 
    291                 // add the event to the position denoted by the add index 
    292                 break; 
    293             } 
    294         } 
    295          
    296         sortedEvents.add(start, newEvent); 
    297          
    298256        if ("onchange".equals(type)) { 
    299257            String targetId = parameters.get("target"); 
     
    319277            } 
    320278        } 
     279         
     280        sortedEvents.add(new EventEntry(type, parameters)); 
    321281 
    322282        return true; 
     
    377337         */ 
    378338        private Map<String, String> parameters; 
    379          
     339 
    380340        /** 
    381341         * <p> 
    382          * the timestamp of the event 
     342         * creates a new event entry with event type and parameters 
    383343         * </p> 
    384344         */ 
    385         private long timestamp; 
    386  
    387         /** 
    388          * <p> 
    389          * creates a new event entry with event type, parameters and the timestamp 
    390          * </p> 
    391          */ 
    392         private EventEntry(String type, Map<String, String> parameters, long timestamp) { 
     345        private EventEntry(String type, Map<String, String> parameters) { 
    393346            this.type = type; 
    394347            this.parameters = parameters; 
    395             this.timestamp = timestamp; 
    396348        } 
    397349         
Note: See TracChangeset for help on using the changeset viewer.