You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2017/05/30 20:27:16 UTC

svn commit: r1796934 - /pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java

Author: rwhitcomb
Date: Tue May 30 20:27:16 2017
New Revision: 1796934

URL: http://svn.apache.org/viewvc?rev=1796934&view=rev
Log:
PIVOT-999: Add a DictionaryTest to test the new default "getIntValue" and
"setIntValue" methods in the Dictionary interface.

Added:
    pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java

Added: pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java?rev=1796934&view=auto
==============================================================================
--- pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java (added)
+++ pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java Tue May 30 20:27:16 2017
@@ -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.
+ */
+package org.apache.pivot.collections.test;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import org.apache.pivot.collections.HashMap;
+
+
+public class DictionaryTest {
+    @Test
+    public void test() {
+        HashMap<String, Integer> map = new HashMap<>();
+        map.putIntValue("one", 1);
+        map.putIntValue("two", 2);
+        map.putIntValue("three", 300);
+        assertEquals(map.getIntValue("one"), 1);
+        assertEquals(map.getIntValue("two"), 2);
+        assertEquals(map.getIntValue("three"), 300);
+    }
+
+}