Github user dsmiley commented on a diff in the pull request: https://github.com/apache/lucene-solr/pull/416#discussion_r204771149 --- Diff: solr/core/src/test/org/apache/solr/response/transform/TestDeeplyNestedChildDocTransformer.java --- @@ -0,0 +1,163 @@ +/* + * 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.solr.response.transform; + +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.solr.SolrTestCaseJ4; +import org.junit.After; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TestDeeplyNestedChildDocTransformer extends SolrTestCaseJ4 { + + private static AtomicInteger counter = new AtomicInteger(); + private static final char PATH_SEP_CHAR = '/'; + private static final String[] types = {"donut", "cake"}; + private static final String[] ingredients = {"flour", "cocoa", "vanilla"}; + private static final String[] names = {"Yaz", "Jazz", "Costa"}; + + @BeforeClass + public static void beforeClass() throws Exception { + initCore("solrconfig-update-processor-chains.xml", "schema15.xml"); + } + + @After + public void after() throws Exception { + assertU(delQ("*:*")); + assertU(commit()); + } + + @Test + public void testParentFilterJSON() throws Exception { + indexSampleData(10); + String[] tests = new String[] { --- End diff -- As I've suggested in a previous issue, I think it's simpler and more complete to test by evaluating the entire result as a string compared to an expected string. Otherwise, as a reviewer I'm asking myself what assertions would be useful for this query that you didn't think of. I think this test philosophy here is especially valuable because fundamentally you're building this interesting structured response. Essentially everything in the response is pertinent to the test -- contains very little immaterial noise.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org