ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-3277 Added test for simple class with public fields and without getters and setters.
Date Mon, 20 Jun 2016 11:19:39 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3277 1de04e7dc -> a9cbffc4b


IGNITE-3277 Added test for simple class with public fields and without getters and setters.


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

Branch: refs/heads/ignite-3277
Commit: a9cbffc4b1dfe546fab8ee16a8a6ee45182d74fd
Parents: 1de04e7
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Mon Jun 20 18:17:05 2016 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Mon Jun 20 18:17:05 2016 +0700

----------------------------------------------------------------------
 .../JettyRestProcessorAbstractSelfTest.java     | 13 +++++
 .../internal/processors/rest/SimplePerson.java  | 59 ++++++++++++++++++++
 2 files changed, 72 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a9cbffc4/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index 6fcc398..70d30fb 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -339,6 +339,19 @@ public abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestPro
     /**
      * @throws Exception If failed.
      */
+    public void testSimpleObject()  throws Exception {
+        SimplePerson p = new SimplePerson(1, "Test", java.sql.Date.valueOf("1977-01-26"),
1000.55);
+
+        jcache().put("simplePersonKey", p);
+
+        String ret = content(F.asMap("cmd", GridRestCommand.CACHE_GET.key(), "key", "simplePersonKey"));
+
+        info("Get command result: " + ret);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testDate() throws Exception {
         java.util.Date utilDate = new java.util.Date();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a9cbffc4/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/SimplePerson.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/SimplePerson.java
b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/SimplePerson.java
new file mode 100644
index 0000000..119e873
--- /dev/null
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/SimplePerson.java
@@ -0,0 +1,59 @@
+/*
+ * 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.processors.rest;
+
+import java.sql.Date;
+
+/**
+ * Test class with public fields and without getters and setters.
+ */
+public class SimplePerson {
+    /** Person ID. */
+    public int id;
+
+    /** Person name. */
+    public String name;
+
+    /** Person birthday. */
+    public Date birthday;
+
+    /** Person salary. */
+    public double salary;
+
+    /**
+     * Default constructor.
+     */
+    public SimplePerson() {
+        // No-op.
+    }
+
+    /**
+     * Full constructor.
+     *
+     * @param id Person ID.
+     * @param name Person name.
+     * @param birthday Person birthday.
+     * @param salary Person salary.
+     */
+    public SimplePerson(int id, String name, Date birthday, double salary) {
+        this.id = id;
+        this.name = name;
+        this.birthday = birthday;
+        this.salary = salary;
+    }
+}


Mime
View raw message