You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2012/04/24 20:20:33 UTC

[3/3] git commit: add JdbcDecimalTest patch by dbrosius; reviewed by jbellis for CASSANDRA-3837

add JdbcDecimalTest
patch by dbrosius; reviewed by jbellis for CASSANDRA-3837


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/808d7c9f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/808d7c9f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/808d7c9f

Branch: refs/heads/cassandra-1.1
Commit: 808d7c9f32a9b3c623506a4d26febf70c1770f0d
Parents: 150b316
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Apr 24 13:20:02 2012 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Apr 24 13:20:02 2012 -0500

----------------------------------------------------------------------
 .../apache/cassandra/cql/jdbc/JdbcDecimalTest.java |   21 +++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/808d7c9f/test/unit/org/apache/cassandra/cql/jdbc/JdbcDecimalTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql/jdbc/JdbcDecimalTest.java b/test/unit/org/apache/cassandra/cql/jdbc/JdbcDecimalTest.java
new file mode 100644
index 0000000..3457798
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql/jdbc/JdbcDecimalTest.java
@@ -0,0 +1,21 @@
+package org.apache.cassandra.cql.jdbc;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class JdbcDecimalTest
+{
+    @Test
+    public void testComposeDecompose()
+    {
+        BigDecimal expected = new BigDecimal("123456789123456789.987654321");
+        JdbcDecimal decimal = new JdbcDecimal();
+        
+        ByteBuffer buffer = decimal.decompose(expected);     
+        BigDecimal actual = decimal.compose(buffer);
+        Assert.assertEquals(expected, actual);
+    }
+}