GATransactionTest
Overview
Please comment me using the following template inspired by Class Responsibility Collaborator (CRC) design:
For the Class part: State the name of the class with one line description: For example, I'm xxx the root of the hierarchy of visitor objects.
For the Responsibility part: Three sentences about my main responsibility, what I'm doing, what services do I offer.
For the Collaborators Part: State my main collaborators and one line about how I interact with them.
Public API and Key Messages
- label item
One simple example is simply gorgeous.
Internal Representation and Key Implementation Points.
Implementation Points
Instance Method Details
testCommit
testCommit| result row |
conn beginTransaction
conn execute: 'INSERT INTO student(id) VALUES (1)'.
conn execute: 'INSERT INTO signature(code, name, observations, id_student) VALUES (59, 'TADP', 'Tecnicas Av', 1)'.
result := conn execute: 'SELECT code, name, observations, id_student FROM signature'.
row := result first.
self assert: (row at: 1) equals: 59.
self assert: (row at: 2) equals: 'TADP'.
self assert: (row at: 3) equals: 'Tecnicas Av'.
self assert: (row at: 4) equals: 1.
conn commitTransaction
result := conn execute: 'SELECT code, name, observations, id_student FROM signature'.
row := result first.
self assert: (row at: 1) equals: 59.
self assert: (row at: 2) equals: 'TADP'.
self assert: (row at: 3) equals: 'Tecnicas Av'.
self assert: (row at: 4) equals: 1
testRollback
testRollback| result row |
conn beginTransaction
conn execute: 'INSERT INTO student(id) VALUES (1)'.
conn execute: 'INSERT INTO signature(code, name, observations, id_student) VALUES (59, 'TADP', 'Tecnicas Av', 1)'.
result := conn execute: 'SELECT code, name, observations, id_student FROM signature'.
row := result first.
self assert: (row at: 1) equals: 59.
self assert: (row at: 2) equals: 'TADP'.
self assert: (row at: 3) equals: 'Tecnicas Av'.
self assert: (row at: 4) equals: 1.
conn rollbackTransaction
result := conn execute: 'SELECT code, name, observations, id_student FROM signature'.
self assert: result isEmpty