# JavaIsNullCmd.test --
#
#	Tests the JavaIsNullCmd class.
#
# Copyright (c) 1998 by Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: JavaIsNullCmd.test,v 1.2 2000/12/22 09:47:15 mdejong Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import -force ::tcltest::*
}

setupJavaPackage

test JavaIsNullCmd-1.1 {cmdProc numArgs} {
    list [catch {java::isnull} msg] $msg
} {1 {wrong # args: should be "java::isnull object"}}
test JavaIsNullCmd-1.2 {cmdProc numArgs} {
    list [catch {java::isnull foo extra} msg] $msg
} {1 {wrong # args: should be "java::isnull object"}}

test JavaIsNullCmd-2.1 {cmdProc} {
    java::isnull [java::null]
} 1
test JavaIsNullCmd-2.2 {cmdProc} {
    java::isnull [java::new {java.lang.String java.lang.String} "foo"]
} 0
test JavaIsNullCmd-2.3 {cmdProc} {
    list [catch {java::isnull "foo"} msg] $msg
} {1 {unknown java object "foo"}}
test JavaIsNullCmd-2.4 {cmdProc} {
    list [catch {java::isnull java0x00} msg] $msg
} {1 {unknown java object "java0x00"}}

# cleanup
::tcltest::cleanupTests
return
