src/TestletTestCaseProxy.st
branchjk_new_structure
changeset 820 beb45cce2856
parent 761 43e017ec7958
child 824 26e719a7e88c
--- a/src/TestletTestCaseProxy.st	Tue May 24 13:06:14 2011 +0000
+++ b/src/TestletTestCaseProxy.st	Sun May 29 21:38:05 2011 +0000
@@ -80,18 +80,13 @@
 
 testSelectors
     "testlet always has only one test method, but maybe for the future.."
-    | javaClass |
 
-    self == TestletTestCaseProxy ifTrue: [ ^ #() ].
-    javaClass := self javaClass.
-    (javaClass includesBehavior: (JavaVM classForName: 'gnu.testlet.Testlet')) 
-        ifTrue: [ ^ javaClass selectors select: [:sel | sel startsWith: 'test' ]. ]
-        ifFalse: [ ^ #() ].
+    ^ #( #'test(Lgnu.testlet.TestHarness;)' ).
 
     "Created: / 01-03-2011 / 10:49:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 03-03-2011 / 00:34:39 / Marcel Hlopko <hlopik@gmail.com>"
     "Modified: / 04-03-2011 / 00:05:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 29-04-2011 / 10:24:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 29-05-2011 / 22:54:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
 
 !TestletTestCaseProxy class methodsFor:'queries'!
@@ -164,22 +159,17 @@
     | harnessMock |
 
     harnessMock := self harnessMock.
-    [ self javaClass new perform: 'test(Lgnu/testlet/TestHarness;)V' sunitAsSymbol with: harnessMock ] 
-        on: JavaError
-        do: 
-            [:ex | 
-            "This is the tricky part. We have to auto-magically convert
-             jUnit's AssertionFailedError to sUnits TestFailure's"
-            "Bad, bad, I know..."
-            (ex parameter class name == #'junit/framework/AssertionFailedError') 
-                ifTrue: [ TestResult failure sunitSignalWith: ex description ]
-                ifFalse: [ ex pass ] ].
-    harnessMock instVarNamed: 'passed' = 0
-        ifTrue: [ TestResult failure sunitSignalWith: 'Test failed' ].
+    
+    [ self javaClass new 
+        perform: 'test(Lgnu/testlet/TestHarness;)V' sunitAsSymbol
+        with: harnessMock ] on: JavaError
+            do: 
+                [:ex | TestResult failure sunitSignalWith: ex description].
+    ((harnessMock instVarNamed: 'passed') = 0 ) ifTrue: [ TestResult failure sunitSignalWith: 'Test failed' ].
 
     "Created: / 01-03-2011 / 14:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 04-03-2011 / 00:07:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 29-04-2011 / 17:39:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 29-05-2011 / 23:19:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
 
 !TestletTestCaseProxy class methodsFor:'documentation'!