Changeset 10243


Ignore:
Timestamp:
10/27/05 18:34:07 (16 years ago)
Author:
piso
Message:

Added tests for JCLASS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/tests/java-tests.lisp

    r10237 r10243  
    22;;;
    33;;; Copyright (C) 2005 Peter Graves
    4 ;;; $Id: java-tests.lisp,v 1.6 2005-10-25 19:24:38 piso Exp $
     4;;; $Id: java-tests.lisp,v 1.7 2005-10-27 18:34:07 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    5858  (class-name (find-class 'java-object nil))
    5959  java-object)
     60
     61(deftest jclass.1
     62  (jcall (jmethod "java.lang.Object" "toString") (jclass "java.lang.String"))
     63  "class java.lang.String")
     64
     65(deftest jclass.2
     66  (equal (jcall (jmethod "java.lang.Object" "getClass") "foo")
     67         (jclass "java.lang.String"))
     68  #+abcl    t
     69  #+allegro nil)
     70
     71(deftest jclass.3
     72  (equal (jclass '|java.lang.String|) (jclass "java.lang.String"))
     73  t)
     74
     75(deftest jclass.4
     76  (let ((class1 (jcall (jmethod "java.lang.Object" "getClass") "foo"))
     77        (class2 (jclass "java.lang.String")))
     78    (jcall (jmethod "java.lang.Object" "equals" "java.lang.Object")
     79           class1 class2))
     80  t)
    6081
    6182(deftest jclass-of.1
     
    115136  "java.lang.String")
    116137
     138(deftest jconstructor.1
     139  (jclass-of (jconstructor "java.lang.String" "java.lang.String"))
     140  "java.lang.reflect.Constructor"
     141  "java.lang.reflect.Constructor")
     142
     143(deftest jnew.1
     144  (let ((constructor (jconstructor "java.lang.String" "java.lang.String")))
     145    (jclass-of (jnew constructor "foo")))
     146  "java.lang.String"
     147  "java.lang.String")
     148
     149(deftest jnew.2
     150  (jclass-of (jnew (jconstructor "java.awt.Point")))
     151  "java.awt.Point"
     152  "java.awt.Point")
     153
     154#-abcl
     155(deftest jnew.3
     156  (jclass-of (jnew "java.awt.Point") "java.awt.Point")
     157  t
     158  "java.awt.Point")
     159
    117160(deftest jcall.1
    118161  (let ((method (jmethod "java.lang.String" "length")))
     
    134177  t)
    135178
    136 (deftest jnew.1
    137   (jclass-of (jnew (jconstructor "java.awt.Point")))
    138   "java.awt.Point"
    139   "java.awt.Point")
    140 
    141 #-abcl
    142 (deftest jnew.2
    143   (jclass-of (jnew "java.awt.Point") "java.awt.Point")
    144   t
    145   "java.awt.Point")
    146 
    147179(deftest jfield.1
    148180  (type-of (jfield "java.lang.Integer" "TYPE"))
Note: See TracChangeset for help on using the changeset viewer.