diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2007-11-19 03:26:40 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2007-11-19 03:26:40 +0000 |
commit | 588da3ba5eb273dc5920173b4a87049223639eb6 (patch) | |
tree | 7dd4ec9d083b0f1cc1b1601d3c0bf9db06f648c4 /test | |
parent | 1fcd851a9f5d780b3d78b92f89bd35a2d634b467 (diff) | |
download | jackcess-588da3ba5eb273dc5920173b4a87049223639eb6.tar.gz jackcess-588da3ba5eb273dc5920173b4a87049223639eb6.zip |
change references between major data types; share common utility classes from common database
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@175 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'test')
-rw-r--r-- | test/src/java/com/healthmarketscience/jackcess/TableTest.java | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/test/src/java/com/healthmarketscience/jackcess/TableTest.java b/test/src/java/com/healthmarketscience/jackcess/TableTest.java index 041600a..5b22db0 100644 --- a/test/src/java/com/healthmarketscience/jackcess/TableTest.java +++ b/test/src/java/com/healthmarketscience/jackcess/TableTest.java @@ -18,19 +18,24 @@ public class TableTest extends TestCase { } public void testCreateRow() throws Exception { - JetFormat format = JetFormat.VERSION_4; - Table table = new Table(true); + final JetFormat format = JetFormat.VERSION_4; + final PageChannel pageChannel = new PageChannel(true); List<Column> columns = new ArrayList<Column>(); - Column col = new Column(true); + Column col = newTestColumn(pageChannel); col.setType(DataType.INT); columns.add(col); - col = new Column(true); + col = newTestColumn(pageChannel); col.setType(DataType.TEXT); columns.add(col); - col = new Column(true); + col = newTestColumn(pageChannel); col.setType(DataType.TEXT); columns.add(col); - table.setColumns(columns); + Table table = new Table(true, columns) { + @Override + public PageChannel getPageChannel() { + return pageChannel; + } + }; int colCount = 3; Object[] row = new Object[colCount]; row[0] = new Short((short) 9); @@ -46,5 +51,18 @@ public class TableTest extends TestCase { assertEquals((short) 2, buffer.getShort(28)); assertEquals((byte) 7, buffer.get(30)); } + + private static Column newTestColumn(final PageChannel pageChannel) { + return new Column(true) { + @Override + public PageChannel getPageChannel() { + return pageChannel; + } + @Override + public JetFormat getFormat() { + return JetFormat.VERSION_4; + } + }; + } } |