Skip to content

Commit

Permalink
Cleanup GlorpLoggingTest hierarchy
Browse files Browse the repository at this point in the history
Fix #104
  • Loading branch information
astares committed Jun 26, 2023
1 parent f3dc14a commit 51279f4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
54 changes: 27 additions & 27 deletions src/Glorp-Integration-Tests/GlorpLoggingTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,44 @@ GlorpLoggingTest class >> isAbstract [
^ self name = #GlorpLoggingTest
]

{ #category : #running }
{ #category : #asserting }
GlorpLoggingTest >> assertExpectedInsertStatements [

self subclassResponsibility
self subclassResponsibility
]

{ #category : #running }
{ #category : #asserting }
GlorpLoggingTest >> assertExpectedLoginStatements [

self subclassResponsibility
self subclassResponsibility
]

{ #category : #running }
{ #category : #asserting }
GlorpLoggingTest >> assertExpectedSelectAllStatements [

self subclassResponsibility
]

{ #category : #running }
{ #category : #asserting }
GlorpLoggingTest >> assertExpectedSelectWithLikeStatements [

self subclassResponsibility
]

{ #category : #running }
{ #category : #accessing }
GlorpLoggingTest >> coveredPlatformType [

self subclassResponsibility
self subclassResponsibility
]

{ #category : #'logger - api' }
GlorpLoggingTest >> cr [

" do nothing "
"Do nothing"
]

{ #category : #'logger - api' }
GlorpLoggingTest >> flush [

" do nothing "
"Do nothing"
]

{ #category : #'logger - api' }
Expand All @@ -65,8 +63,7 @@ GlorpLoggingTest >> nextPutAll: aString [
{ #category : #running }
GlorpLoggingTest >> runCase [

(GlorpDatabaseLoginResource defaultLogin database isKindOf:
self coveredPlatformType)
(GlorpDatabaseLoginResource defaultLogin database isKindOf: self coveredPlatformType)
ifTrue: [ super runCase ]
ifFalse: [ self skip ]
]
Expand All @@ -88,40 +85,43 @@ GlorpLoggingTest >> setUp [
GlorpLoggingTest >> tearDown [

session accessor logging: false.
session rollbackTransaction.
session reset.
session
rollbackTransaction;
reset.
session := nil.
super tearDown
]

{ #category : #running }
{ #category : #tests }
GlorpLoggingTest >> testInsert [

session loginIfError: [ self fail ].
session beginTransaction.
session writeRow: session system exampleAddressRowForOrdering1.
session
loginIfError: [ self fail ];
beginTransaction;
writeRow: session system exampleAddressRowForOrdering1.

self assertExpectedInsertStatements
]

{ #category : #running }
{ #category : #tests }
GlorpLoggingTest >> testLogin [

session loginIfError: [ self fail ].

self assertExpectedLoginStatements
]

{ #category : #running }
{ #category : #tests }
GlorpLoggingTest >> testSelectAll [

session loginIfError: [ self fail ].
session read: GlorpBankTransaction.

session
loginIfError: [ self fail ];
read: GlorpBankTransaction.

self assertExpectedSelectAllStatements
]

{ #category : #running }
{ #category : #tests }
GlorpLoggingTest >> testSelectWithLike [

| query |
Expand Down
10 changes: 5 additions & 5 deletions src/Glorp-Integration-Tests/GlorpPostgreSQLLoggingTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#category : #'Glorp-Integration-Tests-Database'
}

{ #category : #running }
{ #category : #asserting }
GlorpPostgreSQLLoggingTest >> assertExpectedInsertStatements [

self assert: loggedStatements size equals: 5.
Expand All @@ -17,15 +17,15 @@ GlorpPostgreSQLLoggingTest >> assertExpectedInsertStatements [
'INSERT INTO GR_ADDRESS (ID,STREET,HOUSE_NUM) VALUES (1,''Alpha'',''300'')'
]

{ #category : #running }
{ #category : #asserting }
GlorpPostgreSQLLoggingTest >> assertExpectedLoginStatements [

self assert: loggedStatements size equals: 2.
self assert: (loggedStatements at: 1) equals: 'Login'.
self assert: (loggedStatements at: 2) equals: 'Login finished'
]

{ #category : #running }
{ #category : #asserting }
GlorpPostgreSQLLoggingTest >> assertExpectedSelectAllStatements [

self assert: loggedStatements size equals: 3.
Expand All @@ -38,7 +38,7 @@ GlorpPostgreSQLLoggingTest >> assertExpectedSelectAllStatements [
FROM BANK_TRANS t1'
]

{ #category : #running }
{ #category : #asserting }
GlorpPostgreSQLLoggingTest >> assertExpectedSelectWithLikeStatements [

self assert: loggedStatements size equals: 3.
Expand All @@ -51,7 +51,7 @@ GlorpPostgreSQLLoggingTest >> assertExpectedSelectWithLikeStatements [
WHERE (t1.STREET LIKE ''Be%'')'
]

{ #category : #running }
{ #category : #accessing }
GlorpPostgreSQLLoggingTest >> coveredPlatformType [

^ PostgreSQLPlatform
Expand Down
12 changes: 6 additions & 6 deletions src/Glorp-Integration-Tests/GlorpSQLiteLoggingTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#category : #'Glorp-Integration-Tests-Database'
}

{ #category : #running }
{ #category : #asserting }
GlorpSQLiteLoggingTest >> assertExpectedInsertStatements [

self assert: loggedStatements size equals: 4.
Expand All @@ -17,15 +17,15 @@ GlorpSQLiteLoggingTest >> assertExpectedInsertStatements [
'INSERT INTO GR_ADDRESS (ID,STREET,HOUSE_NUM) VALUES (?,?,?) #(1 ''Alpha'' ''300'')'
]

{ #category : #running }
{ #category : #asserting }
GlorpSQLiteLoggingTest >> assertExpectedLoginStatements [

self assert: loggedStatements size equals: 2.
self assert: (loggedStatements at: 1) equals: 'Login'.
self assert: (loggedStatements at: 2) equals: 'Login finished'
]

{ #category : #running }
{ #category : #asserting }
GlorpSQLiteLoggingTest >> assertExpectedSelectAllStatements [

self assert: loggedStatements size equals: 3.
Expand All @@ -38,7 +38,7 @@ GlorpSQLiteLoggingTest >> assertExpectedSelectAllStatements [
FROM BANK_TRANS t1 an OrderedCollection()'
]

{ #category : #running }
{ #category : #asserting }
GlorpSQLiteLoggingTest >> assertExpectedSelectWithLikeStatements [

self assert: loggedStatements size equals: 3.
Expand All @@ -51,8 +51,8 @@ GlorpSQLiteLoggingTest >> assertExpectedSelectWithLikeStatements [
WHERE (t1.STREET LIKE ?) an OrderedCollection(''Be%'')'
]

{ #category : #running }
{ #category : #accessing }
GlorpSQLiteLoggingTest >> coveredPlatformType [

^ SQLite3Platform
^ SQLite3Platform
]

0 comments on commit 51279f4

Please sign in to comment.