diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2013-03-09 13:45:54 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2013-03-09 13:45:54 +0000 |
commit | 074af865882547a49b34542d27b3ecabea6a9f33 (patch) | |
tree | c2f2c91188dab92b039f3552444070e735a8c6d1 /test | |
parent | c9a706c2346e9b75f953dfdbf001f1688e07f6d2 (diff) | |
download | jackcess-074af865882547a49b34542d27b3ecabea6a9f33.tar.gz jackcess-074af865882547a49b34542d27b3ecabea6a9f33.zip |
cleanup unnecessary constructors; make many members final
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jackcess-2@676 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'test')
-rw-r--r-- | test/src/java/com/healthmarketscience/jackcess/TableTest.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test/src/java/com/healthmarketscience/jackcess/TableTest.java b/test/src/java/com/healthmarketscience/jackcess/TableTest.java index 146d42d..b217ff2 100644 --- a/test/src/java/com/healthmarketscience/jackcess/TableTest.java +++ b/test/src/java/com/healthmarketscience/jackcess/TableTest.java @@ -46,6 +46,9 @@ public class TableTest extends TestCase { private final PageChannel _pageChannel = new PageChannel(true); private List<Column> _columns = new ArrayList<Column>(); private Table _testTable; + private int _varLenIdx; + private int _fixedOffset; + public TableTest(String name) { super(name); @@ -169,8 +172,20 @@ public class TableTest extends TestCase { return _testTable; } - private Column newTestColumn() { - return new Column(true, null) { + private Column newTestColumn(DataType type) { + + int nextColIdx = _columns.size(); + int nextVarLenIdx = 0; + int nextFixedOff = 0; + + if(type.isVariableLength()) { + nextVarLenIdx = _varLenIdx++; + } else { + nextFixedOff = _fixedOffset; + _fixedOffset += type.getFixedSize(); + } + + return new Column(null, type, nextColIdx, nextFixedOff, nextVarLenIdx) { @Override public Table getTable() { return _testTable; |