Skip to content

Commit

Permalink
Small cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
astares committed Jun 26, 2023
1 parent 3b7103d commit f48f4be
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 91 deletions.
18 changes: 9 additions & 9 deletions src/Glorp-Unit-Tests/GlorpAddress.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpAddress class >> example1 [

^self new
Expand All @@ -18,7 +18,7 @@ GlorpAddress class >> example1 [
number: '2042'.
]

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpAddress class >> example1WithChangedAddress [

^self new
Expand All @@ -27,24 +27,24 @@ GlorpAddress class >> example1WithChangedAddress [
number: '99999'.
]

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpAddress class >> example2 [

^self new
id: 2;
street: 'Nowhere';
number: '1000'.
number: '1000'
]

{ #category : #'as yet unclassified' }
GlorpAddress class >> glorpSetupClassModel: aClassModel forSystem: aDescriptorSystem [
{ #category : #setup }
GlorpAddress class >> glorpSetupClassModel: aClassModel forSystem: aDescriptorSystem [
aClassModel newAttributeNamed: #id.
aClassModel newAttributeNamed: #street.
aClassModel newAttributeNamed: #number.
aClassModel newAttributeNamed: #number
]

{ #category : #'as yet unclassified' }
GlorpAddress class >> glorpSetupDescriptor: aDescriptor forSystem: aDescriptorSystem [
{ #category : #setup }
GlorpAddress class >> glorpSetupDescriptor: aDescriptor forSystem: aDescriptorSystem [
| table |
table := aDescriptorSystem tableNamed: 'GR_ADDRESS'.
aDescriptor table: table.
Expand Down
13 changes: 7 additions & 6 deletions src/Glorp-Unit-Tests/GlorpAirline.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpAirline class >> example1 [
^self new
id: 73;
name: 'Air Canada'.
name: 'Air Canada'
]

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpAirline class >> example2 [
^self new
id: 74;
name: 'Lufthansa'.

^ self new
id: 74;
name: 'Lufthansa'
]

{ #category : #accessing }
Expand Down
10 changes: 6 additions & 4 deletions src/Glorp-Unit-Tests/GlorpAttachment.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
GlorpAttachment class >> glorpSetupClassModel: model forSystem: system [
{ #category : #setup }
GlorpAttachment class >> glorpSetupClassModel: model forSystem: system [

model
newAttributeNamed: #index;
newAttributeNamed: #mimeType;
newAttributeNamed: #attachmentBytes type: GlorpAttachmentBytes
]

{ #category : #'as yet unclassified' }
GlorpAttachment class >> glorpSetupDescriptor: aDesc forSystem: system [
{ #category : #setup }
GlorpAttachment class >> glorpSetupDescriptor: aDesc forSystem: system [

| t |
t := system tableNamed: 'attachment'.
aDesc table: t.
Expand Down
12 changes: 7 additions & 5 deletions src/Glorp-Unit-Tests/GlorpAttachmentBytes.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
GlorpAttachmentBytes class >> glorpSetupClassModel: model forSystem: system [
{ #category : #setup }
GlorpAttachmentBytes class >> glorpSetupClassModel: model forSystem: system [
model newAttributeNamed: #content
]

{ #category : #'as yet unclassified' }
GlorpAttachmentBytes class >> glorpSetupDescriptor: aDesc forSystem: system [
{ #category : #setup }
GlorpAttachmentBytes class >> glorpSetupDescriptor: aDesc forSystem: system [

| t |
t := system tableNamed: 'attachmentbytes'.
aDesc table: t.
(aDesc newMapping: DirectMapping) from: #content
(aDesc newMapping: DirectMapping)
from: #content
to: (t fieldNamed: 'content')
]

Expand Down
2 changes: 1 addition & 1 deletion src/Glorp-Unit-Tests/GlorpBankAccount.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpBankAccount class >> example1 [

^self new
Expand Down
2 changes: 1 addition & 1 deletion src/Glorp-Unit-Tests/GlorpBasicTax.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #accessing }
{ #category : #setup }
GlorpBasicTax class >> glorpSetupDescriptor: aDescriptor forSystem: aSystem [
| table |
table := aSystem tableNamed: 'TAX'.
Expand Down
6 changes: 3 additions & 3 deletions src/Glorp-Unit-Tests/GlorpDemoDescriptorSystem.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #'accessing - defaults' }
GlorpDemoDescriptorSystem class >> default [
Default isNil ifTrue: [Default := self new].
^Default

^ Default ifNil: [ Default := self new ]
]

{ #category : #other }
Expand Down
4 changes: 2 additions & 2 deletions src/Glorp-Unit-Tests/GlorpDocumentDescriptorSystem.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #utilities }
GlorpDocumentDescriptorSystem class >> doTest [
" AADescriptor doTest "

Expand All @@ -34,7 +34,7 @@ GlorpDocumentDescriptorSystem class >> doTest [
glorpSession accessor logout
]

{ #category : #'as yet unclassified' }
{ #category : #utilities }
GlorpDocumentDescriptorSystem class >> readDocumentAndAttachmentsFrom: glorpSession [
| doc |
doc := glorpSession readOneOf: GlorpDocument.
Expand Down
8 changes: 6 additions & 2 deletions src/Glorp-Unit-Tests/GlorpMediaType.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #accessing }
GlorpMediaType class >> text [
^self new name: 'text'; mimeType: 'text/plain'

^ self new
name: 'text';
mimeType: 'text/plain';
yourself
]

{ #category : #accessing }
Expand Down
6 changes: 3 additions & 3 deletions src/Glorp-Unit-Tests/GlorpReservation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpReservation class >> example1 [

^self new
id: 2;
passenger: GlorpPassenger example1.
]

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpReservation class >> example2 [

^self new
id: 7;
passenger: GlorpPassenger example2.
passenger: GlorpPassenger example2
]

{ #category : #accessing }
Expand Down
2 changes: 1 addition & 1 deletion src/Glorp-Unit-Tests/GlorpSQLPrintingTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ GlorpSQLPrintingTest >> testGroupWriting [
self assertGroupWritingOnPlatform: platform.
platform := SQLServerPlatform new.
platform useBinding: true.
self assertGroupWritingOnPlatform: platform.
self assertGroupWritingOnPlatform: platform
]
8 changes: 4 additions & 4 deletions src/Glorp-Unit-Tests/GlorpServiceCharge.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #accessing }
GlorpServiceCharge class >> default [

^self new
amount: (GlorpMoney forAmount: 3);
description: 'additional overcharge'.
^ self new
amount: (GlorpMoney forAmount: 3);
description: 'additional overcharge'
]

{ #category : #accessing }
Expand Down
4 changes: 2 additions & 2 deletions src/Glorp-Unit-Tests/GlorpSurcharge.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #accessing }
GlorpSurcharge class >> glorpSetupDescriptor: aDescriptor forSystem: aSystem [
| table |
table := aSystem tableNamed: 'TAX'.
self glorpCommonSetupDescriptor: aDescriptor forSystem: aSystem.
(aSystem typeResolverFor: GlorpTax)
register: aDescriptor
keyedBy: 'S'
field: (table fieldNamed: 'TYPE').
field: (table fieldNamed: 'TYPE')
]
2 changes: 1 addition & 1 deletion src/Glorp-Unit-Tests/GlorpTestCase.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #testing }
GlorpTestCase class >> isAbstract [
^self sunitName = #GlorpTestCase
]
Expand Down
4 changes: 2 additions & 2 deletions src/Glorp-Unit-Tests/GlorpWorkerTask.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpWorkerTask class >> exampleTaskKeys [
| keys |
keys := OrderedCollection new.
Expand All @@ -20,7 +20,7 @@ GlorpWorkerTask class >> exampleTaskKeys [
^keys
]

{ #category : #'as yet unclassified' }
{ #category : #examples }
GlorpWorkerTask class >> exampleTasks [
| tasks |
tasks := OrderedCollection new.
Expand Down
48 changes: 3 additions & 45 deletions src/Glorp-Unit-Tests/TESTDescriptorSystem.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#category : #'Glorp-Unit-Tests-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #'accessing - queries' }
TESTDescriptorSystem class >> queryForCustomerStation [
| query |
query := Query read: CustomerStation
Expand All @@ -13,64 +13,22 @@ TESTDescriptorSystem class >> queryForCustomerStation [
^query
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - queries' }
TESTDescriptorSystem class >> queryForFeederStation [
| query |
query := Query read: FeederStation where: [:feederStation | feederStation id in: #(1 2 3 4)].
query retrieve: [:feederStation | feederStation id].
^query
]

{ #category : #'as yet unclassified' }
{ #category : #'accessing - queries' }
TESTDescriptorSystem class >> queryForSuccessor [
| query |
query := Query read: Successor where: [:successor | successor successorFeeder in: self queryForFeederStation].
query retrieve: [:successor | successor id].
^query
]

{ #category : #'as yet unclassified' }
TESTDescriptorSystem class >> testInnerQueries [
"self testInnerQueries"

| session system query result |
session := GlorpSession new.
system := self new.
system platform: OraclePlatform new.
session system: system.
system session: session.
query := self queryForCustomerStation.
result := session execute: query.
^result
]

{ #category : #'as yet unclassified' }
TESTDescriptorSystem class >> testLocalInnerQueries [
"self testLocalInnerQueries"

| session system query result |
session := GlorpSession new.
system := self new.
system platform: OraclePlatform new.
session system: system.
system session: session.
query := Query read: CustomerStation where:
[:customerStation |
customerStation successor anySatisfy:
[:successor || query2 |
query2 := Query read: Successor where:
[:successor1 || feederQuery |
feederQuery := Query read: FeederStation where:
[:feederStation | feederStation id in: #(1 2 3 4)].
feederQuery retrieve: [:feederStation | feederStation id].
successor1 successorFeeder in: feederQuery].
query2 retrieve: [:successor1 | successor1 id].
successor in: query2]].
query retrieve: [:customerStation | customerStation id].
result := session execute: query.
^result
]

{ #category : #classes }
TESTDescriptorSystem >> classModelForCustomerStation: aClassModel [

Expand Down

0 comments on commit f48f4be

Please sign in to comment.