Ignore:
Timestamp:
07/08/15 10:52:51 (9 years ago)
Author:
sherbold
Message:
  • extended SOAPUtils with functions for sorting soap events and removing events that reference services that shall be ignored
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java

    r1989 r1992  
    4242import de.ugoe.cs.autoquest.plugin.http.HTTPLogParser; 
    4343import de.ugoe.cs.autoquest.plugin.http.SOAPUtils; 
     44import de.ugoe.cs.autoquest.plugin.http.SOAPUtils.SequenceOrder; 
    4445import de.ugoe.cs.autoquest.plugin.http.eventcore.SimpleSOAPEventType; 
    4546import de.ugoe.cs.autoquest.testgeneration.RandomWalkGenerator; 
     
    330331                                                        "_" + i, 
    331332                                                    properties.getProperty("test.context"), 
    332                                                     true)); 
     333                                                    Boolean.parseBoolean(properties.getProperty("testcases.data.random", "false")))); 
    333334            lengths[i - 1] = sequence.size(); 
    334335            i++; 
     
    383384        Collection<List<Event>> sequences = parser.getSequences(); 
    384385 
    385         // remove non SOAP events and convert to SimpleSOAPEventType 
    386         Collection<List<Event>> tmpSeqs = SOAPUtils.convertToSimpleSOAPEvent(sequences, true); 
    387         // normalize method names 
    388         Collection<List<Event>> simpleSOAPSequences = SOAPUtils.normalizeOperationNames(tmpSeqs, properties 
     386        sequences = SOAPUtils.removeNonSOAPEvents(sequences); 
     387        sequences = SOAPUtils.sortSequences(sequences, SequenceOrder.REQUEST); 
     388        sequences = SOAPUtils.convertToSimpleSOAPEvent(sequences, true); 
     389        sequences = SOAPUtils.normalizeOperationNames(sequences, properties 
    389390                    .getProperty("methodName.prefixToRemove"), properties 
    390391                    .getProperty("methodName.suffixToRemove")); 
    391  
    392         // remove calls to ignored services 
    393         Set<String> ignoredServices = new HashSet<>(); 
    394         String ignoredServicesString = properties.getProperty("test.ignored.services"); 
    395         if (ignoredServicesString != null) { 
    396             for (String service : ignoredServicesString.split(",")) { 
    397                 ignoredServices.add(service.trim()); 
    398             } 
    399         } 
    400  
    401         for (List<Event> sequence : simpleSOAPSequences) { 
    402             for (Iterator<Event> eventIter = sequence.iterator(); eventIter.hasNext();) { 
    403                 Event event = eventIter.next(); 
    404                 SimpleSOAPEventType eventType = (SimpleSOAPEventType) event.getType(); 
    405                 if (ignoredServices.contains(eventType.getServiceName())) { 
    406                     eventIter.remove(); 
    407                 } 
    408                 else if( ignoredServices.contains(eventType.getClientName())) { 
    409                     eventIter.remove(); 
    410                 } 
    411             } 
    412         } 
    413         return simpleSOAPSequences; 
     392        sequences = SOAPUtils.removeCallsToIgnoredServices(sequences, properties.getProperty("test.ignored.services")); 
     393         
     394        return sequences; 
    414395    } 
    415396 
Note: See TracChangeset for help on using the changeset viewer.