VAStGoodies.com
Your VA Smalltalk OSS repository. Powered by
with
.
Configuration Maps
|
Projects
|
Tags
|
Developers
|
Statistics
|
RSS
|
Disclaimer
|
About
|
Help
Configuration Maps Browser
Configuration Map Names
Abt Image Startup
AbtOleEdit
AbxProcessPeek
Announcements Core
Announcements Demos Seaside
Announcements Tests
Announcements Tools VA
Cloudfork
Cloudfork ActiveItem
CloudforkAWS
CloudforkAWSWithTests
CloudforkSSO
CloudforkSSOWithTests
CodeManagement
ComputerTelephony
Compuware SplitterWidget
CounterMap
DhbNumerics
DhbNumericsWithTests
Flotr Core
FogBugz Support
GemStoneCodeManagement
GemStoneCodeManagement Mods
Glorp
GlorpTest
GlorpVAPortMap
Goodies - UML Designer
GreaseVASTExtensions
Highcharts Seaside Addon
HQA Automated Build Support
HQA Code Snapshot Tool
InstallService
JNIPort
JNIPort Tests
JokXTEAEncryption
JQuery-plugin Autocomplete
JQuery-plugin Bind
JQuery-plugin QTip
JQuery-plugin Radiobutton and Checkbox
JQuery-plugin Table Sorter
JQuery-plugin Table Sorter Example
JQuery/JQueryUI
JQuery/JQueryUI Tests
JQueryMobile
JQueryMobile Tests
JQueryWidgetBox Core
JQueryWidgetBox Dynatree
JQueryWidgetBox Examples
JQueryWidgetBox Portability Extentions
JQueryWidgetBox Tests
JSON
KscCase
KscDynamicSortBlock
KscEMail
KscInspectWindow
KscLibUsb
KscMZZipExtensions
KscShellNotifyIcon
KscViewExtensions
KscWeather
KscX10Base
KscX10LibUSB
KscX10LibUsbGui
LibGit
Magritte
Magritte Seaside
Magritte Tests
MagritteMagic
Mastering ENVY/Developer Refactoring Browser Extensions
Mastering ENVY/Developer Script Manager
MessagePack
MessagePack Tests
MetaTest Browser
MethodPragmas
MethodWrappers
MethodWrappers Tests
MethodWrappersBase
MFNLSManagement
MiniSMock
MinneStoreDB
Modelling
Monticello Importer - Beta
MQTT-Paho
MQTT-Paho Tests
MSKAdditionalColorSupport
MSKCLDTPrimitivesExtension
MSKCLDTPrimitivesExtensionWithTestsAndResources
MSKClick
MSKCouchDB
MSKCouchDBWithTests
MSKCurlInterface
MSKDyBase
MSKDyBaseWithTests
MSKECLWrapper
MSKECLWrapperTestsAndResources
MSKFFLLInterface
MSKFischertechnikInterface
MSKFreeImageUI
MSKFreeImageWrapper
MSKFreeImageWrapperWithTests
MSKGeneralDatabase
MSKGhostscriptInterface
MSKGLibWrapper
MSKGLibWrapperWithTests
MSKICU
MSKICUAndTests
MSKICXDLibHaruDM
MSKICXDTNetStringsDM
MSKICXDTNetStringsTests
MSKJSONWrapper
MSKJSONWrapperWithTests
MSKLibHaruInterface
MSKLogging
MSKLua
MSKLuaWithTests
MSKMdlPlainRuntime
MSKMonoInterface
MSKMSAgentWrapper
MSKOleAdditions
MSKOOBaseDLLWrapper
MSKOOoAutoGenerated
MSKOOoBaseLibrary
MSKOOoCodeGenerator
MSKOOoExamplesAndIDE
MSKOOoSmalltalkExtensions
MSKOpenCLSupport
MSKOpenGLSupport
MSKOpenGLSupport Core
MSKOpenGLSupport Examples
MSKOpenGLSupport Examples FreeImage
MSKOpenGLSupport GUI
MSKOpenGLSupport Runtime Loading
MSKOpenGLSupport Structures
MSKPlatformExtension
MSKPostgreSQL
MSKPostgreSQLAbtDBMLayer
MSKPostgreSQLAbtDBMLayerWithTests
MSKPostgreSQLWithTests
MSKProcessViewer
MSKRaphaelExtensions
MSKRemoteCommandTools
MSKResourceManagement
MSKResourceManagementRuntime
MSKRexxSupport
MSKRexxSupportWithTests
MSKScintillaWrapper
MSKSDL
MSKSDLWithTests
MSKSeasideNLSExample
MSKSeasideNLSExtension
MSKSeasideSimpleREST
MSKSnarlInterface
MSKSQLite
MSKSQLiteAbtDBMLayer
MSKSQLiteGlorpSupport
MSKSQLiteWithTests
MSKSyslog
MSKSystemExtension
MSKSystemGraphicsExtension
MSKTestModel
MSKTreBinding
MSKTreBindingWithTests
MSKUDPMulticast
MSKUREWrapper
MSKVectorExtension
MSKVectorExtensionsWithTests
MSKZLibWrapper
MSKZLibWrapperWithTests
Mustache
NeoCSV
NeoJSON
Obdobion, EMan - Developer
Obdobion, EMan - Distribution
Obdobion, EMan - Examples
Obdobion, EMan - Runtime
OGLogger
Philemon Event Support
Philemon Melissa
Philemon TaggedData
Philemon Tools
Pier
Pier Add-ons
Pier Seaside
Pier Seaside Tests
Pier SIXX Persistence
Pier Tests
PUMRESTRuntime
QuotedPrintableCoderRun
QuotedPrintableCoderWithTests
Raphaël - JavaScript Library
Raphael - JavaScript Library Examples
RaspberryHardwareInterfaceCore
RaspberryHardwareInterfaceTest
RaspberryHardwareInterfaceViaDaemonTest
Reef
Refactoring Browser
Refactoring Browser Model
RefactoryTesting
Regex
Roassal
Roassal-Core
Seaside Core
Seaside GoogleChart
Seaside REST
Seaside REST Tests
SeasideGoogleMapsV3
SeasideGoogleMapsV3Examples
SimGeohash
Simple GBS Temperature Sensor Example
Simple Improvements
SIXX
SIXX Tests
SpsPdfLib
SpsPdfLib Development
StOMP
StOMP Tests
STON
StsBrowsersWin w/Code Completion
SUnit
SUnit Browser
SUnit Browser - Packagable
SUnit Tests
SWFObject2 Seaside Addon
SWFObject2 Seaside Addon Demo
Test Browser
Toothpick
TwitterBoostrapForSeaside
TwitterBootstrapForSeasideExamples
TwitterBootstrapForSeasideTests
USAstronomicalApi
VA Assist Pro for TrailBlazer
VAStGoodies.com Tools
VBRegex
WinCrypt
WinCryptWithTests
WinHttpClient
WinHttpClientWebServiceSupport
WinHttpClientWebServiceSupportWithTests
WinHttpClientWithTests
z.ST: Database, PostgreSQL-Base
z.ST: SUnit
z.ST: SUnit Testing
Zstandard
Zstandard Tests
Versions
Download
V 8.5.0 [194] + JTU 1
V 8.5.0 [194] + JTU 1.0
Applications
SUnit V 8.0.2 [146] + JTU 1.1
SUnitPreload V 8.0.2 [146]
Config. Expressions
Required Maps
Find
Notes
See comment for general SUnit information. 8.5.0 [194] + JTU 1.0 Added failureDecsription to TestAsserter for better logging and statistics 8.0.4 [166] Moved SUnitTests to SUnit Tests map. 8.0.2 [140] 4.0 RC1 is the SUnit project's 4.0 RC1 release, tested in the 140 development build of VASmalltalk 8.0.2. - The major 4.0 change is to dispatch on the exception (see #sunitAnnounce:toResult:). This allows user-defined subclasses of TestFailure or Error to plugin different behaviour in specific cases. (For robust behaviour in the face of old code using pre-ANSI-error-raising, Signal also responds to it.) - TestResource decouples #setUp from #initialize. Formerly it was hard to create a resource without setting it up immediately, a problem for certian complex usage patterns. Now the framework sends both methods independently, and the user can do so when hand-debugging a tricky resource. (Also TestResource>>uninitialize, introduced in SUnit 3.2, is dropped again; send #tearDown.) - TestCase incorporates #shouldInheritSelectors in #allTestSelectors, so #buildSuiteFromSelectors is the only method needed; #buildSuiteFromAll/LocalSelectors discarded, #testSelectors is private. - More efficient walking superclass chain, terminated by #lookupHierarchyRoot. - TestResource assert against their callers, not themselves (except for #current - see its comment). - Increasing ANSI exception handling in the 8.0 stream of VASmalltalk simplifies SUnitPreload. - Better testing of TestResource by inheriting more tests to subclasses looking at special cases. - Some improvements to class and method comments. 3.3 RC1: released during VASmalltalk 8.0.1, also works with earlier versions and should work with later ones. - Move the reaction to resource unavailability from TestCase to TestResource>>availableFor: so that subclasses may add to or alter the default behaviour (which is to raise a TestFailure). - If two resources require a resource (e.g. two resources add data to a database and remove it on tearDown, and both use the same database connection resource), all three resources are torn down in the right order. - Prevent looping in tearDown of self-prerequing resources (cannot be setUp of course, but in 3.2 tearDown looped forever if a developer accidentally created a circular resource chain). - Move deprecated method #correctCount to 'deprecated' protocol - #sunitVersion set to 3.3. 3.2 RC4: released during VASmalltalk 8.0.0, also works with earlier versions and should work with later ones. - TestResources have been improved. The first test that wants a resource tries to set it up; later tests that use it just accept the outcome of that first attempt. Only tests that need a resource fail if it did not set up. Resources are set up in order and torn down in reverse order. plus: - #rerunableVersion hook (to override in subclasses with key instVars) kept - #isExistent dropped This version is tested in 8.0.0 and 7.5.3 (and should work in earlier versions). CS12.NFR.3: as its predecessor, plus - isExistent hook to support CompetingTestResource pattern - rerunableVersion hook to support tests with key instvars pattern - improved TestResources test 7.5.3: Camp Smalltalk 3.1 RC10 with following changes: Removed SUnitUI application to allow use of SUnit Browser Updated SunitPreload to 3.1 RC5 TestFailure class moved to subclass of Exception and extraneous methods removed SUnitNameMapper updated to answer exception classes rather than exception instances Block>>sunitOn:do modified to map both class- and instance-based exceptions
Comment
SUnit is the original eXtreme Programming test-driven-development framework from which so many ...Unit test frameworks have been cloned. It powered test-driven development in the XP method, inspirer of all agile methods. Dialect-specific code is isolated in SUnitPreload; other code is common between dialects Thus tests written in SUnit can be easily ported between dialects. The current SUnit is little changed from the original but some features have been added: additions to the assertion protocol, additional class TestResource and abstract superclass TestAsserter, and basic logging. Assertion description strings ===================== Make your tests more informative by using #assert:description: and #deny:description: rather than just #assert and #deny. These methods take a string as their second argument. If the test case fails, this string will be shown in the notifier (and in the log, if logging is active) instead of the less informative default: ''Assertion failed''. Writing description strings can also be an efficient way to document the intent of an assertion and to express what its failure would mean both in generic convenience protocol, e.g. TestAsserter>>assert: anObject equals: anotherObject self assert: anObject = anotherObject description: anObject printString, ' is not equal to ', anotherObject printString. and in specific tests, e.g. self deny: DbRegistry isOnline description: ('I cannot meaningfully test connecting because we are already connected to <1p>' expandMacrosWith: DbRegistry dbIdentifier). The description string can be constructed dynamically but remember, the string will be constructed whether or not the assertion fails; e.g. in the example above, we write <1p> instead of <1s> to avoid DNUing when dbIdentifier returns nil. Resumable assertions ================ The default case is that a single failure halts a test, bypassing the remaining code and going immediately to #tearDown (or, if the failing assertion is in #tearDown, aborting the rest of that method): the assumption is that later code in a test depends on earlier code having passed. Sometimes this is not so and it is more useful to see when debugging (and/or to log when running) the results from several assertions in a test. Example: #('same' '*' '*.txt' 'a*c') with: #('same' 'any' 'some.txt' 'abc') do: [:eachMeta :eachString | self assert: (eachMeta match: eachString) description: ('<1s> does not match <2s>' expandMacrosWith: eachMeta with: eachString) resumable: true]. Raising a ResumableTestFailure means that all the assertions will be run. If the test case is logging, this will print out a message to the log for each one that fails. When debugging, the user can hit ''proceed'' to continue the test and see which other expressions do not match. Test resources ============ A TestResource class holds a singleton instance that is set up when the first test that uses it is encountered and torn down at the end of the test suite's run. TestResource understands #assert:description:, #deny:description:, etc., so that code written in the #setUp and #tearDown of a TestCase can easily be refactored into the #setUp and #tearDown of a TestResource if it starts to take too long. The order returned by TestCase class>>resources and TestResource class>>resources is respected: resources are set up in that order and torn down in the reverse order. For example, suppose a test requires both a resource that provides a database connection and another resource that adds some data temporarily to a database; it can provide the resources in order and rely on their setUps and tearDowns being called in the correct order. Where a resource is required by two other resources, it will not be torn down until both requirers have been torn down. TestResource class>>availableFor: defines what a resource does when a test or another resource requires it. The standard behaviour is to assert that it is available, so raising a TestFailure if it is not, but a specialised resource subclass might override this. TestAsserter ========= TestCase and TestResource share a common superclass TestAsserter, which understands the #assert:... and #deny:... protocol (its class-side understands #assert:description:). If you find yourself refactoring common behaviour from test cases or test resources into a helper class, this may be a convenient superclass to use. Logging support ============= The description strings described above may be logged to a Stream such as the Transcript, a file, stdout, etc. - Choose whether to log by overriding TestAsserter class>>isLogging - Choose where to log by overriding TestAsserter class>>failureLog (default is the Transcript).
Project:
SUnit
Developer:
Joachim Tuchel
Use the
VAStGoodies.com Tools
to submit your contributions.