Ignore:
Timestamp:
07/06/15 12:08:37 (9 years ago)
Author:
sherbold
Message:
  • code formatting
File:
1 edited

Legend:

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

    r1925 r1987  
    3838 */ 
    3939public class SOAPUtilsTest { 
    40      
     40 
    4141    @Test 
    4242    public void testConvertToSimpleSOAPEvent_1() throws Exception { 
    4343        HTTPLogParser parser = 
    44                 new HTTPLogParser(new File(ClassLoader 
    45                     .getSystemResource("testParseFile_3_properties.txt").getFile())); 
    46             parser.parseFile(new File(ClassLoader.getSystemResource("testParseFile_3_logfile.log") 
    47                 .getFile())); 
    48             Collection<List<Event>> events = parser.getSequences(); 
     44            new HTTPLogParser(new File(ClassLoader 
     45                .getSystemResource("testParseFile_3_properties.txt").getFile())); 
     46        parser.parseFile(new File(ClassLoader.getSystemResource("testParseFile_3_logfile.log") 
     47            .getFile())); 
     48        Collection<List<Event>> events = parser.getSequences(); 
    4949 
    50             assertNotNull(events); 
    51             assertEquals(1, events.size()); 
     50        assertNotNull(events); 
     51        assertEquals(1, events.size()); 
    5252 
    53             List<Event> sequence = events.iterator().next(); 
    54              
    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                 } else { 
    76                     assertSame(oldEvent, newEvent); 
    77                 } 
     53        List<Event> sequence = events.iterator().next(); 
     54 
     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()); 
    7875            } 
    79              
     76            else { 
     77                assertSame(oldEvent, newEvent); 
     78            } 
     79        } 
     80 
    8081    } 
    8182 
Note: See TracChangeset for help on using the changeset viewer.