This is an automated email from the ASF dual-hosted git repository.

agoncharuk pushed a commit to branch ignite-13617
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/ignite-13617 by this push:
     new df57872  IGNITE-13617 Fix review comments.
df57872 is described below

commit df5787288379122fe0e16efc5b05f7cba0dd7817
Author: Alexey Goncharuk <alexey.goncha...@gmail.com>
AuthorDate: Fri Nov 6 14:28:34 2020 +0300

    IGNITE-13617 Fix review comments.
---
 .../apache/ignite/internal/schema/NativeType.java  |  5 +++-
 .../ignite/internal/schema/NativeTypeTest.java     |  6 ++++
 .../ignite/internal/schema/SchemaTestSuite.java    | 35 ++++++++++++++++++++++
 3 files changed, 45 insertions(+), 1 deletion(-)

diff --git 
a/modules/commons/src/main/java/org/apache/ignite/internal/schema/NativeType.java
 
b/modules/commons/src/main/java/org/apache/ignite/internal/schema/NativeType.java
index 9caaea3..211a1e1 100644
--- 
a/modules/commons/src/main/java/org/apache/ignite/internal/schema/NativeType.java
+++ 
b/modules/commons/src/main/java/org/apache/ignite/internal/schema/NativeType.java
@@ -78,7 +78,10 @@ public class NativeType implements Comparable<NativeType> {
     }
 
     /**
-     * @return Length of the type if it is a fixlen type.
+     * @return Length of the type if it is a fixlen type. For varlen types the 
return value is undefined, so the user
+     * should explicitly check {@code spec().fixedLength()} before using this 
method.
+     *
+     * @see NativeTypeSpec#fixedLength()
      */
     public int length() {
         return len;
diff --git 
a/modules/commons/src/test/java/org/apache/ignite/internal/schema/NativeTypeTest.java
 
b/modules/commons/src/test/java/org/apache/ignite/internal/schema/NativeTypeTest.java
index fc7e020..d2cf2a5 100644
--- 
a/modules/commons/src/test/java/org/apache/ignite/internal/schema/NativeTypeTest.java
+++ 
b/modules/commons/src/test/java/org/apache/ignite/internal/schema/NativeTypeTest.java
@@ -29,11 +29,17 @@ public class NativeTypeTest {
      */
     @Test
     public void testCompareFixlenVarlen() {
+        Assert.assertTrue(NativeType.BYTE.compareTo(NativeType.STRING) < 0);
+        Assert.assertTrue(NativeType.BYTE.compareTo(NativeType.BYTES) < 0);
+
         Assert.assertTrue(NativeType.INTEGER.compareTo(NativeType.STRING) < 0);
         Assert.assertTrue(NativeType.INTEGER.compareTo(NativeType.BYTES) < 0);
 
         Assert.assertTrue(NativeType.LONG.compareTo(NativeType.STRING) < 0);
         Assert.assertTrue(NativeType.LONG.compareTo(NativeType.BYTES) < 0);
+
+        Assert.assertTrue(NativeType.UUID.compareTo(NativeType.STRING) < 0);
+        Assert.assertTrue(NativeType.UUID.compareTo(NativeType.BYTES) < 0);
     }
 
     /**
diff --git 
a/modules/commons/src/test/java/org/apache/ignite/internal/schema/SchemaTestSuite.java
 
b/modules/commons/src/test/java/org/apache/ignite/internal/schema/SchemaTestSuite.java
new file mode 100644
index 0000000..93e489b
--- /dev/null
+++ 
b/modules/commons/src/test/java/org/apache/ignite/internal/schema/SchemaTestSuite.java
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.internal.schema;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+
+/**
+ *
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    NativeTypeTest.class,
+    ColumnTest.class,
+    ColumnsTest.class,
+    TupleTest.class
+})
+public class SchemaTestSuite {
+}

Reply via email to