::xounit::test
Class TestWebFormatter

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
Class TestWebFormatter
superclass ::xounit::TestCase,

Variables
NameDefault ValueClassComment
currentTestMethod    ::xounit::TestCase
 name of the currently running test method.
nodeName    ::xox::Node
 
result    ::xounit::TestCase
 the result for the current run.
 
Methods
NameComment
testLsort {}  
testLsort2 {}  
   
Methods from ::xotcl::Object
#, ., ?, ?code, ?methods, ?object, abstract, copy, coverageFilter, defaultmethod, extractConfigureArg, filterappend, garbageCollect, get#, getClean#, hasclass, init, methodTag, mixinappend, move, profileFilter, self, setParameterDefaults, shell, tclcmd, traceFilter,
 
Instproc Detail

testLsort

Description:
 
Code:
  ::xounit::test::TestWebFormatter instproc testLsort {}  {
   

        set formatter [ ::xounit::TestResultsWebFormatter new ]

        lappend results [ ::xounit::TestResult new -name c ]
        lappend results [ ::xounit::TestResult new -name b ]
        lappend results [ ::xounit::TestResult new -name a ]
        lappend results [ ::xounit::TestResult new -name c ]
        lappend results [ ::xounit::TestResult new -name c ]
        lappend results [ ::xounit::TestResult new -name d ]
        lappend results [ ::xounit::TestResult new -name A ]

        set results [ lsort -command "$formatter organizeResults" $results ]

        my assertEquals A [ [ lindex $results 0 ] name ] 
        my assertEquals a [ [ lindex $results 1 ] name ] 
        my assertEquals b [ [ lindex $results 2 ] name ] 
        my assertEquals c [ [ lindex $results 3 ] name ] 
    
}

testLsort2

Description:
 
Code:
  ::xounit::test::TestWebFormatter instproc testLsort2 {}  {
   

        set formatter [ ::xounit::TestResultsWebFormatter new ]

        set names [ list  "L3vpnTestbed / 7600-PE1 / gigabitethernet3/3.2000"  "ESR-CE1"  "L3vpnTestbed / ESR-CE1 / Serial:0"  "L3vpnTestbed / ESR-CE1 / pos3/0/0.20"  "ESR-PE1"  "L3vpnTestbed / ESR-PE1 / Serial:0"  "Bgp"  "L3vpnTestbed / GSR-CE1 / pos0/2.20"  "Bgp" ]

        foreach name $names {

            lappend results [ ::xounit::TestResult new -name $name ]
        }
        
        set sortedNames [ lsort $names ]

        set results [ lsort -command "$formatter organizeResults" $results ]

        set index 0

        puts "$sortedNames"
        
        foreach name $sortedNames {

            my assertEquals $name [ [ lindex $results $index ] name ] 
            incr index
        }
    
}