# 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.1.1.1 1998/10/14 21:09:24 cvsadmin Exp $

# Note: This test file must be sourced from the parent directory
#       or else the defs file may not be properly loaded.

if {[string compare test [info procs test]] == 1} then {source defs}

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"}}

