| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'class-001.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
var SECTION = "LiveConnect Classes"; |
| 16 |
var VERSION = "1_3"; |
| 17 |
var TITLE = "JavaClass objects"; |
| 18 |
|
| 19 |
startTest(); |
| 20 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
var E_TYPE = "function"; |
| 26 |
|
| 27 |
|
| 28 |
var E_JSCLASS = "[object JavaClass]"; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
var java_array = new Array(); |
| 34 |
var test_array = new Array(); |
| 35 |
|
| 36 |
var i = 0; |
| 37 |
|
| 38 |
java_array[i] = new JavaValue( java.awt.Image ); |
| 39 |
test_array[i] = new TestValue( "java.awt.Image" ); |
| 40 |
i++; |
| 41 |
|
| 42 |
java_array[i] = new JavaValue( java.beans.Beans ); |
| 43 |
test_array[i] = new TestValue( "java.beans.Beans" ); |
| 44 |
i++; |
| 45 |
|
| 46 |
java_array[i] = new JavaValue( java.io.File ); |
| 47 |
test_array[i] = new TestValue( "java.io.File" ); |
| 48 |
i++; |
| 49 |
|
| 50 |
java_array[i] = new JavaValue( java.lang.String ); |
| 51 |
test_array[i] = new TestValue( "java.lang.String" ); |
| 52 |
i++; |
| 53 |
|
| 54 |
java_array[i] = new JavaValue( java.math.BigDecimal ); |
| 55 |
test_array[i] = new TestValue( "java.math.BigDecimal" ); |
| 56 |
i++; |
| 57 |
|
| 58 |
java_array[i] = new JavaValue( java.net.URL ); |
| 59 |
test_array[i] = new TestValue( "java.net.URL" ); |
| 60 |
i++; |
| 61 |
|
| 62 |
java_array[i] = new JavaValue( java.text.DateFormat ); |
| 63 |
test_array[i] = new TestValue( "java.text.DateFormat" ); |
| 64 |
i++; |
| 65 |
|
| 66 |
java_array[i] = new JavaValue( java.util.Vector ); |
| 67 |
test_array[i] = new TestValue( "java.util.Vector" ); |
| 68 |
i++; |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
for ( i = 0; i < java_array.length; i++ ) { |
| 75 |
CompareValues( java_array[i], test_array[i] ); |
| 76 |
} |
| 77 |
|
| 78 |
test(); |
| 79 |
function CompareValues( javaval, testval ) { |
| 80 |
|
| 81 |
new TestCase( SECTION, |
| 82 |
"typeof (" + testval.description +")", |
| 83 |
testval.type, |
| 84 |
javaval.type ); |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
new TestCase( SECTION, |
| 94 |
"(" + testval.description +") +''", |
| 95 |
testval.classname, |
| 96 |
javaval.classname ); |
| 97 |
} |
| 98 |
function JavaValue( value ) { |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
this.classname = value +""; |
| 104 |
this.type = typeof value; |
| 105 |
return this; |
| 106 |
} |
| 107 |
function TestValue( description, value ) { |
| 108 |
this.description = description; |
| 109 |
this.type = E_TYPE; |
| 110 |
this.jclass = E_JSCLASS; |
| 111 |
this.lcclass = java.lang.Class.forName( description ); |
| 112 |
|
| 113 |
this.classname = "[JavaClass " + |
| 114 |
( ( description.substring(0,9) == "Packages." ) |
| 115 |
? description.substring(9,description.length) |
| 116 |
: description |
| 117 |
) + "]" |
| 118 |
|
| 119 |
|
| 120 |
return this; |
| 121 |
} |