You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2022/05/30 17:51:34 UTC

[ignite-3] branch ignite-14972 updated: Add FakeColumnMetadata

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

ptupitsyn pushed a commit to branch ignite-14972
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/ignite-14972 by this push:
     new fec40d59b Add FakeColumnMetadata
fec40d59b is described below

commit fec40d59bea23a05549b63cd8395cd3f2ff8aaa5
Author: Pavel Tupitsyn <pt...@apache.org>
AuthorDate: Mon May 30 20:51:29 2022 +0300

    Add FakeColumnMetadata
---
 .../ignite/client/fakes/FakeAsyncResultSet.java    |  2 +-
 .../ignite/client/fakes/FakeColumnMetadata.java    | 61 ++++++++++++++++++++++
 2 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeAsyncResultSet.java b/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeAsyncResultSet.java
index 4f6a6874f..0af561229 100644
--- a/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeAsyncResultSet.java
+++ b/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeAsyncResultSet.java
@@ -76,7 +76,7 @@ public class FakeAsyncResultSet implements AsyncResultSet {
         rows.add(row);
 
         columns = new ArrayList<>();
-        columns.add(mock(ColumnMetadata.class));
+        columns.add(new FakeColumnMetadata("col1"));
     }
 
     /** {@inheritDoc} */
diff --git a/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeColumnMetadata.java b/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeColumnMetadata.java
new file mode 100644
index 000000000..2240ef463
--- /dev/null
+++ b/modules/client/src/test/java/org/apache/ignite/client/fakes/FakeColumnMetadata.java
@@ -0,0 +1,61 @@
+/*
+ * 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.client.fakes;
+
+import org.apache.ignite.sql.ColumnMetadata;
+
+/**
+ * Fake column meta.
+ */
+class FakeColumnMetadata implements ColumnMetadata {
+    /** */
+    private final String name;
+
+    /**
+     * Constructor.
+     *
+     * @param name Column name.
+     */
+    FakeColumnMetadata(String name) {
+        this.name = name;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public String name() {
+        return name;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Class<?> valueClass() {
+        return Object.class;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Object type() {
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean nullable() {
+        return false;
+    }
+}