You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by to...@apache.org on 2016/01/12 15:12:42 UTC
svn commit: r1724236 -
/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/NodeStateFacetsConfigTest.java
Author: tommaso
Date: Tue Jan 12 14:12:42 2016
New Revision: 1724236
URL: http://svn.apache.org/viewvc?rev=1724236&view=rev
Log:
OAK-2511 - added missing test for NodeStateFacetsConfig
Added:
jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/NodeStateFacetsConfigTest.java (with props)
Added: jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/NodeStateFacetsConfigTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/NodeStateFacetsConfigTest.java?rev=1724236&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/NodeStateFacetsConfigTest.java (added)
+++ jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/NodeStateFacetsConfigTest.java Tue Jan 12 14:12:42 2016
@@ -0,0 +1,54 @@
+/*
+ * 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.jackrabbit.oak.plugins.index.lucene.util;
+
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.apache.lucene.facet.FacetsConfig;
+import org.junit.Test;
+
+import static org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.INITIAL_CONTENT;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests for {@link NodeStateFacetsConfig}
+ */
+public class NodeStateFacetsConfigTest {
+
+ private NodeState root = INITIAL_CONTENT;
+
+ private NodeBuilder builder = root.builder();
+
+ @Test
+ public void testMultivaluedDimConfig() throws Exception {
+ NodeStateFacetsConfig nodeStateFacetsConfig = new NodeStateFacetsConfig(builder);
+ String dimension = "foo";
+ nodeStateFacetsConfig.setMultiValued(dimension, true);
+ FacetsConfig.DimConfig dimConfig = nodeStateFacetsConfig.getDimConfig(dimension);
+ assertNotNull(dimConfig);
+ assertTrue(dimConfig.multiValued);
+
+ NodeStateFacetsConfig nodeStateFacetsConfig2 = new NodeStateFacetsConfig(builder);
+ FacetsConfig.DimConfig dimConfig2 = nodeStateFacetsConfig2.getDimConfig(dimension);
+ assertNotNull(dimConfig2);
+ assertTrue(dimConfig2.multiValued);
+ }
+
+}
\ No newline at end of file
Propchange: jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/NodeStateFacetsConfigTest.java
------------------------------------------------------------------------------
svn:eol-style = native