::xoexception::test
Class TestException

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
Tested Class:
::xoexception::Exception

Class TestException
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
testCatchExceptionWithTclCatch {}  
testGetTheMessageFromTheException {}  
testThrowExceptionWithTclError {}  
   
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

testCatchExceptionWithTclCatch

Description:
 
Code:
  ::xoexception::test::TestException instproc testCatchExceptionWithTclCatch {}  {
   


    catch {

        error [ ::xoexception::Error new ]

        puts "This should not be executed!  TestException testCatchExceptionWithTclCatch Failed!"

        exit 
    } result

    ::xotcl::my assertTrue [ info exists result ] "Result should be the Error"

}

testGetTheMessageFromTheException

Description:
 
Code:
  ::xoexception::test::TestException instproc testGetTheMessageFromTheException {}  {
   


    catch {

        error [ ::xoexception::Error new "An Error message" ]

        puts "This should not be executed!  TestException testGetTheMessageFromTheException Failed!"

        exit 
    } result

    ::xotcl::my assertTrue [ info exists result ]  "Result should be the Error"
        
    ::xotcl::my assertEquals [ $result message ] "An Error message"

}

testThrowExceptionWithTclError

Description:
 
Code:
  ::xoexception::test::TestException instproc testThrowExceptionWithTclError {}  {
   

    catch {

        error [ ::xoexception::Error new ]

        puts "This should not be executed!  TestException testThrowExceptionWithTclError Failed!"

        exit 
    }


}