arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [2/9] arrow git commit: ARROW-631: [GLib] Import
Date Fri, 17 Mar 2017 01:09:49 GMT
http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/doc/Makefile.am
----------------------------------------------------------------------
diff --git a/c_glib/doc/Makefile.am b/c_glib/doc/Makefile.am
new file mode 100644
index 0000000..85c1d51
--- /dev/null
+++ b/c_glib/doc/Makefile.am
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+SUBDIRS =                                       \
+        reference

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/doc/reference/Makefile.am
----------------------------------------------------------------------
diff --git a/c_glib/doc/reference/Makefile.am b/c_glib/doc/reference/Makefile.am
new file mode 100644
index 0000000..d1c8e01
--- /dev/null
+++ b/c_glib/doc/reference/Makefile.am
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+DOC_MODULE = arrow-glib
+
+DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml
+
+DOC_SOURCE_DIR =				\
+	$(top_srcdir)/arrow-glib
+
+SCAN_OPTIONS =						\
+	--deprecated-guards="GARROW_DISABLE_DEPRECATED"
+
+MKDB_OPTIONS =					\
+	--name-space=arrow			\
+	--source-suffixes="c,cpp,h"
+
+HFILE_GLOB =					\
+	$(top_srcdir)/arrow-glib/*.h
+
+IGNORE_HFILES =					\
+	enums.h					\
+	io-enums.h				\
+	ipc-enums.h
+
+CFILE_GLOB =					\
+	$(top_srcdir)/arrow-glib/*.cpp
+
+AM_CPPFLAGS =					\
+	-I$(top_builddir)			\
+	-I$(top_srcdir)
+
+AM_CFLAGS =					\
+	$(GLIB_CFLAGS)				\
+	$(ARROW_CFLAGS)
+
+GTKDOC_LIBS =						\
+	$(top_builddir)/arrow-glib/libarrow-glib.la	\
+	$(top_builddir)/arrow-glib/libarrow-io-glib.la	\
+	$(top_builddir)/arrow-glib/libarrow-ipc-glib.la
+
+include $(srcdir)/gtk-doc.make
+
+CLEANFILES +=					\
+	$(DOC_MODULE)-decl-list.txt		\
+	$(DOC_MODULE)-decl.txt			\
+	$(DOC_MODULE)-overrides.txt		\
+	$(DOC_MODULE)-sections.txt		\
+	$(DOC_MODULE).types

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/doc/reference/arrow-glib-docs.sgml
----------------------------------------------------------------------
diff --git a/c_glib/doc/reference/arrow-glib-docs.sgml b/c_glib/doc/reference/arrow-glib-docs.sgml
new file mode 100644
index 0000000..9f504be
--- /dev/null
+++ b/c_glib/doc/reference/arrow-glib-docs.sgml
@@ -0,0 +1,171 @@
+<?xml version="1.0"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
+  <!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
+  %gtkdocentities;
+]>
+<book id="index">
+  <bookinfo>
+    <title>&package_name; Reference Manual</title>
+    <releaseinfo>
+      for &package_string;.
+      <!--
+      The latest version of this documentation can be found on-line at
+      <ulink role="online-location" url="http://[SERVER]/&package_name;/">http://[SERVER]/&package_name;/</ulink>.
+      -->
+    </releaseinfo>
+  </bookinfo>
+
+  <part id="arrow">
+    <title>GArrow</title>
+    <chapter id="array">
+      <title>Array</title>
+      <xi:include href="xml/array.xml"/>
+      <xi:include href="xml/null-array.xml"/>
+      <xi:include href="xml/boolean-array.xml"/>
+      <xi:include href="xml/int8-array.xml"/>
+      <xi:include href="xml/uint8-array.xml"/>
+      <xi:include href="xml/int16-array.xml"/>
+      <xi:include href="xml/uint16-array.xml"/>
+      <xi:include href="xml/int32-array.xml"/>
+      <xi:include href="xml/uint32-array.xml"/>
+      <xi:include href="xml/int64-array.xml"/>
+      <xi:include href="xml/uint64-array.xml"/>
+      <xi:include href="xml/float-array.xml"/>
+      <xi:include href="xml/double-array.xml"/>
+      <xi:include href="xml/binary-array.xml"/>
+      <xi:include href="xml/string-array.xml"/>
+      <xi:include href="xml/list-array.xml"/>
+      <xi:include href="xml/struct-array.xml"/>
+    </chapter>
+    <chapter id="array-builder">
+      <title>Array builder</title>
+      <xi:include href="xml/array-builder.xml"/>
+      <xi:include href="xml/boolean-array-builder.xml"/>
+      <xi:include href="xml/int8-array-builder.xml"/>
+      <xi:include href="xml/uint8-array-builder.xml"/>
+      <xi:include href="xml/int16-array-builder.xml"/>
+      <xi:include href="xml/uint16-array-builder.xml"/>
+      <xi:include href="xml/int32-array-builder.xml"/>
+      <xi:include href="xml/uint32-array-builder.xml"/>
+      <xi:include href="xml/int64-array-builder.xml"/>
+      <xi:include href="xml/uint64-array-builder.xml"/>
+      <xi:include href="xml/float-array-builder.xml"/>
+      <xi:include href="xml/double-array-builder.xml"/>
+      <xi:include href="xml/binary-array-builder.xml"/>
+      <xi:include href="xml/string-array-builder.xml"/>
+      <xi:include href="xml/list-array-builder.xml"/>
+      <xi:include href="xml/struct-array-builder.xml"/>
+    </chapter>
+    <chapter id="type">
+      <title>Type</title>
+      <xi:include href="xml/type.xml"/>
+      <xi:include href="xml/data-type.xml"/>
+      <xi:include href="xml/null-data-type.xml"/>
+      <xi:include href="xml/boolean-data-type.xml"/>
+      <xi:include href="xml/int8-data-type.xml"/>
+      <xi:include href="xml/uint8-data-type.xml"/>
+      <xi:include href="xml/int16-data-type.xml"/>
+      <xi:include href="xml/uint16-data-type.xml"/>
+      <xi:include href="xml/int32-data-type.xml"/>
+      <xi:include href="xml/uint32-data-type.xml"/>
+      <xi:include href="xml/int64-data-type.xml"/>
+      <xi:include href="xml/uint64-data-type.xml"/>
+      <xi:include href="xml/float-data-type.xml"/>
+      <xi:include href="xml/double-data-type.xml"/>
+      <xi:include href="xml/binary-data-type.xml"/>
+      <xi:include href="xml/string-data-type.xml"/>
+      <xi:include href="xml/list-data-type.xml"/>
+      <xi:include href="xml/struct-data-type.xml"/>
+    </chapter>
+    <chapter id="schema">
+      <title>Schema</title>
+      <xi:include href="xml/field.xml"/>
+      <xi:include href="xml/schema.xml"/>
+    </chapter>
+    <chapter id="table">
+      <title>Table</title>
+      <xi:include href="xml/table.xml"/>
+      <xi:include href="xml/record-batch.xml"/>
+      <xi:include href="xml/column.xml"/>
+      <xi:include href="xml/chunked-array.xml"/>
+    </chapter>
+    <chapter id="error">
+      <title>Error</title>
+      <xi:include href="xml/error.xml"/>
+    </chapter>
+  </part>
+
+  <part id="arrow-io">
+    <title>GArrowIO</title>
+    <chapter id="io-mode">
+      <title>Enums</title>
+      <xi:include href="xml/io-file-mode.xml"/>
+    </chapter>
+    <chapter id="io-input">
+      <title>Input</title>
+      <xi:include href="xml/io-readable.xml"/>
+      <xi:include href="xml/io-input-stream.xml"/>
+      <xi:include href="xml/io-readable-file.xml"/>
+    </chapter>
+    <chapter id="io-output">
+      <title>Output</title>
+      <xi:include href="xml/io-writeable.xml"/>
+      <xi:include href="xml/io-output-stream.xml"/>
+      <xi:include href="xml/io-writeable-file.xml"/>
+      <xi:include href="xml/io-file-output-stream.xml"/>
+    </chapter>
+    <chapter id="io-input-output">
+      <title>Input and output</title>
+      <xi:include href="xml/io-file.xml"/>
+      <xi:include href="xml/io-memory-mapped-file.xml"/>
+    </chapter>
+  </part>
+
+  <part id="arrow-ipc">
+    <title>GArrowIPC</title>
+    <chapter id="ipc-metadata">
+      <title>Enums</title>
+      <xi:include href="xml/ipc-metadata-version.xml"/>
+    </chapter>
+    <chapter id="ipc-reader">
+      <title>Reader</title>
+      <xi:include href="xml/ipc-file-reader.xml"/>
+      <xi:include href="xml/ipc-stream-reader.xml"/>
+    </chapter>
+    <chapter id="ipc-writer">
+      <title>Input</title>
+      <xi:include href="xml/ipc-file-writer.xml"/>
+      <xi:include href="xml/ipc-stream-writer.xml"/>
+    </chapter>
+  </part>
+
+  <chapter id="object-tree">
+    <title>Object Hierarchy</title>
+    <xi:include href="xml/tree_index.sgml"/>
+  </chapter>
+  <index id="api-index-full">
+    <title>API Index</title>
+    <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
+  </index>
+  <index id="deprecated-api-index" role="deprecated">
+    <title>Index of deprecated API</title>
+    <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
+  </index>
+  <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
+</book>

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/example/Makefile.am
----------------------------------------------------------------------
diff --git a/c_glib/example/Makefile.am b/c_glib/example/Makefile.am
new file mode 100644
index 0000000..3d456d7
--- /dev/null
+++ b/c_glib/example/Makefile.am
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+AM_CPPFLAGS =					\
+	-I$(top_builddir)			\
+	-I$(top_srcdir)
+
+AM_CFLAGS =					\
+	$(GLIB_CFLAGS)				\
+	$(GARROW_CFLAGS)
+
+AM_LDFLAGS =						\
+	$(GLIB_LIBS)					\
+	$(builddir)/../arrow-glib/libarrow-glib.la
+
+noinst_PROGRAMS =				\
+	build
+
+build_SOURCES =					\
+	build.c

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/example/build.c
----------------------------------------------------------------------
diff --git a/c_glib/example/build.c b/c_glib/example/build.c
new file mode 100644
index 0000000..2722458
--- /dev/null
+++ b/c_glib/example/build.c
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <stdlib.h>
+
+#include <arrow-glib/arrow-glib.h>
+
+int
+main(int argc, char **argv)
+{
+  GArrowArray *array;
+
+  {
+    GArrowInt32ArrayBuilder *builder;
+    gboolean success = TRUE;
+    GError *error = NULL;
+
+    builder = garrow_int32_array_builder_new();
+    if (success) {
+      success = garrow_int32_array_builder_append(builder, 29, &error);
+    }
+    if (success) {
+      success = garrow_int32_array_builder_append(builder, 2929, &error);
+    }
+    if (success) {
+      success = garrow_int32_array_builder_append(builder, 292929, &error);
+    }
+    if (!success) {
+      g_print("failed to append: %s\n", error->message);
+      g_error_free(error);
+      g_object_unref(builder);
+      return EXIT_FAILURE;
+    }
+    array = garrow_array_builder_finish(GARROW_ARRAY_BUILDER(builder));
+    g_object_unref(builder);
+  }
+
+  {
+    gint64 i, n;
+
+    n = garrow_array_get_length(array);
+    g_print("length: %" G_GINT64_FORMAT "\n", n);
+    for (i = 0; i < n; i++) {
+      gint32 value;
+
+      value = garrow_int32_array_get_value(GARROW_INT32_ARRAY(array), i);
+      g_print("array[%" G_GINT64_FORMAT "] = %d\n",
+              i, value);
+    }
+  }
+
+  g_object_unref(array);
+
+  return EXIT_SUCCESS;
+}

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/helper/buildable.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/helper/buildable.rb b/c_glib/test/helper/buildable.rb
new file mode 100644
index 0000000..900e180
--- /dev/null
+++ b/c_glib/test/helper/buildable.rb
@@ -0,0 +1,77 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+module Helper
+  module Buildable
+    def build_boolean_array(values)
+      build_array(Arrow::BooleanArrayBuilder, values)
+    end
+
+    def build_int8_array(values)
+      build_array(Arrow::Int8ArrayBuilder, values)
+    end
+
+    def build_uint8_array(values)
+      build_array(Arrow::UInt8ArrayBuilder, values)
+    end
+
+    def build_int16_array(values)
+      build_array(Arrow::Int16ArrayBuilder, values)
+    end
+
+    def build_uint16_array(values)
+      build_array(Arrow::UInt16ArrayBuilder, values)
+    end
+
+    def build_int32_array(values)
+      build_array(Arrow::Int32ArrayBuilder, values)
+    end
+
+    def build_uint32_array(values)
+      build_array(Arrow::UInt32ArrayBuilder, values)
+    end
+
+    def build_int64_array(values)
+      build_array(Arrow::Int64ArrayBuilder, values)
+    end
+
+    def build_uint64_array(values)
+      build_array(Arrow::UInt64ArrayBuilder, values)
+    end
+
+    def build_float_array(values)
+      build_array(Arrow::FloatArrayBuilder, values)
+    end
+
+    def build_double_array(values)
+      build_array(Arrow::DoubleArrayBuilder, values)
+    end
+
+    private
+    def build_array(builder_class, values)
+      builder = builder_class.new
+      values.each do |value|
+        if value.nil?
+          builder.append_null
+        else
+          builder.append(value)
+        end
+      end
+      builder.finish
+    end
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/run-test.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/run-test.rb b/c_glib/test/run-test.rb
new file mode 100755
index 0000000..32ceb4a
--- /dev/null
+++ b/c_glib/test/run-test.rb
@@ -0,0 +1,41 @@
+#!/usr/bin/env ruby
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+require "pathname"
+require "test-unit"
+
+base_dir = Pathname(__dir__).parent
+typelib_dir = base_dir + "arrow-glib"
+test_dir = base_dir + "test"
+
+ENV["GI_TYPELIB_PATH"] = [
+  typelib_dir.to_s,
+  ENV["GI_TYPELIB_PATH"],
+].compact.join(File::PATH_SEPARATOR)
+
+require "gi"
+
+Arrow = GI.load("Arrow")
+ArrowIO = GI.load("ArrowIO")
+ArrowIPC = GI.load("ArrowIPC")
+
+require "tempfile"
+require_relative "helper/buildable"
+
+exit(Test::Unit::AutoRunner.run(true, test_dir.to_s))

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/run-test.sh
----------------------------------------------------------------------
diff --git a/c_glib/test/run-test.sh b/c_glib/test/run-test.sh
new file mode 100755
index 0000000..9b0ec8e
--- /dev/null
+++ b/c_glib/test/run-test.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+base_dir="$(cd .; pwd)"
+lib_dir="${base_dir}/arrow-glib/.libs"
+
+LD_LIBRARY_PATH="${lib_dir}:${LD_LIBRARY_PATH}"
+
+if [ "${NO_MAKE}" != "yes" ]; then
+  make -j8 > /dev/null || exit $?
+fi
+
+${GDB} ruby ${base_dir}/test/run-test.rb "$@"

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-array.rb b/c_glib/test/test-array.rb
new file mode 100644
index 0000000..d68827c
--- /dev/null
+++ b/c_glib/test/test-array.rb
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestArray < Test::Unit::TestCase
+  def test_length
+    builder = Arrow::BooleanArrayBuilder.new
+    builder.append(true)
+    array = builder.finish
+    assert_equal(1, array.length)
+  end
+
+  def test_n_nulls
+    builder = Arrow::BooleanArrayBuilder.new
+    builder.append_null
+    builder.append_null
+    array = builder.finish
+    assert_equal(2, array.n_nulls)
+  end
+
+  def test_slice
+    builder = Arrow::BooleanArrayBuilder.new
+    builder.append(true)
+    builder.append(false)
+    builder.append(true)
+    array = builder.finish
+    sub_array = array.slice(1, 2)
+    assert_equal([false, true],
+                 sub_array.length.times.collect {|i| sub_array.get_value(i)})
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-binary-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-binary-array.rb b/c_glib/test/test-binary-array.rb
new file mode 100644
index 0000000..82a537e
--- /dev/null
+++ b/c_glib/test/test-binary-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestBinaryArray < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::BinaryArrayBuilder.new
+    builder.append("\x00\x01\x02")
+    array = builder.finish
+    assert_equal([0, 1, 2], array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-binary-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-binary-data-type.rb b/c_glib/test/test-binary-data-type.rb
new file mode 100644
index 0000000..3d4095c
--- /dev/null
+++ b/c_glib/test/test-binary-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestBinaryDataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::BinaryDataType.new
+    assert_equal(Arrow::Type::BINARY, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::BinaryDataType.new
+    assert_equal("binary", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-boolean-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-boolean-array.rb b/c_glib/test/test-boolean-array.rb
new file mode 100644
index 0000000..9cc3c94
--- /dev/null
+++ b/c_glib/test/test-boolean-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestBooleanArray < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::BooleanArrayBuilder.new
+    builder.append(true)
+    array = builder.finish
+    assert_equal(true, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-boolean-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-boolean-data-type.rb b/c_glib/test/test-boolean-data-type.rb
new file mode 100644
index 0000000..ac56671
--- /dev/null
+++ b/c_glib/test/test-boolean-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestBooleanDataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::BooleanDataType.new
+    assert_equal(Arrow::Type::BOOL, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::BooleanDataType.new
+    assert_equal("bool", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-chunked-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-chunked-array.rb b/c_glib/test/test-chunked-array.rb
new file mode 100644
index 0000000..167d5d1
--- /dev/null
+++ b/c_glib/test/test-chunked-array.rb
@@ -0,0 +1,67 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestChunkedArray < Test::Unit::TestCase
+  include Helper::Buildable
+
+  def test_length
+    chunks = [
+      build_boolean_array([true, false]),
+      build_boolean_array([true]),
+    ]
+    chunked_array = Arrow::ChunkedArray.new(chunks)
+    assert_equal(3, chunked_array.length)
+  end
+
+  def test_n_nulls
+    chunks = [
+      build_boolean_array([true, nil, false]),
+      build_boolean_array([nil, nil, true]),
+    ]
+    chunked_array = Arrow::ChunkedArray.new(chunks)
+    assert_equal(3, chunked_array.n_nulls)
+  end
+
+
+  def test_n_chunks
+    chunks = [
+      build_boolean_array([true]),
+      build_boolean_array([false]),
+    ]
+    chunked_array = Arrow::ChunkedArray.new(chunks)
+    assert_equal(2, chunked_array.n_chunks)
+  end
+
+  def test_chunk
+    chunks = [
+      build_boolean_array([true, false]),
+      build_boolean_array([false]),
+    ]
+    chunked_array = Arrow::ChunkedArray.new(chunks)
+    assert_equal(2, chunked_array.get_chunk(0).length)
+  end
+
+  def test_chunks
+    chunks = [
+      build_boolean_array([true, false]),
+      build_boolean_array([false]),
+    ]
+    chunked_array = Arrow::ChunkedArray.new(chunks)
+    assert_equal([2, 1],
+                 chunked_array.chunks.collect(&:length))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-column.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-column.rb b/c_glib/test/test-column.rb
new file mode 100644
index 0000000..ec75194
--- /dev/null
+++ b/c_glib/test/test-column.rb
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestColumn < Test::Unit::TestCase
+  include Helper::Buildable
+
+  sub_test_case(".new") do
+    def test_array
+      field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+      array = build_boolean_array([true])
+      column = Arrow::Column.new(field, array)
+      assert_equal(1, column.length)
+    end
+
+    def test_chunked_array
+      field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+      chunks = [
+        build_boolean_array([true]),
+        build_boolean_array([false, true]),
+      ]
+      chunked_array = Arrow::ChunkedArray.new(chunks)
+      column = Arrow::Column.new(field, chunked_array)
+      assert_equal(3, column.length)
+    end
+  end
+
+  def test_length
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    array = build_boolean_array([true, false])
+    column = Arrow::Column.new(field, array)
+    assert_equal(2, column.length)
+  end
+
+  def test_n_nulls
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    array = build_boolean_array([true, nil, nil])
+    column = Arrow::Column.new(field, array)
+    assert_equal(2, column.n_nulls)
+  end
+
+  def test_field
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    array = build_boolean_array([true])
+    column = Arrow::Column.new(field, array)
+    assert_equal("enabled", column.field.name)
+  end
+
+  def test_name
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    array = build_boolean_array([true])
+    column = Arrow::Column.new(field, array)
+    assert_equal("enabled", column.name)
+  end
+
+  def test_data_type
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    array = build_boolean_array([true])
+    column = Arrow::Column.new(field, array)
+    assert_equal("bool", column.data_type.to_s)
+  end
+
+  def test_data
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    chunks = [
+      build_boolean_array([true]),
+      build_boolean_array([false, true]),
+    ]
+    chunked_array = Arrow::ChunkedArray.new(chunks)
+    column = Arrow::Column.new(field, chunked_array)
+    assert_equal(3, column.data.length)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-double-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-double-array.rb b/c_glib/test/test-double-array.rb
new file mode 100644
index 0000000..f9c000d
--- /dev/null
+++ b/c_glib/test/test-double-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestDoubleArray < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::DoubleArrayBuilder.new
+    builder.append(1.5)
+    array = builder.finish
+    assert_in_delta(1.5, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-double-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-double-data-type.rb b/c_glib/test/test-double-data-type.rb
new file mode 100644
index 0000000..18c870c
--- /dev/null
+++ b/c_glib/test/test-double-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestDoubleDataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::DoubleDataType.new
+    assert_equal(Arrow::Type::DOUBLE, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::DoubleDataType.new
+    assert_equal("double", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-field.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-field.rb b/c_glib/test/test-field.rb
new file mode 100644
index 0000000..a20802c
--- /dev/null
+++ b/c_glib/test/test-field.rb
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestField < Test::Unit::TestCase
+  def test_name
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    assert_equal("enabled", field.name)
+  end
+
+  def test_data_type
+    data_type = Arrow::BooleanDataType.new
+    field = Arrow::Field.new("enabled", data_type)
+    assert_equal(data_type.to_s, field.data_type.to_s)
+  end
+
+  def test_nullable?
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    assert do
+      field.nullable?
+    end
+  end
+
+  def test_to_s
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    assert_equal("enabled: bool", field.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-float-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-float-array.rb b/c_glib/test/test-float-array.rb
new file mode 100644
index 0000000..020c705
--- /dev/null
+++ b/c_glib/test/test-float-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestFloatArray < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::FloatArrayBuilder.new
+    builder.append(1.5)
+    array = builder.finish
+    assert_in_delta(1.5, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-float-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-float-data-type.rb b/c_glib/test/test-float-data-type.rb
new file mode 100644
index 0000000..ab315fd
--- /dev/null
+++ b/c_glib/test/test-float-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestFloatDataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::FloatDataType.new
+    assert_equal(Arrow::Type::FLOAT, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::FloatDataType.new
+    assert_equal("float", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-int16-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-int16-array.rb b/c_glib/test/test-int16-array.rb
new file mode 100644
index 0000000..2aa5b0c
--- /dev/null
+++ b/c_glib/test/test-int16-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestInt16Array < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::Int16ArrayBuilder.new
+    builder.append(-1)
+    array = builder.finish
+    assert_equal(-1, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-int16-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-int16-data-type.rb b/c_glib/test/test-int16-data-type.rb
new file mode 100644
index 0000000..273ec80
--- /dev/null
+++ b/c_glib/test/test-int16-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestInt16DataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::Int16DataType.new
+    assert_equal(Arrow::Type::INT16, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::Int16DataType.new
+    assert_equal("int16", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-int32-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-int32-array.rb b/c_glib/test/test-int32-array.rb
new file mode 100644
index 0000000..9dd6b3a
--- /dev/null
+++ b/c_glib/test/test-int32-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestInt32Array < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::Int32ArrayBuilder.new
+    builder.append(-1)
+    array = builder.finish
+    assert_equal(-1, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-int32-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-int32-data-type.rb b/c_glib/test/test-int32-data-type.rb
new file mode 100644
index 0000000..f6b9b34
--- /dev/null
+++ b/c_glib/test/test-int32-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestInt32DataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::Int32DataType.new
+    assert_equal(Arrow::Type::INT32, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::Int32DataType.new
+    assert_equal("int32", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-int64-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-int64-array.rb b/c_glib/test/test-int64-array.rb
new file mode 100644
index 0000000..612a8b4
--- /dev/null
+++ b/c_glib/test/test-int64-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestInt64Array < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::Int64ArrayBuilder.new
+    builder.append(-1)
+    array = builder.finish
+    assert_equal(-1, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-int64-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-int64-data-type.rb b/c_glib/test/test-int64-data-type.rb
new file mode 100644
index 0000000..032b24d
--- /dev/null
+++ b/c_glib/test/test-int64-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestInt64DataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::Int64DataType.new
+    assert_equal(Arrow::Type::INT64, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::Int64DataType.new
+    assert_equal("int64", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-int8-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-int8-array.rb b/c_glib/test/test-int8-array.rb
new file mode 100644
index 0000000..ab00996
--- /dev/null
+++ b/c_glib/test/test-int8-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestInt8Array < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::Int8ArrayBuilder.new
+    builder.append(-1)
+    array = builder.finish
+    assert_equal(-1, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-int8-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-int8-data-type.rb b/c_glib/test/test-int8-data-type.rb
new file mode 100644
index 0000000..d339456
--- /dev/null
+++ b/c_glib/test/test-int8-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestInt8DataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::Int8DataType.new
+    assert_equal(Arrow::Type::INT8, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::Int8DataType.new
+    assert_equal("int8", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-io-file-output-stream.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-io-file-output-stream.rb b/c_glib/test/test-io-file-output-stream.rb
new file mode 100644
index 0000000..1f2ae5f
--- /dev/null
+++ b/c_glib/test/test-io-file-output-stream.rb
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestIOFileOutputStream < Test::Unit::TestCase
+  sub_test_case(".open") do
+    def test_create
+      tempfile = Tempfile.open("arrow-io-file-output-stream")
+      tempfile.write("Hello")
+      tempfile.close
+      file = ArrowIO::FileOutputStream.open(tempfile.path, false)
+      file.close
+      assert_equal("", File.read(tempfile.path))
+    end
+
+    def test_append
+      tempfile = Tempfile.open("arrow-io-file-output-stream")
+      tempfile.write("Hello")
+      tempfile.close
+      file = ArrowIO::FileOutputStream.open(tempfile.path, true)
+      file.close
+      assert_equal("Hello", File.read(tempfile.path))
+    end
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-io-memory-mapped-file.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-io-memory-mapped-file.rb b/c_glib/test/test-io-memory-mapped-file.rb
new file mode 100644
index 0000000..6098198
--- /dev/null
+++ b/c_glib/test/test-io-memory-mapped-file.rb
@@ -0,0 +1,138 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestIOMemoryMappedFile < Test::Unit::TestCase
+  def test_open
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :read)
+    begin
+      buffer = " " * 5
+      file.read(buffer)
+      assert_equal("Hello", buffer)
+    ensure
+      file.close
+    end
+  end
+
+  def test_size
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :read)
+    begin
+      assert_equal(5, file.size)
+    ensure
+      file.close
+    end
+  end
+
+  def test_read
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello World")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :read)
+    begin
+      buffer = " " * 5
+      _success, n_read_bytes = file.read(buffer)
+      assert_equal("Hello", buffer.byteslice(0, n_read_bytes))
+    ensure
+      file.close
+    end
+  end
+
+  def test_read_at
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello World")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :read)
+    begin
+      buffer = " " * 5
+      _success, n_read_bytes = file.read_at(6, buffer)
+      assert_equal("World", buffer.byteslice(0, n_read_bytes))
+    ensure
+      file.close
+    end
+  end
+
+  def test_write
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :readwrite)
+    begin
+      file.write("World")
+    ensure
+      file.close
+    end
+    assert_equal("World", File.read(tempfile.path))
+  end
+
+  def test_write_at
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :readwrite)
+    begin
+      file.write_at(2, "rld")
+    ensure
+      file.close
+    end
+    assert_equal("Herld", File.read(tempfile.path))
+  end
+
+  def test_flush
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :readwrite)
+    begin
+      file.write("World")
+      file.flush
+      assert_equal("World", File.read(tempfile.path))
+    ensure
+      file.close
+    end
+  end
+
+  def test_tell
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello World")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :read)
+    begin
+      buffer = " " * 5
+      file.read(buffer)
+      assert_equal(5, file.tell)
+    ensure
+      file.close
+    end
+  end
+
+  def test_mode
+    tempfile = Tempfile.open("arrow-io-memory-mapped-file")
+    tempfile.write("Hello World")
+    tempfile.close
+    file = ArrowIO::MemoryMappedFile.open(tempfile.path, :readwrite)
+    begin
+      assert_equal(ArrowIO::FileMode::READWRITE, file.mode)
+    ensure
+      file.close
+    end
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-ipc-file-writer.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-ipc-file-writer.rb b/c_glib/test/test-ipc-file-writer.rb
new file mode 100644
index 0000000..369bff3
--- /dev/null
+++ b/c_glib/test/test-ipc-file-writer.rb
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestIPCFileWriter < Test::Unit::TestCase
+  def test_write_record_batch
+    tempfile = Tempfile.open("arrow-ipc-file-writer")
+    output = ArrowIO::FileOutputStream.open(tempfile.path, false)
+    begin
+      field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+      schema = Arrow::Schema.new([field])
+      file_writer = ArrowIPC::FileWriter.open(output, schema)
+      begin
+        record_batch = Arrow::RecordBatch.new(schema, 0, [])
+        file_writer.write_record_batch(record_batch)
+      ensure
+        file_writer.close
+      end
+    ensure
+      output.close
+    end
+
+    input = ArrowIO::MemoryMappedFile.open(tempfile.path, :read)
+    begin
+      file_reader = ArrowIPC::FileReader.open(input)
+      assert_equal(["enabled"],
+                   file_reader.schema.fields.collect(&:name))
+    ensure
+      input.close
+    end
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-ipc-stream-writer.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-ipc-stream-writer.rb b/c_glib/test/test-ipc-stream-writer.rb
new file mode 100644
index 0000000..62ac45d
--- /dev/null
+++ b/c_glib/test/test-ipc-stream-writer.rb
@@ -0,0 +1,53 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestIPCStreamWriter < Test::Unit::TestCase
+  include Helper::Buildable
+
+  def test_write_record_batch
+    tempfile = Tempfile.open("arrow-ipc-stream-writer")
+    output = ArrowIO::FileOutputStream.open(tempfile.path, false)
+    begin
+      field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+      schema = Arrow::Schema.new([field])
+      stream_writer = ArrowIPC::StreamWriter.open(output, schema)
+      begin
+        columns = [
+          build_boolean_array([true]),
+        ]
+        record_batch = Arrow::RecordBatch.new(schema, 1, columns)
+        stream_writer.write_record_batch(record_batch)
+      ensure
+        stream_writer.close
+      end
+    ensure
+      output.close
+    end
+
+    input = ArrowIO::MemoryMappedFile.open(tempfile.path, :read)
+    begin
+      stream_reader = ArrowIPC::StreamReader.open(input)
+      assert_equal(["enabled"],
+                   stream_reader.schema.fields.collect(&:name))
+      assert_equal(true,
+                   stream_reader.next_record_batch.get_column(0).get_value(0))
+      assert_nil(stream_reader.next_record_batch)
+    ensure
+      input.close
+    end
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-list-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-list-array.rb b/c_glib/test/test-list-array.rb
new file mode 100644
index 0000000..34177de
--- /dev/null
+++ b/c_glib/test/test-list-array.rb
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestListArray < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::ListArrayBuilder.new(Arrow::Int8ArrayBuilder.new)
+    value_builder = builder.value_builder
+
+    builder.append
+    value_builder.append(-29)
+    value_builder.append(29)
+
+    builder.append
+    value_builder.append(-1)
+    value_builder.append(0)
+    value_builder.append(1)
+
+    array = builder.finish
+    value = array.get_value(1)
+    assert_equal([-1, 0, 1],
+                 value.length.times.collect {|i| value.get_value(i)})
+  end
+
+  def test_value_type
+    builder = Arrow::ListArrayBuilder.new(Arrow::Int8ArrayBuilder.new)
+    array = builder.finish
+    assert_equal(Arrow::Int8DataType.new, array.value_type)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-list-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-list-data-type.rb b/c_glib/test/test-list-data-type.rb
new file mode 100644
index 0000000..6fde203
--- /dev/null
+++ b/c_glib/test/test-list-data-type.rb
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestListDataType < Test::Unit::TestCase
+  def test_type
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    data_type = Arrow::ListDataType.new(field)
+    assert_equal(Arrow::Type::LIST, data_type.type)
+  end
+
+  def test_to_s
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    data_type = Arrow::ListDataType.new(field)
+    assert_equal("list<enabled: bool>", data_type.to_s)
+  end
+
+  def test_value_field
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    data_type = Arrow::ListDataType.new(field)
+    assert_equal(field, data_type.value_field)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-null-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-null-array.rb b/c_glib/test/test-null-array.rb
new file mode 100644
index 0000000..6aa8c03
--- /dev/null
+++ b/c_glib/test/test-null-array.rb
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestNullArray < Test::Unit::TestCase
+  def test_length
+    array = Arrow::NullArray.new(3)
+    assert_equal(3, array.length)
+  end
+
+  def test_n_nulls
+    array = Arrow::NullArray.new(3)
+    assert_equal(3, array.n_nulls)
+  end
+
+  def test_slice
+    array = Arrow::NullArray.new(3)
+    assert_equal(2, array.slice(1, 2).length)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-null-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-null-data-type.rb b/c_glib/test/test-null-data-type.rb
new file mode 100644
index 0000000..95e5483
--- /dev/null
+++ b/c_glib/test/test-null-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestNullDataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::NullDataType.new
+    assert_equal(Arrow::Type::NA, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::NullDataType.new
+    assert_equal("null", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-record-batch.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-record-batch.rb b/c_glib/test/test-record-batch.rb
new file mode 100644
index 0000000..941ff35
--- /dev/null
+++ b/c_glib/test/test-record-batch.rb
@@ -0,0 +1,80 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestTable < Test::Unit::TestCase
+  include Helper::Buildable
+
+  def test_new
+    fields = [
+      Arrow::Field.new("visible", Arrow::BooleanDataType.new),
+      Arrow::Field.new("valid", Arrow::BooleanDataType.new),
+    ]
+    schema = Arrow::Schema.new(fields)
+    columns = [
+      build_boolean_array([true]),
+      build_boolean_array([false]),
+    ]
+    record_batch = Arrow::RecordBatch.new(schema, 1, columns)
+    assert_equal(1, record_batch.n_rows)
+  end
+
+  sub_test_case("instance methods") do
+    def setup
+      fields = [
+        Arrow::Field.new("visible", Arrow::BooleanDataType.new),
+        Arrow::Field.new("valid", Arrow::BooleanDataType.new),
+      ]
+      schema = Arrow::Schema.new(fields)
+      columns = [
+        build_boolean_array([true, false, true, false, true, false]),
+        build_boolean_array([false, true, false, true, false]),
+      ]
+      @record_batch = Arrow::RecordBatch.new(schema, 5, columns)
+    end
+
+    def test_schema
+      assert_equal(["visible", "valid"],
+                   @record_batch.schema.fields.collect(&:name))
+    end
+
+    def test_column
+      assert_equal(5, @record_batch.get_column(1).length)
+    end
+
+    def test_columns
+      assert_equal([6, 5],
+                   @record_batch.columns.collect(&:length))
+    end
+
+    def test_n_columns
+      assert_equal(2, @record_batch.n_columns)
+    end
+
+    def test_n_rows
+      assert_equal(5, @record_batch.n_rows)
+    end
+
+    def test_slice
+      sub_record_batch = @record_batch.slice(3, 2)
+      sub_visible_values = sub_record_batch.n_rows.times.collect do |i|
+        sub_record_batch.get_column(0).get_value(i)
+      end
+      assert_equal([false, true],
+                   sub_visible_values)
+    end
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-schema.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-schema.rb b/c_glib/test/test-schema.rb
new file mode 100644
index 0000000..c9cbb75
--- /dev/null
+++ b/c_glib/test/test-schema.rb
@@ -0,0 +1,69 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestSchema < Test::Unit::TestCase
+  def test_field
+    field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+    schema = Arrow::Schema.new([field])
+    assert_equal("enabled", schema.get_field(0).name)
+  end
+
+  sub_test_case("#get_field_by_name") do
+    def test_found
+      field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+      schema = Arrow::Schema.new([field])
+      assert_equal("enabled", schema.get_field_by_name("enabled").name)
+    end
+
+    def test_not_found
+      field = Arrow::Field.new("enabled", Arrow::BooleanDataType.new)
+      schema = Arrow::Schema.new([field])
+      assert_nil(schema.get_field_by_name("nonexistent"))
+    end
+  end
+
+  def test_n_fields
+    fields = [
+      Arrow::Field.new("enabled", Arrow::BooleanDataType.new),
+      Arrow::Field.new("required", Arrow::BooleanDataType.new),
+    ]
+    schema = Arrow::Schema.new(fields)
+    assert_equal(2, schema.n_fields)
+  end
+
+  def test_fields
+    fields = [
+      Arrow::Field.new("enabled", Arrow::BooleanDataType.new),
+      Arrow::Field.new("required", Arrow::BooleanDataType.new),
+    ]
+    schema = Arrow::Schema.new(fields)
+    assert_equal(["enabled", "required"],
+                 schema.fields.collect(&:name))
+  end
+
+  def test_to_s
+    fields = [
+      Arrow::Field.new("enabled", Arrow::BooleanDataType.new),
+      Arrow::Field.new("required", Arrow::BooleanDataType.new),
+    ]
+    schema = Arrow::Schema.new(fields)
+    assert_equal(<<-SCHEMA.chomp, schema.to_s)
+enabled: bool
+required: bool
+    SCHEMA
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-string-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-string-array.rb b/c_glib/test/test-string-array.rb
new file mode 100644
index 0000000..a0f5a7b
--- /dev/null
+++ b/c_glib/test/test-string-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestStringArray < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::StringArrayBuilder.new
+    builder.append("Hello")
+    array = builder.finish
+    assert_equal("Hello", array.get_string(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-string-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-string-data-type.rb b/c_glib/test/test-string-data-type.rb
new file mode 100644
index 0000000..daba7fd
--- /dev/null
+++ b/c_glib/test/test-string-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestStringDataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::StringDataType.new
+    assert_equal(Arrow::Type::STRING, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::StringDataType.new
+    assert_equal("string", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-struct-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-struct-array.rb b/c_glib/test/test-struct-array.rb
new file mode 100644
index 0000000..cf450f5
--- /dev/null
+++ b/c_glib/test/test-struct-array.rb
@@ -0,0 +1,58 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestStructArray < Test::Unit::TestCase
+  def test_fields
+    fields = [
+      Arrow::Field.new("score", Arrow::Int8DataType.new),
+      Arrow::Field.new("enabled", Arrow::BooleanDataType.new),
+    ]
+    data_type = Arrow::StructDataType.new(fields)
+    field_builders = [
+      Arrow::Int8ArrayBuilder.new,
+      Arrow::BooleanArrayBuilder.new,
+    ]
+    builder = Arrow::StructArrayBuilder.new(data_type, field_builders)
+
+    builder.append
+    builder.get_field_builder(0).append(-29)
+    builder.get_field_builder(1).append(true)
+
+    builder.append
+    builder.field_builders[0].append(2)
+    builder.field_builders[1].append(false)
+
+    array = builder.finish
+    values = array.length.times.collect do |i|
+      if i.zero?
+        [
+          array.get_field(0).get_value(i),
+          array.get_field(1).get_value(i),
+        ]
+      else
+        array.fields.collect do |field|
+          field.get_value(i)
+        end
+      end
+    end
+    assert_equal([
+                   [-29, true],
+                   [2, false],
+                 ],
+                 values)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-table.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-table.rb b/c_glib/test/test-table.rb
new file mode 100644
index 0000000..1687d2f
--- /dev/null
+++ b/c_glib/test/test-table.rb
@@ -0,0 +1,72 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestTable < Test::Unit::TestCase
+  include Helper::Buildable
+
+  sub_test_case(".new") do
+    def test_columns
+      fields = [
+        Arrow::Field.new("visible", Arrow::BooleanDataType.new),
+        Arrow::Field.new("valid", Arrow::BooleanDataType.new),
+      ]
+      schema = Arrow::Schema.new(fields)
+      columns = [
+        Arrow::Column.new(fields[0], build_boolean_array([true])),
+        Arrow::Column.new(fields[1], build_boolean_array([false])),
+      ]
+      table = Arrow::Table.new("memos", schema, columns)
+      assert_equal("memos", table.name)
+    end
+  end
+
+  sub_test_case("instance methods") do
+    def setup
+      fields = [
+        Arrow::Field.new("visible", Arrow::BooleanDataType.new),
+        Arrow::Field.new("valid", Arrow::BooleanDataType.new),
+      ]
+      schema = Arrow::Schema.new(fields)
+      columns = [
+        Arrow::Column.new(fields[0], build_boolean_array([true])),
+        Arrow::Column.new(fields[1], build_boolean_array([false])),
+      ]
+      @table = Arrow::Table.new("memos", schema, columns)
+    end
+
+    def test_name
+      assert_equal("memos", @table.name)
+    end
+
+    def test_schema
+      assert_equal(["visible", "valid"],
+                   @table.schema.fields.collect(&:name))
+    end
+
+    def test_column
+      assert_equal("valid", @table.get_column(1).name)
+    end
+
+    def test_n_columns
+      assert_equal(2, @table.n_columns)
+    end
+
+    def test_n_rows
+      assert_equal(1, @table.n_rows)
+    end
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-uint16-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-uint16-array.rb b/c_glib/test/test-uint16-array.rb
new file mode 100644
index 0000000..ad85f09
--- /dev/null
+++ b/c_glib/test/test-uint16-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestUInt16Array < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::UInt16ArrayBuilder.new
+    builder.append(1)
+    array = builder.finish
+    assert_equal(1, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-uint16-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-uint16-data-type.rb b/c_glib/test/test-uint16-data-type.rb
new file mode 100644
index 0000000..f5a6cc0
--- /dev/null
+++ b/c_glib/test/test-uint16-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestUInt16DataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::UInt16DataType.new
+    assert_equal(Arrow::Type::UINT16, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::UInt16DataType.new
+    assert_equal("uint16", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-uint32-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-uint32-array.rb b/c_glib/test/test-uint32-array.rb
new file mode 100644
index 0000000..59e19f3
--- /dev/null
+++ b/c_glib/test/test-uint32-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestUInt32Array < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::UInt32ArrayBuilder.new
+    builder.append(1)
+    array = builder.finish
+    assert_equal(1, array.get_value(0))
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-uint32-data-type.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-uint32-data-type.rb b/c_glib/test/test-uint32-data-type.rb
new file mode 100644
index 0000000..7a50257
--- /dev/null
+++ b/c_glib/test/test-uint32-data-type.rb
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestUInt32DataType < Test::Unit::TestCase
+  def test_type
+    data_type = Arrow::UInt32DataType.new
+    assert_equal(Arrow::Type::UINT32, data_type.type)
+  end
+
+  def test_to_s
+    data_type = Arrow::UInt32DataType.new
+    assert_equal("uint32", data_type.to_s)
+  end
+end

http://git-wip-us.apache.org/repos/asf/arrow/blob/39c7274f/c_glib/test/test-uint64-array.rb
----------------------------------------------------------------------
diff --git a/c_glib/test/test-uint64-array.rb b/c_glib/test/test-uint64-array.rb
new file mode 100644
index 0000000..e0195c1
--- /dev/null
+++ b/c_glib/test/test-uint64-array.rb
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+class TestUInt64Array < Test::Unit::TestCase
+  def test_value
+    builder = Arrow::UInt64ArrayBuilder.new
+    builder.append(1)
+    array = builder.finish
+    assert_equal(1, array.get_value(0))
+  end
+end


Mime
View raw message