SmallSense__EditSupportTests.st
changeset 1056 7bcadc51aad8
parent 447 2d45c613a5bd
child 1072 a44c741ee5ef
--- a/SmallSense__EditSupportTests.st	Mon Aug 07 16:06:08 2017 +0100
+++ b/SmallSense__EditSupportTests.st	Wed Oct 18 11:32:20 2017 +0100
@@ -22,7 +22,7 @@
 
 AbstractTestCase subclass:#EditSupportTests
 	instanceVariableNames:'codeView codeViewInteractor editService editSupport'
-	classVariableNames:''
+	classVariableNames:'TriedOpenDisplay'
 	poolDictionaries:''
 	category:'SmallSense-Tests'
 !
@@ -50,6 +50,28 @@
 "
 ! !
 
+!EditSupportTests class methodsFor:'initialization'!
+
+initialize
+    "Invoked at system start or when the class is dynamically loaded."
+
+    "/ please change as required (and remove this comment)
+
+    TriedOpenDisplay := false.
+
+    "Modified: / 17-10-2017 / 23:24:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!EditSupportTests class methodsFor:'queries'!
+
+isAbstract
+    "Return if this class is an abstract class.
+     True is returned here for myself only; false for subclasses.
+     Abstract subclasses must redefine this again."
+
+    ^ self == SmallSense::EditSupportTests.
+! !
+
 !EditSupportTests methodsFor:'accessing-classes'!
 
 editSupportClass
@@ -65,7 +87,15 @@
 
     super setUp.
 
-    Smalltalk loadPackage: 'stx:goodies/sunitext/ui'.
+    TriedOpenDisplay ifFalse:[
+        TriedOpenDisplay := true.
+        Screen current isNil ifTrue:[
+            Smalltalk openDisplay
+        ].
+    ].
+    self skipIf: Screen current isNil description:'No display connection'.
+
+    Smalltalk loadPackage: 'stx:goodies/sunit/ext/ui'.
 
     topView := StandardSystemView new.
     topView extent: 320 @ 200.
@@ -83,7 +113,7 @@
     topView waitUntilVisible.
 
     "Created: / 23-07-2014 / 07:15:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 04-03-2015 / 09:42:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 17-10-2017 / 23:25:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 tearDown
@@ -105,3 +135,5 @@
     ^ '$Changeset: <not expanded> $'
 ! !
 
+
+EditSupportTests initialize!