JavaLookupTests.st
changeset 3602 e35b48285df7
parent 3600 8f65af4b2a3d
equal deleted inserted replaced
3601:4f1b473722cb 3602:e35b48285df7
   484 ! !
   484 ! !
   485 
   485 
   486 !JavaLookupTests methodsFor:'tests - java lookup - fields'!
   486 !JavaLookupTests methodsFor:'tests - java lookup - fields'!
   487 
   487 
   488 test_field_static_01
   488 test_field_static_01
       
   489     self javaTestClass instVarNamed:#ICONST1 put: 1.
   489     self assert: (self javaTestClass ICONST1 == 1).
   490     self assert: (self javaTestClass ICONST1 == 1).
   490     self assert: (self javaTestClass ICONST_2 == 2).
   491     self assert: (self javaTestClass ICONST_2 == 2).
   491 
   492 
       
   493     "/ It should not be possible to modify a final field
       
   494     self should: [self javaTestClass ICONST1: 10] raise: NoModificationError
       
   495 
   492     "Created: / 25-07-2016 / 23:33:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   496     "Created: / 25-07-2016 / 23:33:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   497     "Modified: / 26-07-2016 / 20:48:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   498 !
       
   499 
       
   500 test_field_static_02
       
   501     self javaTestClass instVarNamed: #CHR put: $C codePoint.
       
   502     self assert: (self javaTestClass CHR == $C).
       
   503     self javaTestClass CHR: $X.
       
   504     self assert: (self javaTestClass CHR == $X).
       
   505 
       
   506     "Created: / 26-07-2016 / 08:23:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   507     "Modified: / 26-07-2016 / 17:21:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   508 !
       
   509 
       
   510 test_field_static_03
       
   511     | obj |
       
   512 
       
   513     obj := self javaTestClass new.
       
   514     self assert: (obj chr == Character null).
       
   515     obj chr: $X.
       
   516     self assert: (obj chr == $X).
       
   517 
       
   518     "Created: / 26-07-2016 / 18:02:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   493 ! !
   519 ! !
   494 
   520 
   495 !JavaLookupTests methodsFor:'tests - obsolete'!
   521 !JavaLookupTests methodsFor:'tests - obsolete'!
   496 
   522 
   497 _testSetManipulator_add
   523 _testSetManipulator_add