[ https://issues.apache.org/jira/browse/METRON-1419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16345638#comment-16345638 ]
ASF GitHub Bot commented on METRON-1419: ---------------------------------------- Github user justinleet commented on a diff in the pull request: https://github.com/apache/metron/pull/911#discussion_r164842112 --- Diff: metron-platform/metron-solr/src/test/java/org/apache/metron/solr/integration/SolrSearchIntegrationTest.java --- @@ -0,0 +1,152 @@ +/** + * 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.metron.solr.integration; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import org.apache.metron.common.utils.JSONUtils; +import org.apache.metron.indexing.dao.AccessConfig; +import org.apache.metron.indexing.dao.IndexDao; +import org.apache.metron.indexing.dao.SearchIntegrationTest; +import org.apache.metron.indexing.dao.search.FieldType; +import org.apache.metron.indexing.dao.search.InvalidSearchException; +import org.apache.metron.indexing.dao.search.SearchRequest; +import org.apache.metron.indexing.dao.search.SearchResponse; +import org.apache.metron.integration.InMemoryComponent; +import org.apache.metron.solr.dao.SolrDao; +import org.apache.metron.solr.integration.components.SolrComponent; +import org.apache.solr.client.solrj.impl.CloudSolrClient; +import org.json.simple.JSONArray; +import org.json.simple.parser.JSONParser; +import org.junit.Assert; +import org.junit.Test; + +public class SolrSearchIntegrationTest extends SearchIntegrationTest { + + private SolrComponent solrComponent; + + @Override + protected IndexDao createDao() throws Exception { + AccessConfig config = new AccessConfig(); + config.setMaxSearchResults(100); + config.setMaxSearchGroups(100); + config.setGlobalConfigSupplier( () -> + new HashMap<String, Object>() {{ + put("solr.zookeeper", solrComponent.getZookeeperUrl()); + }} + ); + + IndexDao dao = new SolrDao(); + dao.init(config); + return dao; + } + + @Override + protected InMemoryComponent startIndex() throws Exception { + solrComponent = new SolrComponent.Builder() + .addCollection("bro", "../metron-solr/src/test/resources/config/bro/conf") + .addCollection("snort", "../metron-solr/src/test/resources/config/snort/conf") + .build(); + solrComponent.start(); + return solrComponent; + } + + @Override --- End diff -- Could you throw ``` @SuppressWarnings("unchecked") ``` on here? > Create a SolrDao > ---------------- > > Key: METRON-1419 > URL: https://issues.apache.org/jira/browse/METRON-1419 > Project: Metron > Issue Type: Sub-task > Reporter: Justin Leet > Assignee: Ryan Merriman > Priority: Major > > Create an implementation of the IndexDao for Solr. This will involve > implementing the various IndexDao methods using the SolrJ library and also > providing a SolrSearchIntegrationTest that extends SearchIntegrationTest > (similar to ElasticsearchSearchIntegrationTest). An integration test similar > to ElasticsearchUpdateIntegrationTest should also be included. -- This message was sent by Atlassian JIRA (v7.6.3#76005)