Ignore:
Timestamp:
07/07/15 08:36:28 (9 years ago)
Author:
sherbold
Message:
  • updated EqualSOAPDataMap: not a singleton anymore, now each event has a reference to the map. the map is created when the SOAPEvents are converted to SimpleSOAPEvents using the appropriate method from the SOAPUtils
  • the logic for deciding if random SOAP requests are selected or the one of the event itself was changed within the SimpleSOAPEvents. Now methods for both are offered and the caller has to decide which method to choose
  • the test case generation in the model utils now has a parameter to decide if random data or the data of the SimpleSOAPEvents is used
Location:
trunk/autoquest-plugin-http-test/src/test/java/de/ugoe/cs/autoquest/http
Files:
1 deleted
1 edited

Legend:

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

    r1987 r1988  
    4646        parser.parseFile(new File(ClassLoader.getSystemResource("testParseFile_3_logfile.log") 
    4747            .getFile())); 
    48         Collection<List<Event>> events = parser.getSequences(); 
     48        Collection<List<Event>> sequences = parser.getSequences(); 
    4949 
    50         assertNotNull(events); 
    51         assertEquals(1, events.size()); 
     50        assertNotNull(sequences); 
     51        assertFalse(sequences.isEmpty()); 
    5252 
    53         List<Event> sequence = events.iterator().next(); 
     53        Collection<List<Event>> newSequences = SOAPUtils.convertToSimpleSOAPEvent(sequences, false); 
     54         
     55        assertNotNull(newSequences); 
     56        assertEquals(sequences.size(), newSequences.size()); 
    5457 
    55         List<Event> newSequence = SOAPUtils.convertToSimpleSOAPEvent(sequence, false); 
    56  
    57         assertNotNull(newSequence); 
    58         assertEquals(sequence.size(), newSequence.size()); 
    59  
    60         Iterator<Event> oldSeqIter = sequence.iterator(); 
    61         Iterator<Event> newSeqIter = newSequence.iterator(); 
    62  
    63         while (oldSeqIter.hasNext()) { 
    64             Event oldEvent = oldSeqIter.next(); 
    65             Event newEvent = newSeqIter.next(); 
    66  
    67             if (oldEvent.getType() instanceof SOAPEventType) { 
    68                 assertTrue(newEvent.getType() instanceof SimpleSOAPEventType); 
    69                 SOAPEventType oldEventType = (SOAPEventType) oldEvent.getType(); 
    70                 SimpleSOAPEventType newEventType = (SimpleSOAPEventType) newEvent.getType(); 
    71                 assertEquals(oldEventType.getCalledMethod(), newEventType.getCalledMethod()); 
    72                 assertEquals(oldEventType.getServiceName(), newEventType.getServiceName()); 
    73                 assertEquals(oldEventType.getClientName(), newEventType.getClientName()); 
    74                 assertNull(newEvent.getTarget()); 
    75             } 
    76             else { 
    77                 assertSame(oldEvent, newEvent); 
     58        // compare sequences 
     59        Iterator<List<Event>> oldIter = sequences.iterator(); 
     60        Iterator<List<Event>> newIter = newSequences.iterator(); 
     61         
     62        while( oldIter.hasNext() ) { 
     63            Iterator<Event> oldSeqIter = oldIter.next().iterator(); 
     64            Iterator<Event> newSeqIter = newIter.next().iterator(); 
     65     
     66            while (oldSeqIter.hasNext()) { 
     67                Event oldEvent = oldSeqIter.next(); 
     68                Event newEvent = newSeqIter.next(); 
     69     
     70                if (oldEvent.getType() instanceof SOAPEventType) { 
     71                    assertTrue(newEvent.getType() instanceof SimpleSOAPEventType); 
     72                    SOAPEventType oldEventType = (SOAPEventType) oldEvent.getType(); 
     73                    SimpleSOAPEventType newEventType = (SimpleSOAPEventType) newEvent.getType(); 
     74                    assertEquals(oldEventType.getCalledMethod(), newEventType.getCalledMethod()); 
     75                    assertEquals(oldEventType.getServiceName(), newEventType.getServiceName()); 
     76                    assertEquals(oldEventType.getClientName(), newEventType.getClientName()); 
     77                    assertNull(newEvent.getTarget()); 
     78                } 
     79                else { 
     80                    assertSame(oldEvent, newEvent); 
     81                } 
    7882            } 
    7983        } 
Note: See TracChangeset for help on using the changeset viewer.