From e9453024bf3a9b97eddc9e4ec17a2da4c0b87259 Mon Sep 17 00:00:00 2001 From: mreyes Date: Mon, 1 Jul 2024 19:04:54 -0300 Subject: [PATCH] .. --- .../AbstractCURIETest.class.st | 29 ++++----- .../Hyperspace-Model-Tests/CURIETest.class.st | 17 ++--- .../EntityTagTest.class.st | 20 +++--- .../HTTPClientErrorTest.class.st | 32 +++++----- .../HTTPErrorTest.class.st | 14 +++-- .../HTTPNotAcceptableTest.class.st | 10 +-- .../HTTPServerErrorTest.class.st | 22 ++++--- .../LanguageRangeTest.class.st | 18 +++--- .../LanguageTagTest.class.st | 26 ++++---- .../MediaTypeTest.class.st | 16 ++--- .../PortAvailabilityCheckerTest.class.st | 20 +++--- .../Hyperspace-Model-Tests/RetryTest.class.st | 62 ++++++++++--------- .../SafeCURIETest.class.st | 17 ++--- .../WebLinkTest.class.st | 48 +++++++------- .../ZnClientHyperspaceExtensionsTest.class.st | 22 ++++--- .../ZnEntityHyperspaceExtensionsTest.class.st | 14 +++-- .../ZnEventToLogRecordAdapterTest.class.st | 27 ++++---- ...nMimeTypeHyperspaceExtensionsTest.class.st | 10 +-- ...ZnRequestHyperspaceExtensionsTest.class.st | 26 ++++---- ...nResponseHyperspaceExtensionsTest.class.st | 40 ++++++------ .../ZnServerHyperspaceExtensionsTest.class.st | 10 +-- .../ZnUrlHyperspaceExtensionsTest.class.st | 18 +++--- source/Hyperspace-Model-Tests/package.st | 2 +- .../ZnEventToLogRecordAdapter.class.st | 37 +++++------ 24 files changed, 300 insertions(+), 257 deletions(-) diff --git a/source/Hyperspace-Model-Tests/AbstractCURIETest.class.st b/source/Hyperspace-Model-Tests/AbstractCURIETest.class.st index ebd8b5f..a4deada 100644 --- a/source/Hyperspace-Model-Tests/AbstractCURIETest.class.st +++ b/source/Hyperspace-Model-Tests/AbstractCURIETest.class.st @@ -2,24 +2,25 @@ An AbstractCURIETest is a test class for testing the behavior of AbstractCURIE " Class { - #name : #AbstractCURIETest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests' + #name : 'AbstractCURIETest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests', + #package : 'Hyperspace-Model-Tests' } -{ #category : #testing } +{ #category : 'testing' } AbstractCURIETest class >> isAbstract [ ^ self = AbstractCURIETest ] -{ #category : #private } +{ #category : 'private' } AbstractCURIETest >> curieClass [ ^ self subclassResponsibility ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testAccessing [ | curie | @@ -37,7 +38,7 @@ AbstractCURIETest >> testAccessing [ assertUrl: curie relativeReference equals: 'Person#legal' asUrl ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testAsWebLink [ | curie | @@ -45,7 +46,7 @@ AbstractCURIETest >> testAsWebLink [ self assert: curie asWebLink equals: ( WebLink to: curie ) ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testCantCreateWithAbsoluteReference [ self @@ -54,7 +55,7 @@ AbstractCURIETest >> testCantCreateWithAbsoluteReference [ withMessageText: 'https://google.com/ must be a relative reference' ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testCantCreateWithEmptyPrefix [ self @@ -63,7 +64,7 @@ AbstractCURIETest >> testCantCreateWithEmptyPrefix [ withMessageText: 'A CURIE prefix cannot be empty' ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testCantExpandToURIInContext [ | curie | @@ -75,7 +76,7 @@ AbstractCURIETest >> testCantExpandToURIInContext [ withMessageText: 'Missing namespace "users"' ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testCantExpandToURIInContextRecursiverly [ | userCurie usersCurie context | @@ -90,7 +91,7 @@ AbstractCURIETest >> testCantExpandToURIInContextRecursiverly [ withMessageText: 'Missing namespace "api"' ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testComparing [ | curie | @@ -106,7 +107,7 @@ AbstractCURIETest >> testComparing [ deny: curie equals: ( self curieClass prefixedBy: 'orgs' referencing: 'octocat' asUrl ) ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testExpandToURIInContext [ | curie context | @@ -119,7 +120,7 @@ AbstractCURIETest >> testExpandToURIInContext [ equals: 'https://api.github.com/users/octocat' asUrl ] -{ #category : #tests } +{ #category : 'tests' } AbstractCURIETest >> testExpandToURIInContextRecursively [ | usersCurie userCurie context | diff --git a/source/Hyperspace-Model-Tests/CURIETest.class.st b/source/Hyperspace-Model-Tests/CURIETest.class.st index 8fa9950..b90dbb2 100644 --- a/source/Hyperspace-Model-Tests/CURIETest.class.st +++ b/source/Hyperspace-Model-Tests/CURIETest.class.st @@ -2,18 +2,19 @@ A CompactURITest is a test class for testing the behavior of CompactURI " Class { - #name : #CURIETest, - #superclass : #AbstractCURIETest, - #category : 'Hyperspace-Model-Tests' + #name : 'CURIETest', + #superclass : 'AbstractCURIETest', + #category : 'Hyperspace-Model-Tests', + #package : 'Hyperspace-Model-Tests' } -{ #category : #private } +{ #category : 'private' } CURIETest >> curieClass [ ^ CURIE ] -{ #category : #tests } +{ #category : 'tests' } CURIETest >> testAsSafeCURIE [ self @@ -21,7 +22,7 @@ CURIETest >> testAsSafeCURIE [ equals: '[users:octocat]' ] -{ #category : #tests } +{ #category : 'tests' } CURIETest >> testFromString [ | curie | @@ -32,7 +33,7 @@ CURIETest >> testFromString [ assertUrl: curie relativeReference equals: 'octocat' asUrl / 'tokens' ] -{ #category : #tests } +{ #category : 'tests' } CURIETest >> testParsingErrors [ self @@ -50,7 +51,7 @@ CURIETest >> testParsingErrors [ withMessageText: 'Cannot create a CURIE from "users"' ] -{ #category : #tests } +{ #category : 'tests' } CURIETest >> testPrinting [ | curie curieWithPath curieWithFragment | diff --git a/source/Hyperspace-Model-Tests/EntityTagTest.class.st b/source/Hyperspace-Model-Tests/EntityTagTest.class.st index 3d77b21..d8392df 100644 --- a/source/Hyperspace-Model-Tests/EntityTagTest.class.st +++ b/source/Hyperspace-Model-Tests/EntityTagTest.class.st @@ -2,12 +2,14 @@ I'm a test case for EntityTag " Class { - #name : #EntityTagTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-IETF' + #name : 'EntityTagTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-IETF', + #package : 'Hyperspace-Model-Tests', + #tag : 'IETF' } -{ #category : #tests } +{ #category : 'tests' } EntityTagTest >> testAsEntityTag [ self @@ -15,14 +17,14 @@ EntityTagTest >> testAsEntityTag [ assert: (EntityTag fromString: '"12345"') asEntityTag equals: (EntityTag fromString: '"12345"') ] -{ #category : #tests } +{ #category : 'tests' } EntityTagTest >> testAsString [ self assert: (EntityTag with: '12345') asString equals: '"12345"'. self assert: (EntityTag weakWith: '12345') asString equals: 'W/"12345"'. ] -{ #category : #tests } +{ #category : 'tests' } EntityTagTest >> testCaseSensitiveWeakEntityTagCreation [ self @@ -31,7 +33,7 @@ EntityTagTest >> testCaseSensitiveWeakEntityTagCreation [ raise: InstanceCreationFailed ] -{ #category : #tests } +{ #category : 'tests' } EntityTagTest >> testFromString [ self @@ -49,7 +51,7 @@ EntityTagTest >> testFromString [ should: [ EntityTag fromString: 'w/"1"' ] raise: InstanceCreationFailed ] -{ #category : #tests } +{ #category : 'tests' } EntityTagTest >> testHash [ self @@ -60,7 +62,7 @@ EntityTagTest >> testHash [ equals: (EntityTag fromString: 'W/"12345"') hash ] -{ #category : #tests } +{ #category : 'tests' } EntityTagTest >> testPrinting [ self assert: (EntityTag with: '12345') printString equals: '"12345"'. diff --git a/source/Hyperspace-Model-Tests/HTTPClientErrorTest.class.st b/source/Hyperspace-Model-Tests/HTTPClientErrorTest.class.st index b13a045..887aa10 100644 --- a/source/Hyperspace-Model-Tests/HTTPClientErrorTest.class.st +++ b/source/Hyperspace-Model-Tests/HTTPClientErrorTest.class.st @@ -2,12 +2,14 @@ A HTTPClientErrorTest is a test class for testing the behavior of HTTPClientError " Class { - #name : #HTTPClientErrorTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Exceptions' + #name : 'HTTPClientErrorTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Exceptions', + #package : 'Hyperspace-Model-Tests', + #tag : 'Exceptions' } -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testBadRequest [ self @@ -21,7 +23,7 @@ HTTPClientErrorTest >> testBadRequest [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testConflict [ self @@ -35,7 +37,7 @@ HTTPClientErrorTest >> testConflict [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testConvenienceHandler [ self @@ -48,7 +50,7 @@ HTTPClientErrorTest >> testConvenienceHandler [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testConvenienceHandlerUsingAnotherSignal [ self @@ -64,7 +66,7 @@ HTTPClientErrorTest >> testConvenienceHandlerUsingAnotherSignal [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testConvenienceHandlerWithOnExceptDo [ self @@ -81,7 +83,7 @@ HTTPClientErrorTest >> testConvenienceHandlerWithOnExceptDo [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testNotFound [ self @@ -104,7 +106,7 @@ HTTPClientErrorTest >> testNotFound [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testPreconditionFailed [ self @@ -118,7 +120,7 @@ HTTPClientErrorTest >> testPreconditionFailed [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testPreconditionRequired [ self @@ -132,7 +134,7 @@ HTTPClientErrorTest >> testPreconditionRequired [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testSignalingCustomCode [ self @@ -151,7 +153,7 @@ HTTPClientErrorTest >> testSignalingCustomCode [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testTooManyRequests [ self @@ -165,7 +167,7 @@ HTTPClientErrorTest >> testTooManyRequests [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testUnprocessableEntity [ self @@ -179,7 +181,7 @@ HTTPClientErrorTest >> testUnprocessableEntity [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPClientErrorTest >> testUnsupportedMediaType [ self diff --git a/source/Hyperspace-Model-Tests/HTTPErrorTest.class.st b/source/Hyperspace-Model-Tests/HTTPErrorTest.class.st index 6e4a327..abcefb1 100644 --- a/source/Hyperspace-Model-Tests/HTTPErrorTest.class.st +++ b/source/Hyperspace-Model-Tests/HTTPErrorTest.class.st @@ -2,12 +2,14 @@ A HTTPErrorTest is a test class for testing the behavior of HTTPError " Class { - #name : #HTTPErrorTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Exceptions' + #name : 'HTTPErrorTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Exceptions', + #package : 'Hyperspace-Model-Tests', + #tag : 'Exceptions' } -{ #category : #tests } +{ #category : 'tests' } HTTPErrorTest >> testHandlingExceptionSelectorSets [ self @@ -24,13 +26,13 @@ HTTPErrorTest >> testHandlingExceptionSelectorSets [ raise: HTTPServerError serviceUnavailable ] -{ #category : #tests } +{ #category : 'tests' } HTTPErrorTest >> testHandlingHTTPClientError [ self should: [ HTTPClientError notFound signal ] raise: HTTPError ] -{ #category : #tests } +{ #category : 'tests' } HTTPErrorTest >> testHandlingHTTPServerError [ self should: [ HTTPServerError internalServerError signal ] raise: HTTPError diff --git a/source/Hyperspace-Model-Tests/HTTPNotAcceptableTest.class.st b/source/Hyperspace-Model-Tests/HTTPNotAcceptableTest.class.st index 16440dc..c1683ed 100644 --- a/source/Hyperspace-Model-Tests/HTTPNotAcceptableTest.class.st +++ b/source/Hyperspace-Model-Tests/HTTPNotAcceptableTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #HTTPNotAcceptableTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Exceptions' + #name : 'HTTPNotAcceptableTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Exceptions', + #package : 'Hyperspace-Model-Tests', + #tag : 'Exceptions' } -{ #category : #tests } +{ #category : 'tests' } HTTPNotAcceptableTest >> testSignaling [ self diff --git a/source/Hyperspace-Model-Tests/HTTPServerErrorTest.class.st b/source/Hyperspace-Model-Tests/HTTPServerErrorTest.class.st index 7d861c6..512d986 100644 --- a/source/Hyperspace-Model-Tests/HTTPServerErrorTest.class.st +++ b/source/Hyperspace-Model-Tests/HTTPServerErrorTest.class.st @@ -2,12 +2,14 @@ A HTTPServerErrorTest is a test class for testing the behavior of HTTPServerError " Class { - #name : #HTTPServerErrorTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Exceptions' + #name : 'HTTPServerErrorTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Exceptions', + #package : 'Hyperspace-Model-Tests', + #tag : 'Exceptions' } -{ #category : #tests } +{ #category : 'tests' } HTTPServerErrorTest >> testConvenienceHandler [ self @@ -20,7 +22,7 @@ HTTPServerErrorTest >> testConvenienceHandler [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPServerErrorTest >> testConvenienceHandlerUsingAnotherSignal [ self @@ -32,7 +34,7 @@ HTTPServerErrorTest >> testConvenienceHandlerUsingAnotherSignal [ withExceptionDo: [ :signal | self assert: signal code equals: 503 ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPServerErrorTest >> testExceptionExclusion [ self @@ -56,7 +58,7 @@ HTTPServerErrorTest >> testExceptionExclusion [ withExceptionDo: [ :signal | self assert: signal code equals: 503 ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPServerErrorTest >> testInternalServerError [ self @@ -70,7 +72,7 @@ HTTPServerErrorTest >> testInternalServerError [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPServerErrorTest >> testInternalServerErrorDefaultMessageText [ self @@ -84,7 +86,7 @@ HTTPServerErrorTest >> testInternalServerErrorDefaultMessageText [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPServerErrorTest >> testServiceUnavailable [ self @@ -98,7 +100,7 @@ HTTPServerErrorTest >> testServiceUnavailable [ ] ] -{ #category : #tests } +{ #category : 'tests' } HTTPServerErrorTest >> testServiceUnavailableDefaultMessageText [ self diff --git a/source/Hyperspace-Model-Tests/LanguageRangeTest.class.st b/source/Hyperspace-Model-Tests/LanguageRangeTest.class.st index af6c39a..1951ec5 100644 --- a/source/Hyperspace-Model-Tests/LanguageRangeTest.class.st +++ b/source/Hyperspace-Model-Tests/LanguageRangeTest.class.st @@ -2,12 +2,14 @@ A LanguageRangeTest is a test class for testing the behavior of LanguageRange " Class { - #name : #LanguageRangeTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-IETF' + #name : 'LanguageRangeTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-IETF', + #package : 'Hyperspace-Model-Tests', + #tag : 'IETF' } -{ #category : #tests } +{ #category : 'tests' } LanguageRangeTest >> testAny [ self @@ -17,7 +19,7 @@ LanguageRangeTest >> testAny [ assert: LanguageRange any subtags equals: #('*') ] -{ #category : #tests } +{ #category : 'tests' } LanguageRangeTest >> testAnyMatches [ | range | @@ -29,7 +31,7 @@ LanguageRangeTest >> testAnyMatches [ assert: ( range matches: 'es-ar' asLanguageTag ) ] -{ #category : #tests } +{ #category : 'tests' } LanguageRangeTest >> testComparison [ | range | @@ -42,7 +44,7 @@ LanguageRangeTest >> testComparison [ deny: range equals: ( LanguageRange from: #('en') ) ] -{ #category : #tests } +{ #category : 'tests' } LanguageRangeTest >> testCreation [ | range | @@ -53,7 +55,7 @@ LanguageRangeTest >> testCreation [ assert: range printString equals: 'en-Latn-US' ] -{ #category : #tests } +{ #category : 'tests' } LanguageRangeTest >> testMatches [ | range | diff --git a/source/Hyperspace-Model-Tests/LanguageTagTest.class.st b/source/Hyperspace-Model-Tests/LanguageTagTest.class.st index 0d4c863..cd16b54 100644 --- a/source/Hyperspace-Model-Tests/LanguageTagTest.class.st +++ b/source/Hyperspace-Model-Tests/LanguageTagTest.class.st @@ -2,12 +2,14 @@ A LanguageTagTest is a test class for testing the behavior of LanguageTag " Class { - #name : #LanguageTagTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-IETF' + #name : 'LanguageTagTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-IETF', + #package : 'Hyperspace-Model-Tests', + #tag : 'IETF' } -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCantCreateWhenLanguageCodeIsInvalid [ self @@ -19,7 +21,7 @@ LanguageTagTest >> testCantCreateWhenLanguageCodeIsInvalid [ withMessageText: 'ISO 639 language codes must consist only of letters.' ] -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCantCreateWhenRegionIsInvalid [ self @@ -28,7 +30,7 @@ LanguageTagTest >> testCantCreateWhenRegionIsInvalid [ withMessageText: 'Supported ISO 3166-1 codes must be 2 letters.' ] -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCantCreateWhenScriptIsInvalid [ self @@ -37,7 +39,7 @@ LanguageTagTest >> testCantCreateWhenScriptIsInvalid [ withMessageText: 'ISO 15924 script codes must be 4 letters.' ] -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCreation [ | tag | @@ -51,7 +53,7 @@ LanguageTagTest >> testCreation [ self assert: tag subtags equals: #('en' 'Latn' 'US') ] -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCreationWithExtensions [ | tag | @@ -67,7 +69,7 @@ LanguageTagTest >> testCreationWithExtensions [ equals: #('en' 'Latn' 'GB' 'boont' 'r' 'extended' 'sequence' 'x' 'private') ] -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCreationWithHorribleCase [ | tag | @@ -81,7 +83,7 @@ LanguageTagTest >> testCreationWithHorribleCase [ self assert: tag subtags equals: #('es' 'Latn' 'AR') ] -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCreationWithOnlyLanguage [ | tag | @@ -95,7 +97,7 @@ LanguageTagTest >> testCreationWithOnlyLanguage [ self assert: tag subtags equals: #('en') ] -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCreationWithRegionButNotScript [ | tag | @@ -109,7 +111,7 @@ LanguageTagTest >> testCreationWithRegionButNotScript [ self assert: tag subtags equals: #('en' 'US') ] -{ #category : #tests } +{ #category : 'tests' } LanguageTagTest >> testCreationWithScriptButNoRegion [ | tag | diff --git a/source/Hyperspace-Model-Tests/MediaTypeTest.class.st b/source/Hyperspace-Model-Tests/MediaTypeTest.class.st index 89dcbc2..f13fd36 100644 --- a/source/Hyperspace-Model-Tests/MediaTypeTest.class.st +++ b/source/Hyperspace-Model-Tests/MediaTypeTest.class.st @@ -2,12 +2,14 @@ I'm a test for media type extensions " Class { - #name : #MediaTypeTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-IETF' + #name : 'MediaTypeTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-IETF', + #package : 'Hyperspace-Model-Tests', + #tag : 'IETF' } -{ #category : #tests } +{ #category : 'tests' } MediaTypeTest >> testAccepts [ | mediaType | @@ -28,7 +30,7 @@ MediaTypeTest >> testAccepts [ deny: (mediaType accepts: 'application/xml' asMediaType) ] -{ #category : #tests } +{ #category : 'tests' } MediaTypeTest >> testAsMediaType [ | mediaType | @@ -38,7 +40,7 @@ MediaTypeTest >> testAsMediaType [ self assert: mediaType asMediaType identicalTo: mediaType ] -{ #category : #tests } +{ #category : 'tests' } MediaTypeTest >> testQuality [ self @@ -46,7 +48,7 @@ MediaTypeTest >> testQuality [ assert: 'text/html;q=0.8' asMediaType quality equals: 0.8 ] -{ #category : #tests } +{ #category : 'tests' } MediaTypeTest >> testVersion [ | mediaType | diff --git a/source/Hyperspace-Model-Tests/PortAvailabilityCheckerTest.class.st b/source/Hyperspace-Model-Tests/PortAvailabilityCheckerTest.class.st index 806db9b..8a87c60 100644 --- a/source/Hyperspace-Model-Tests/PortAvailabilityCheckerTest.class.st +++ b/source/Hyperspace-Model-Tests/PortAvailabilityCheckerTest.class.st @@ -1,13 +1,15 @@ Class { - #name : #PortAvailabilityCheckerTest, - #superclass : #TestCase, + #name : 'PortAvailabilityCheckerTest', + #superclass : 'TestCase', #instVars : [ 'checker' ], - #category : 'Hyperspace-Model-Tests-Resilience' + #category : 'Hyperspace-Model-Tests-Resilience', + #package : 'Hyperspace-Model-Tests', + #tag : 'Resilience' } -{ #category : #'private - support' } +{ #category : 'private - support' } PortAvailabilityCheckerTest >> openSocketOn: aPortNumber during: aBlock [ | socket | @@ -16,14 +18,14 @@ PortAvailabilityCheckerTest >> openSocketOn: aPortNumber during: aBlock [ aBlock ensure: [ socket destroy ] ] -{ #category : #initialization } +{ #category : 'initialization' } PortAvailabilityCheckerTest >> setUp [ super setUp. checker := PortAvailabilityChecker new ] -{ #category : #'tests - TCP' } +{ #category : 'tests - TCP' } PortAvailabilityCheckerTest >> testIfIsAvailableForTCPIfNot [ | wasEvaluated | @@ -35,7 +37,7 @@ PortAvailabilityCheckerTest >> testIfIsAvailableForTCPIfNot [ self assert: wasEvaluated ] -{ #category : #'tests - TCP' } +{ #category : 'tests - TCP' } PortAvailabilityCheckerTest >> testIfIsAvailableForTCPIfNotWhenNotAvailable [ | port | @@ -49,13 +51,13 @@ PortAvailabilityCheckerTest >> testIfIsAvailableForTCPIfNotWhenNotAvailable [ ] ] -{ #category : #'tests - TCP' } +{ #category : 'tests - TCP' } PortAvailabilityCheckerTest >> testIsAvailableForTCP [ self assert: ( checker isAvailableForTCP: self freeListeningTCPPort ) ] -{ #category : #'tests - TCP' } +{ #category : 'tests - TCP' } PortAvailabilityCheckerTest >> testIsNotAvailableForTCP [ | port | diff --git a/source/Hyperspace-Model-Tests/RetryTest.class.st b/source/Hyperspace-Model-Tests/RetryTest.class.st index 589b1eb..b3eccd3 100644 --- a/source/Hyperspace-Model-Tests/RetryTest.class.st +++ b/source/Hyperspace-Model-Tests/RetryTest.class.st @@ -2,30 +2,32 @@ A RetryTest is a test class for testing the behavior of Retry " Class { - #name : #RetryTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Resilience' + #name : 'RetryTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Resilience', + #package : 'Hyperspace-Model-Tests', + #tag : 'Resilience' } -{ #category : #private } +{ #category : 'private' } RetryTest >> expectedError [ ^ HTTPClientError badRequest ] -{ #category : #private } +{ #category : 'private' } RetryTest >> shouldRaiseExpectedError: aBlock [ self should: aBlock raise: self expectedError withMessageText: 'Too bad' ] -{ #category : #private } +{ #category : 'private' } RetryTest >> signalExpectedError [ ^ self expectedError signal: 'Too bad' ] -{ #category : #'tests - configuring retry count' } +{ #category : 'tests - configuring retry count' } RetryTest >> testCannotUseNegativeRetries [ self should: [ Retry value: [ ] configuredBy: [ :retry | retry upTo: -1 ] ] @@ -33,7 +35,7 @@ RetryTest >> testCannotUseNegativeRetries [ withMessageText: 'The maximum number of retries must be strictly positive.' ] -{ #category : #'tests - configuring retry count' } +{ #category : 'tests - configuring retry count' } RetryTest >> testCannotUseZeroRetries [ self should: [ Retry value: [ ] configuredBy: [ :retry | retry upTo: 0 ] ] @@ -41,7 +43,7 @@ RetryTest >> testCannotUseZeroRetries [ withMessageText: 'The maximum number of retries must be strictly positive.' ] -{ #category : #'tests - configuring retry count' } +{ #category : 'tests - configuring retry count' } RetryTest >> testConfiguringRetryCountWhenRetriesNotNeeded [ | count | @@ -53,7 +55,7 @@ RetryTest >> testConfiguringRetryCountWhenRetriesNotNeeded [ self assert: count equals: 1 ] -{ #category : #'tests - configuring wait time' } +{ #category : 'tests - configuring wait time' } RetryTest >> testEvery [ | count runtime | @@ -80,7 +82,7 @@ RetryTest >> testEvery [ assert: runtime milliSeconds >= 200 milliSeconds ] -{ #category : #'tests - configuring wait time' } +{ #category : 'tests - configuring wait time' } RetryTest >> testExponentialBackoff [ | count runtime | @@ -107,7 +109,7 @@ RetryTest >> testExponentialBackoff [ assert: runtime milliSeconds >= (50 + 150) milliSeconds ] -{ #category : #'tests - configuring wait time' } +{ #category : 'tests - configuring wait time' } RetryTest >> testExponentialBackoffWithDefaultRandomGenerator [ | count | @@ -130,7 +132,7 @@ RetryTest >> testExponentialBackoffWithDefaultRandomGenerator [ self assert: count equals: 3 ] -{ #category : #tests } +{ #category : 'tests' } RetryTest >> testHooksOnRetries [ | count exceptionsDrivingRetries resultsDrivingRetries | @@ -168,7 +170,7 @@ RetryTest >> testHooksOnRetries [ assertCollection: resultsDrivingRetries hasSameElements: #( 1 3 ) ] -{ #category : #'tests - configuring condition' } +{ #category : 'tests - configuring condition' } RetryTest >> testHooksOnRetriesDueToCondition [ | count resultsDrivingRetries | @@ -195,7 +197,7 @@ RetryTest >> testHooksOnRetriesDueToCondition [ assertCollection: resultsDrivingRetries hasSameElements: #( 1 2 3 ) ] -{ #category : #'tests - configuring errors' } +{ #category : 'tests - configuring errors' } RetryTest >> testHooksOnRetriesDueToExpectedErrorRaised [ | count exceptionsDrivingRetries | @@ -230,7 +232,7 @@ RetryTest >> testHooksOnRetriesDueToExpectedErrorRaised [ ] ] -{ #category : #'tests - configuring errors' } +{ #category : 'tests - configuring errors' } RetryTest >> testIgnoreWhenExpectedErrorIsRaised [ | count | @@ -254,7 +256,7 @@ RetryTest >> testIgnoreWhenExpectedErrorIsRaised [ self assert: count equals: 2 ] -{ #category : #'tests - configuring errors' } +{ #category : 'tests - configuring errors' } RetryTest >> testIgnoreWhenUnexpectedErrorIsRaised [ | count | @@ -280,7 +282,7 @@ RetryTest >> testIgnoreWhenUnexpectedErrorIsRaised [ self assert: count equals: 1 ] -{ #category : #tests } +{ #category : 'tests' } RetryTest >> testMaximumNumberOfAttemptsIsSurpassed [ | count | @@ -297,7 +299,7 @@ RetryTest >> testMaximumNumberOfAttemptsIsSurpassed [ self assert: count equals: Retry defaultMaximumNumberOfAttempts ] -{ #category : #tests } +{ #category : 'tests' } RetryTest >> testNoNeedToRetry [ | count | @@ -309,7 +311,7 @@ RetryTest >> testNoNeedToRetry [ self assert: count equals: 1 ] -{ #category : #'tests - configuring errors' } +{ #category : 'tests - configuring errors' } RetryTest >> testOnWhenExpectedErrorIsRaised [ | count | @@ -332,7 +334,7 @@ RetryTest >> testOnWhenExpectedErrorIsRaised [ self assert: count equals: 2 ] -{ #category : #'tests - configuring errors' } +{ #category : 'tests - configuring errors' } RetryTest >> testOnWhenExpectedErrorIsRaisedAndSeveralErrorsHandled [ | count | @@ -372,7 +374,7 @@ RetryTest >> testOnWhenExpectedErrorIsRaisedAndSeveralErrorsHandled [ self assert: count equals: 4 ] -{ #category : #'tests - configuring errors' } +{ #category : 'tests - configuring errors' } RetryTest >> testOnWhenUnexpectedErrorIsRaised [ | count | @@ -397,7 +399,7 @@ RetryTest >> testOnWhenUnexpectedErrorIsRaised [ self assert: count equals: 1 ] -{ #category : #tests } +{ #category : 'tests' } RetryTest >> testRetryOnce [ | count | @@ -412,7 +414,7 @@ RetryTest >> testRetryOnce [ self assert: count equals: 2 ] -{ #category : #tests } +{ #category : 'tests' } RetryTest >> testReturnValue [ | count result | @@ -428,7 +430,7 @@ RetryTest >> testReturnValue [ self assert: result equals: 2 ] -{ #category : #tests } +{ #category : 'tests' } RetryTest >> testReturnValueWhenNotRetrying [ | count result | @@ -443,7 +445,7 @@ RetryTest >> testReturnValueWhenNotRetrying [ self assert: result equals: 1 ] -{ #category : #'tests - configuring retry count' } +{ #category : 'tests - configuring retry count' } RetryTest >> testUpTo [ | count | @@ -466,7 +468,7 @@ RetryTest >> testUpTo [ self assert: count equals: 2 ] -{ #category : #'tests - configuring wait time' } +{ #category : 'tests - configuring wait time' } RetryTest >> testUpToTimesEvery [ | count runtime | @@ -493,7 +495,7 @@ RetryTest >> testUpToTimesEvery [ assert: runtime milliSeconds >= 300 milliSeconds ] -{ #category : #'tests - configuring condition' } +{ #category : 'tests - configuring condition' } RetryTest >> testWhen [ | count | @@ -514,7 +516,7 @@ RetryTest >> testWhen [ self assert: count equals: 4 ] -{ #category : #'tests - configuring condition' } +{ #category : 'tests - configuring condition' } RetryTest >> testWhenConditionNotUsed [ | count | @@ -535,7 +537,7 @@ RetryTest >> testWhenConditionNotUsed [ self assert: count equals: 1 ] -{ #category : #private } +{ #category : 'private' } RetryTest >> unexpectedError [ ^ HTTPServerError diff --git a/source/Hyperspace-Model-Tests/SafeCURIETest.class.st b/source/Hyperspace-Model-Tests/SafeCURIETest.class.st index 4abc37b..6322ff4 100644 --- a/source/Hyperspace-Model-Tests/SafeCURIETest.class.st +++ b/source/Hyperspace-Model-Tests/SafeCURIETest.class.st @@ -2,18 +2,19 @@ A SafeCURIETest is a test class for testing the behavior of SafeCURIE " Class { - #name : #SafeCURIETest, - #superclass : #AbstractCURIETest, - #category : 'Hyperspace-Model-Tests' + #name : 'SafeCURIETest', + #superclass : 'AbstractCURIETest', + #category : 'Hyperspace-Model-Tests', + #package : 'Hyperspace-Model-Tests' } -{ #category : #private } +{ #category : 'private' } SafeCURIETest >> curieClass [ ^ SafeCURIE ] -{ #category : #tests } +{ #category : 'tests' } SafeCURIETest >> testAsSafeCURIE [ | curie | @@ -22,7 +23,7 @@ SafeCURIETest >> testAsSafeCURIE [ self assert: curie asSafeCURIE equals: curie ] -{ #category : #tests } +{ #category : 'tests' } SafeCURIETest >> testFromString [ | curie | @@ -33,7 +34,7 @@ SafeCURIETest >> testFromString [ assertUrl: curie relativeReference equals: 'octocat' asUrl / 'tokens' ] -{ #category : #tests } +{ #category : 'tests' } SafeCURIETest >> testParsingErrors [ self @@ -60,7 +61,7 @@ SafeCURIETest >> testParsingErrors [ withMessageText: 'Cannot create a CURIE from "users"' ] -{ #category : #tests } +{ #category : 'tests' } SafeCURIETest >> testPrinting [ | curie curieWithPath curieWithFragment | diff --git a/source/Hyperspace-Model-Tests/WebLinkTest.class.st b/source/Hyperspace-Model-Tests/WebLinkTest.class.st index 69ecc46..e25e66d 100644 --- a/source/Hyperspace-Model-Tests/WebLinkTest.class.st +++ b/source/Hyperspace-Model-Tests/WebLinkTest.class.st @@ -2,12 +2,14 @@ I'm a test case for WebLink " Class { - #name : #WebLinkTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-IETF' + #name : 'WebLinkTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-IETF', + #package : 'Hyperspace-Model-Tests', + #tag : 'IETF' } -{ #category : #private } +{ #category : 'private' } WebLinkTest >> checkCollectionLinkRelationsOn: link [ self @@ -15,7 +17,7 @@ WebLinkTest >> checkCollectionLinkRelationsOn: link [ assert: link toCollection relationType equals: 'collection' ] -{ #category : #private } +{ #category : 'private' } WebLinkTest >> checkLegalLinkRelationsOn: link [ self @@ -24,7 +26,7 @@ WebLinkTest >> checkLegalLinkRelationsOn: link [ assert: link toCopyright relationType equals: 'copyright' ] -{ #category : #private } +{ #category : 'private' } WebLinkTest >> checkNavigationLinkRelationsOn: link [ self @@ -35,7 +37,7 @@ WebLinkTest >> checkNavigationLinkRelationsOn: link [ assert: link toParent relationType equals: 'up' ] -{ #category : #private } +{ #category : 'private' } WebLinkTest >> checkVersionNavigationLinkRelationsOn: link [ "Version Navigation Link Relations. See RFC 5829" @@ -49,13 +51,13 @@ WebLinkTest >> checkVersionNavigationLinkRelationsOn: link [ assert: link toWorkingCopyOrigin relationType equals: 'working-copy-of' ] -{ #category : #private } +{ #category : 'private' } WebLinkTest >> googleUrl [ ^ 'https://google.com' asUrl ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testAccessing [ | link | @@ -81,7 +83,7 @@ WebLinkTest >> testAccessing [ ';rel=search;title=Google Search;hreflang=en;type=text/html;media=screen' ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testAsByteArray [ self @@ -90,7 +92,7 @@ WebLinkTest >> testAsByteArray [ equals: ';rel=search' asByteArray ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testComparing [ | googleLink other | @@ -107,7 +109,7 @@ WebLinkTest >> testComparing [ self deny: googleLink equals: other ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testComplexMediaTypeHint [ | link mediaType | @@ -123,7 +125,7 @@ WebLinkTest >> testComplexMediaTypeHint [ equals: ';type="application/vnd.stargate.pet+json;version=2.0.0"' ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testCopying [ | googleLink copy | @@ -141,7 +143,7 @@ WebLinkTest >> testCopying [ assert: copy hasParameters ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testExtensionRelationTypes [ "Extension relation types can be URIs or CURIEs. See https://datatracker.ietf.org/doc/html/rfc5988#section-4.2" @@ -170,7 +172,7 @@ WebLinkTest >> testExtensionRelationTypes [ equals: ';rel=[docs:link-relations#create-person]' ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testFromString [ | link parsedLink | @@ -185,7 +187,7 @@ WebLinkTest >> testFromString [ self assert: link equals: parsedLink ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testLanguageHints [ | link | @@ -197,7 +199,7 @@ WebLinkTest >> testLanguageHints [ self assert: link printString equals: ';hreflang=en-US;hreflang=es-AR' ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testMediaQueryHint [ | link | @@ -209,7 +211,7 @@ WebLinkTest >> testMediaQueryHint [ self assert: link printString equals: ';media="screen, print"' ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testMediaTypeHint [ | link | @@ -220,7 +222,7 @@ WebLinkTest >> testMediaTypeHint [ self assert: link printString equals: ';type=application/json' ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testParameters [ | link | @@ -237,7 +239,7 @@ WebLinkTest >> testParameters [ self assert: ( link parameterAt: 'foo' ifAbsent: [ #none ] ) equals: #none ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testParsingComplexLink [ | link | @@ -255,7 +257,7 @@ WebLinkTest >> testParsingComplexLink [ self assert: link printString asWebLink equals: link ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testParsingErrors [ self @@ -286,7 +288,7 @@ WebLinkTest >> testParsingErrors [ withMessageText: 'Invalid parameter format.' ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testPrinting [ self @@ -296,7 +298,7 @@ WebLinkTest >> testPrinting [ equals: ';rel=search' ] -{ #category : #tests } +{ #category : 'tests' } WebLinkTest >> testWellKnownRelationTypes [ | link | diff --git a/source/Hyperspace-Model-Tests/ZnClientHyperspaceExtensionsTest.class.st b/source/Hyperspace-Model-Tests/ZnClientHyperspaceExtensionsTest.class.st index 799767e..a763941 100644 --- a/source/Hyperspace-Model-Tests/ZnClientHyperspaceExtensionsTest.class.st +++ b/source/Hyperspace-Model-Tests/ZnClientHyperspaceExtensionsTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #ZnClientHyperspaceExtensionsTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Zinc' + #name : 'ZnClientHyperspaceExtensionsTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Zinc', + #package : 'Hyperspace-Model-Tests', + #tag : 'Zinc' } -{ #category : #private } +{ #category : 'private' } ZnClientHyperspaceExtensionsTest >> handleRequest: request [ self @@ -13,7 +15,7 @@ ZnClientHyperspaceExtensionsTest >> handleRequest: request [ ^ ZnResponse ok: (ZnEntity text: 'hello') ] -{ #category : #tests } +{ #category : 'tests' } ZnClientHyperspaceExtensionsTest >> testQuery [ | server port | @@ -34,7 +36,7 @@ ZnClientHyperspaceExtensionsTest >> testQuery [ ] ensure: [ server stop ] ] -{ #category : #tests } +{ #category : 'tests' } ZnClientHyperspaceExtensionsTest >> testResetRequest [ | client | @@ -47,7 +49,7 @@ ZnClientHyperspaceExtensionsTest >> testResetRequest [ self assert: client request url isNil ] -{ #category : #tests } +{ #category : 'tests' } ZnClientHyperspaceExtensionsTest >> testSetAccept [ | client | @@ -59,7 +61,7 @@ ZnClientHyperspaceExtensionsTest >> testSetAccept [ self assert: client request accept equals: ZnMimeType applicationPdf asString ] -{ #category : #tests } +{ #category : 'tests' } ZnClientHyperspaceExtensionsTest >> testSetIfMatchTo [ | client | @@ -71,7 +73,7 @@ ZnClientHyperspaceExtensionsTest >> testSetIfMatchTo [ self assert: ( client request headers at: 'If-Match' ) equals: '"12345"' ] -{ #category : #tests } +{ #category : 'tests' } ZnClientHyperspaceExtensionsTest >> testSetIfNoneMatchTo [ | client | @@ -83,7 +85,7 @@ ZnClientHyperspaceExtensionsTest >> testSetIfNoneMatchTo [ self assert: ( client request headers at: 'If-None-Match' ) equals: '"12345"' ] -{ #category : #tests } +{ #category : 'tests' } ZnClientHyperspaceExtensionsTest >> testSetLogLevelAtLeastTo [ | client | diff --git a/source/Hyperspace-Model-Tests/ZnEntityHyperspaceExtensionsTest.class.st b/source/Hyperspace-Model-Tests/ZnEntityHyperspaceExtensionsTest.class.st index 80275df..80dba00 100644 --- a/source/Hyperspace-Model-Tests/ZnEntityHyperspaceExtensionsTest.class.st +++ b/source/Hyperspace-Model-Tests/ZnEntityHyperspaceExtensionsTest.class.st @@ -2,18 +2,20 @@ I'm a test case for Hyperspace's ZnEntity extensions " Class { - #name : #ZnEntityHyperspaceExtensionsTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Zinc' + #name : 'ZnEntityHyperspaceExtensionsTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Zinc', + #package : 'Hyperspace-Model-Tests', + #tag : 'Zinc' } -{ #category : #tests } +{ #category : 'tests' } ZnEntityHyperspaceExtensionsTest >> applicationJson [ ^ 'application/json' asMediaType ] -{ #category : #tests } +{ #category : 'tests' } ZnEntityHyperspaceExtensionsTest >> testJsonExtension [ | entity | @@ -24,7 +26,7 @@ ZnEntityHyperspaceExtensionsTest >> testJsonExtension [ assert: entity contentType equals: self applicationJson ] -{ #category : #tests } +{ #category : 'tests' } ZnEntityHyperspaceExtensionsTest >> testWithOfTypeExtension [ | entity | diff --git a/source/Hyperspace-Model-Tests/ZnEventToLogRecordAdapterTest.class.st b/source/Hyperspace-Model-Tests/ZnEventToLogRecordAdapterTest.class.st index a1a5563..39b9389 100644 --- a/source/Hyperspace-Model-Tests/ZnEventToLogRecordAdapterTest.class.st +++ b/source/Hyperspace-Model-Tests/ZnEventToLogRecordAdapterTest.class.st @@ -1,14 +1,16 @@ Class { - #name : #ZnEventToLogRecordAdapterTest, - #superclass : #TestCase, + #name : 'ZnEventToLogRecordAdapterTest', + #superclass : 'TestCase', #instVars : [ 'loggingAsserter', 'zincEventToLogRecordAdapter' ], - #category : #'Hyperspace-Model-Tests-Zinc' + #category : 'Hyperspace-Model-Tests-Zinc', + #package : 'Hyperspace-Model-Tests', + #tag : 'Zinc' } -{ #category : #private } +{ #category : 'private' } ZnEventToLogRecordAdapterTest >> addTimestampRegexTo: aLogEntryCollection [ ^ aLogEntryCollection collect: [ :regexExpression | @@ -17,7 +19,7 @@ ZnEventToLogRecordAdapterTest >> addTimestampRegexTo: aLogEntryCollection [ ] ] -{ #category : #private } +{ #category : 'private' } ZnEventToLogRecordAdapterTest >> runMemoryLoggerDuring: aBlock assertingLogRecordsMatchRegexes: expectedLogEntries [ | expectedLogEntriesWithTimestamp | @@ -29,7 +31,7 @@ ZnEventToLogRecordAdapterTest >> runMemoryLoggerDuring: aBlock assertingLogRecor assertLogRecordsMatchUsing: expectedLogEntriesWithTimestamp ] -{ #category : #running } +{ #category : 'running' } ZnEventToLogRecordAdapterTest >> setUp [ super setUp. @@ -37,7 +39,7 @@ ZnEventToLogRecordAdapterTest >> setUp [ zincEventToLogRecordAdapter := ZnEventToLogRecordAdapter new ] -{ #category : #running } +{ #category : 'running' } ZnEventToLogRecordAdapterTest >> tearDown [ zincEventToLogRecordAdapter stopListeners. @@ -46,7 +48,7 @@ ZnEventToLogRecordAdapterTest >> tearDown [ super tearDown ] -{ #category : #running } +{ #category : 'running' } ZnEventToLogRecordAdapterTest >> testLogsOfIncomingGetRequest [ zincEventToLogRecordAdapter @@ -74,7 +76,7 @@ ZnEventToLogRecordAdapterTest >> testLogsOfIncomingGetRequest [ '\[DEBUG\] Server closed connection \{"remoteAddress"\:"127.0.0.1","processId"\:(\d+),"eventId"\:(\d+)\}' ) ] -{ #category : #running } +{ #category : 'running' } ZnEventToLogRecordAdapterTest >> testLogsOfIncomingPostRequest [ zincEventToLogRecordAdapter @@ -102,7 +104,7 @@ ZnEventToLogRecordAdapterTest >> testLogsOfIncomingPostRequest [ '\[DEBUG\] Server closed connection \{"remoteAddress"\:"127.0.0.1","processId"\:(\d+),"eventId"\:(\d+)\}' ) ] -{ #category : #running } +{ #category : 'running' } ZnEventToLogRecordAdapterTest >> testLogsOfOutgoingGetRequest [ zincEventToLogRecordAdapter @@ -129,7 +131,7 @@ ZnEventToLogRecordAdapterTest >> testLogsOfOutgoingGetRequest [ '\[DEBUG\] Outgoing HTTP request responded \{"summary"\:"\d{4}-\d{2}-\d{2} \d{2}\:\d{2}\:\d{2} ((\d+) (\d+))? GET / 200 (\d+)B (\d+)ms","durationInMilliseconds"\:(\d+),"request"\:\{"method"\:"GET","uri"\:"http\://localhost\:(\d+)/"\},"processId"\:(\d+),"eventId"\:(\d+),"response"\:\{"code"\:200,"totalSize"\:(\d+)\}\}' ) ] -{ #category : #running } +{ #category : 'running' } ZnEventToLogRecordAdapterTest >> testLogsOfOutgoingPostRequest [ zincEventToLogRecordAdapter @@ -155,7 +157,8 @@ ZnEventToLogRecordAdapterTest >> testLogsOfOutgoingPostRequest [ '\[DEBUG\] Outgoing HTTP request responded \{"summary"\:"\d{4}-\d{2}-\d{2} \d{2}\:\d{2}\:\d{2} ((\d+) (\d+))? POST / 200 (\d+)B (\d+)ms","durationInMilliseconds"\:(\d+),"request"\:\{"method"\:"POST","uri"\:"http\://localhost\:(\d+)/"\},"processId"\:(\d+),"eventId"\:(\d+),"response"\:\{"code"\:200,"totalSize"\:(\d+)\}\}' ) ] -{ #category : #enumerating } +{ #category : 'enumerating' } ZnEventToLogRecordAdapterTest >> withServerDo: block [ + ZnServer withOSAssignedPortDo: block ] diff --git a/source/Hyperspace-Model-Tests/ZnMimeTypeHyperspaceExtensionsTest.class.st b/source/Hyperspace-Model-Tests/ZnMimeTypeHyperspaceExtensionsTest.class.st index 087d93d..2e6f578 100644 --- a/source/Hyperspace-Model-Tests/ZnMimeTypeHyperspaceExtensionsTest.class.st +++ b/source/Hyperspace-Model-Tests/ZnMimeTypeHyperspaceExtensionsTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #ZnMimeTypeHyperspaceExtensionsTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Zinc' + #name : 'ZnMimeTypeHyperspaceExtensionsTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Zinc', + #package : 'Hyperspace-Model-Tests', + #tag : 'Zinc' } -{ #category : #tests } +{ #category : 'tests' } ZnMimeTypeHyperspaceExtensionsTest >> testComparingWithParameters [ | mimeType equalMimeType | diff --git a/source/Hyperspace-Model-Tests/ZnRequestHyperspaceExtensionsTest.class.st b/source/Hyperspace-Model-Tests/ZnRequestHyperspaceExtensionsTest.class.st index 8a18a10..dd202b0 100644 --- a/source/Hyperspace-Model-Tests/ZnRequestHyperspaceExtensionsTest.class.st +++ b/source/Hyperspace-Model-Tests/ZnRequestHyperspaceExtensionsTest.class.st @@ -1,16 +1,18 @@ Class { - #name : #ZnRequestHyperspaceExtensionsTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Zinc' + #name : 'ZnRequestHyperspaceExtensionsTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Zinc', + #package : 'Hyperspace-Model-Tests', + #tag : 'Zinc' } -{ #category : #private } +{ #category : 'private' } ZnRequestHyperspaceExtensionsTest >> googleUrl [ ^ 'https://google.com' asUrl ] -{ #category : #tests } +{ #category : 'tests' } ZnRequestHyperspaceExtensionsTest >> testAcceptLanguage [ | request | @@ -24,7 +26,7 @@ ZnRequestHyperspaceExtensionsTest >> testAcceptLanguage [ self should: [ ( ZnRequest get: self googleUrl ) acceptLanguage ] raise: KeyNotFound ] -{ #category : #tests } +{ #category : 'tests' } ZnRequestHyperspaceExtensionsTest >> testHasLanguageProrityList [ | request | @@ -38,7 +40,7 @@ ZnRequestHyperspaceExtensionsTest >> testHasLanguageProrityList [ deny: ( ZnRequest get: self googleUrl ) hasLanguageProrityList ] -{ #category : #tests } +{ #category : 'tests' } ZnRequestHyperspaceExtensionsTest >> testIfMatch [ | request | @@ -50,7 +52,7 @@ ZnRequestHyperspaceExtensionsTest >> testIfMatch [ self assert: ( request headers at: 'If-Match' ) equals: '"12345"' ] -{ #category : #tests } +{ #category : 'tests' } ZnRequestHyperspaceExtensionsTest >> testIfNoneMatch [ | request | @@ -62,7 +64,7 @@ ZnRequestHyperspaceExtensionsTest >> testIfNoneMatch [ self assert: (request headers at: 'If-None-Match') equals: '"12345"' ] -{ #category : #tests } +{ #category : 'tests' } ZnRequestHyperspaceExtensionsTest >> testQuery [ | request output | @@ -76,7 +78,7 @@ ZnRequestHyperspaceExtensionsTest >> testQuery [ assert: (output includesSubstring: 'Host: google.com') ] -{ #category : #tests } +{ #category : 'tests' } ZnRequestHyperspaceExtensionsTest >> testReadQueryRequest [ | request | @@ -90,7 +92,7 @@ ZnRequestHyperspaceExtensionsTest >> testReadQueryRequest [ assertUrl: request host equals: 'http://google.com' ] -{ #category : #tests } +{ #category : 'tests' } ZnRequestHyperspaceExtensionsTest >> testSetAcceptLanguageWithAny [ | request | @@ -102,7 +104,7 @@ ZnRequestHyperspaceExtensionsTest >> testSetAcceptLanguageWithAny [ self assert: request acceptLanguage equals: '*' ] -{ #category : #tests } +{ #category : 'tests' } ZnRequestHyperspaceExtensionsTest >> testSetAcceptLanguageWithLanguageTag [ | request | diff --git a/source/Hyperspace-Model-Tests/ZnResponseHyperspaceExtensionsTest.class.st b/source/Hyperspace-Model-Tests/ZnResponseHyperspaceExtensionsTest.class.st index 9c5396f..2321f28 100644 --- a/source/Hyperspace-Model-Tests/ZnResponseHyperspaceExtensionsTest.class.st +++ b/source/Hyperspace-Model-Tests/ZnResponseHyperspaceExtensionsTest.class.st @@ -1,29 +1,31 @@ Class { - #name : #ZnResponseHyperspaceExtensionsTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Zinc' + #name : 'ZnResponseHyperspaceExtensionsTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Zinc', + #package : 'Hyperspace-Model-Tests', + #tag : 'Zinc' } -{ #category : #private } +{ #category : 'private' } ZnResponseHyperspaceExtensionsTest >> amazonUrl [ ^ 'https://amazon.com' asUrl ] -{ #category : #private } +{ #category : 'private' } ZnResponseHyperspaceExtensionsTest >> encodeAndDecode: response [ ^ ZnResponse readFrom: ( ByteArray streamContents: [ :stream | response writeOn: stream ] ) readStream ] -{ #category : #private } +{ #category : 'private' } ZnResponseHyperspaceExtensionsTest >> googleUrl [ ^ 'https://google.com' asUrl ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testAddContentLanguageTags [ | response | @@ -40,7 +42,7 @@ ZnResponseHyperspaceExtensionsTest >> testAddContentLanguageTags [ ( LanguageTag fromString: 'es-AR' )} ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testAddSeveralLinks [ | response | @@ -57,7 +59,7 @@ ZnResponseHyperspaceExtensionsTest >> testAddSeveralLinks [ WebLink to: self amazonUrl } ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testCachingDirectives [ | response | @@ -71,7 +73,7 @@ ZnResponseHyperspaceExtensionsTest >> testCachingDirectives [ self assert: response cachingDirectives equals: #('public' 'Max-Age=60') ] -{ #category : #'tests - encoding' } +{ #category : 'tests - encoding' } ZnResponseHyperspaceExtensionsTest >> testEncodeAndDecodeWithContentLanguageHeaders [ | response decodedResponse | @@ -86,7 +88,7 @@ ZnResponseHyperspaceExtensionsTest >> testEncodeAndDecodeWithContentLanguageHead self assert: decodedResponse contentLanguageTags equals: response contentLanguageTags ] -{ #category : #'tests - encoding' } +{ #category : 'tests - encoding' } ZnResponseHyperspaceExtensionsTest >> testEncodeAndDecodeWithEntityTag [ | response entityTag decodedResponse | @@ -102,7 +104,7 @@ ZnResponseHyperspaceExtensionsTest >> testEncodeAndDecodeWithEntityTag [ ifAbsent: [ self fail ] ] -{ #category : #'tests - encoding' } +{ #category : 'tests - encoding' } ZnResponseHyperspaceExtensionsTest >> testEncodeAndDecodeWithLinkHeaders [ | response decodedResponse | @@ -116,7 +118,7 @@ ZnResponseHyperspaceExtensionsTest >> testEncodeAndDecodeWithLinkHeaders [ self assert: decodedResponse links equals: response links ] -{ #category : #'tests - encoding' } +{ #category : 'tests - encoding' } ZnResponseHyperspaceExtensionsTest >> testEncodeAndDecodeWithVaryHeaders [ | response decodedResponse | @@ -131,7 +133,7 @@ ZnResponseHyperspaceExtensionsTest >> testEncodeAndDecodeWithVaryHeaders [ self assert: decodedResponse varyHeaderNames equals: response varyHeaderNames ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testEntityTag [ | response entityTag | @@ -147,7 +149,7 @@ ZnResponseHyperspaceExtensionsTest >> testEntityTag [ self should: [ ZnResponse noContent entityTag ] raise: KeyNotFound ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testHasLocation [ self @@ -155,7 +157,7 @@ ZnResponseHyperspaceExtensionsTest >> testHasLocation [ assert: ( ZnResponse created: 'https://api.example.com/123' ) hasLocation ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testLink [ | response | @@ -167,7 +169,7 @@ ZnResponseHyperspaceExtensionsTest >> testLink [ self assert: response links equals: { WebLink to: self googleUrl } ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testVary [ | response | @@ -186,7 +188,7 @@ ZnResponseHyperspaceExtensionsTest >> testVary [ self assert: response varyHeaderNames equals: #('Accept' 'Accept-Language') ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testWithEntityTagDo [ | response entityTag wasFound | @@ -207,7 +209,7 @@ ZnResponseHyperspaceExtensionsTest >> testWithEntityTagDo [ self assert: wasFound ] -{ #category : #tests } +{ #category : 'tests' } ZnResponseHyperspaceExtensionsTest >> testWithEntityTagDoNotFound [ | response headerWasNotFound | diff --git a/source/Hyperspace-Model-Tests/ZnServerHyperspaceExtensionsTest.class.st b/source/Hyperspace-Model-Tests/ZnServerHyperspaceExtensionsTest.class.st index b992faf..dda0a8e 100644 --- a/source/Hyperspace-Model-Tests/ZnServerHyperspaceExtensionsTest.class.st +++ b/source/Hyperspace-Model-Tests/ZnServerHyperspaceExtensionsTest.class.st @@ -1,10 +1,12 @@ Class { - #name : #ZnServerHyperspaceExtensionsTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Zinc' + #name : 'ZnServerHyperspaceExtensionsTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Zinc', + #package : 'Hyperspace-Model-Tests', + #tag : 'Zinc' } -{ #category : #tests } +{ #category : 'tests' } ZnServerHyperspaceExtensionsTest >> testSetLogLevelAtLeastTo [ | server | diff --git a/source/Hyperspace-Model-Tests/ZnUrlHyperspaceExtensionsTest.class.st b/source/Hyperspace-Model-Tests/ZnUrlHyperspaceExtensionsTest.class.st index 16c9689..d24a50d 100644 --- a/source/Hyperspace-Model-Tests/ZnUrlHyperspaceExtensionsTest.class.st +++ b/source/Hyperspace-Model-Tests/ZnUrlHyperspaceExtensionsTest.class.st @@ -2,12 +2,14 @@ I'm a test for extensions on ZnUrl " Class { - #name : #ZnUrlHyperspaceExtensionsTest, - #superclass : #TestCase, - #category : 'Hyperspace-Model-Tests-Zinc' + #name : 'ZnUrlHyperspaceExtensionsTest', + #superclass : 'TestCase', + #category : 'Hyperspace-Model-Tests-Zinc', + #package : 'Hyperspace-Model-Tests', + #tag : 'Zinc' } -{ #category : #tests } +{ #category : 'tests' } ZnUrlHyperspaceExtensionsTest >> testAsAbsoluteUrl [ self @@ -26,7 +28,7 @@ ZnUrlHyperspaceExtensionsTest >> testAsAbsoluteUrl [ withMessageText: '/resource is a relative URL' ] -{ #category : #tests } +{ #category : 'tests' } ZnUrlHyperspaceExtensionsTest >> testAsHostedAt [ self @@ -44,7 +46,7 @@ ZnUrlHyperspaceExtensionsTest >> testAsHostedAt [ equals: 'https://alternative.org:2222/resource' asUrl ] -{ #category : #tests } +{ #category : 'tests' } ZnUrlHyperspaceExtensionsTest >> testAsWebLink [ | url | @@ -53,7 +55,7 @@ ZnUrlHyperspaceExtensionsTest >> testAsWebLink [ self assert: url asWebLink equals: ( WebLink to: url ) ] -{ #category : #tests } +{ #category : 'tests' } ZnUrlHyperspaceExtensionsTest >> testQueryAtPutUrl [ self @@ -64,7 +66,7 @@ ZnUrlHyperspaceExtensionsTest >> testQueryAtPutUrl [ equals: 'https://api.example.com/pets?relatedTo=https%253A%252F%252Fapi.example.com%252Fpets%252F99' asUrl ] -{ #category : #tests } +{ #category : 'tests' } ZnUrlHyperspaceExtensionsTest >> testStartLimit [ self diff --git a/source/Hyperspace-Model-Tests/package.st b/source/Hyperspace-Model-Tests/package.st index 27f250f..7e4145e 100644 --- a/source/Hyperspace-Model-Tests/package.st +++ b/source/Hyperspace-Model-Tests/package.st @@ -1 +1 @@ -Package { #name : #'Hyperspace-Model-Tests' } +Package { #name : 'Hyperspace-Model-Tests' } diff --git a/source/Hyperspace-Model/ZnEventToLogRecordAdapter.class.st b/source/Hyperspace-Model/ZnEventToLogRecordAdapter.class.st index 0a46fa4..5fe9c53 100644 --- a/source/Hyperspace-Model/ZnEventToLogRecordAdapter.class.st +++ b/source/Hyperspace-Model/ZnEventToLogRecordAdapter.class.st @@ -1,15 +1,16 @@ Class { - #name : #ZnEventToLogRecordAdapter, - #superclass : #Object, + #name : 'ZnEventToLogRecordAdapter', + #superclass : 'Object', #instVars : [ 'logOutgoingRequests', 'logIncomingRequests', 'subscriptions' ], - #category : #'Hyperspace-Model' + #category : 'Hyperspace-Model', + #package : 'Hyperspace-Model' } -{ #category : #'private - dumping' } +{ #category : 'private - dumping' } ZnEventToLogRecordAdapter >> asStructuredRequest: aZnRequest [ | json | @@ -21,7 +22,7 @@ ZnEventToLogRecordAdapter >> asStructuredRequest: aZnRequest [ ^json ] -{ #category : #'private - dumping' } +{ #category : 'private - dumping' } ZnEventToLogRecordAdapter >> asStructuredResponse: aZnResponse [ | json | @@ -33,7 +34,7 @@ ZnEventToLogRecordAdapter >> asStructuredResponse: aZnResponse [ ^json ] -{ #category : #'private - dumping' } +{ #category : 'private - dumping' } ZnEventToLogRecordAdapter >> dumpConnectionEvent: aZnServerConnectionClosedEvent on: data [ data @@ -42,7 +43,7 @@ ZnEventToLogRecordAdapter >> dumpConnectionEvent: aZnServerConnectionClosedEvent at: #eventId put: aZnServerConnectionClosedEvent id ] -{ #category : #'private - dumping' } +{ #category : 'private - dumping' } ZnEventToLogRecordAdapter >> dumpRequestAndResponseOf: event on: json [ | response | @@ -55,7 +56,7 @@ ZnEventToLogRecordAdapter >> dumpRequestAndResponseOf: event on: json [ ^json ] -{ #category : #'private - dumping' } +{ #category : 'private - dumping' } ZnEventToLogRecordAdapter >> dumpRequestOf: event on: json [ json @@ -67,17 +68,17 @@ ZnEventToLogRecordAdapter >> dumpRequestOf: event on: json [ ^json ] -{ #category : #'system startup' } +{ #category : 'system startup' } ZnEventToLogRecordAdapter >> initialize [ super initialize. logOutgoingRequests := false. logIncomingRequests := false. - subscriptions := OrderedCollection new + subscriptions := OrderedCollection new ] -{ #category : #'private - dumping' } +{ #category : 'private - dumping' } ZnEventToLogRecordAdapter >> ipAddressToString: aZnServerConnectionClosedEvent [ ^ aZnServerConnectionClosedEvent address isString @@ -85,19 +86,19 @@ ZnEventToLogRecordAdapter >> ipAddressToString: aZnServerConnectionClosedEvent [ otherwise: [ ZnNetworkingUtils ipAddressToString: aZnServerConnectionClosedEvent address ] ] -{ #category : #'private - configuring' } +{ #category : 'private - configuring' } ZnEventToLogRecordAdapter >> logIncomingRequests: aBoolean [ logIncomingRequests := aBoolean ] -{ #category : #'private - configuring' } +{ #category : 'private - configuring' } ZnEventToLogRecordAdapter >> logOutgoingRequests: aBoolean [ logOutgoingRequests := aBoolean ] -{ #category : #'system startup' } +{ #category : 'system startup' } ZnEventToLogRecordAdapter >> startUpIncomingRequestListeners [ self subscribeToEventsOf: ZnServerConnectionClosedEvent andDo: [ :event | @@ -118,7 +119,7 @@ ZnEventToLogRecordAdapter >> startUpIncomingRequestListeners [ ] ] -{ #category : #'system startup' } +{ #category : 'system startup' } ZnEventToLogRecordAdapter >> startUpListeners [ logOutgoingRequests then: [ self startUpOutgoingRequestListeners ]. @@ -126,7 +127,7 @@ ZnEventToLogRecordAdapter >> startUpListeners [ logIncomingRequests then: [ self startUpIncomingRequestListeners ] ] -{ #category : #'system startup' } +{ #category : 'system startup' } ZnEventToLogRecordAdapter >> startUpOutgoingRequestListeners [ self subscribeToEventsOf: ZnRequestWrittenEvent andDo: [ :event | @@ -139,13 +140,13 @@ ZnEventToLogRecordAdapter >> startUpOutgoingRequestListeners [ ] ] -{ #category : #'system startup' } +{ #category : 'system startup' } ZnEventToLogRecordAdapter >> stopListeners [ subscriptions do: [:subscription | ZnLogEvent announcer removeSubscription: subscription] ] -{ #category : #'system startup' } +{ #category : 'system startup' } ZnEventToLogRecordAdapter >> subscribeToEventsOf: anEventType andDo: aBlock [ subscriptions add: ( ZnLogEvent announcer when: anEventType do: aBlock for: self )