通过嵌入式服务器测试 Solr [英] Testing Solr via Embedded Server

查看:50
本文介绍了通过嵌入式服务器测试 Solr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的 solr-indexer 应用程序编写一些测试代码.遵循测试最佳实践,我想编写独立的代码,只需加载 schema.xmlsolrconfig.xml 并为索引搜索测试创建临时数据树.由于应用程序大部分是用 Java 编写的,我正在处理 SolrJ 库,但我遇到了问题(好吧,我迷失在 corecontainers-coredescriptor-coreconfig-solrcore 的世界中......)任何人都可以在这里放置一些代码来创建一个嵌入式服务器,该服务器加载配置并写入参数传递的数据目录?

I'm coding some tests for my solr-indexer application. Following testing best practices, I want to write code self-dependant, just loading the schema.xml and solrconfig.xml and creating a temporary data tree for the indexing-searching tests. As the application is most written in java, I'm dealing with SolrJ library, but I'm getting problems (well, I'm lost in the universe of corecontainers-coredescriptor-coreconfig-solrcore ...) Anyone can place here some code to create an Embedded Server that loads the config and also writes to a parameter-pased data-dir?

推荐答案

您可以从 SolrExampleTests 扩展了 SolrExampleTestBase 扩展了 AbstractSolrTestCase .

You can start with the SolrExampleTests which extends SolrExampleTestBase which extends AbstractSolrTestCase .

还有这个 SampleTest.

另请查看这个this 线程.

这篇关于通过嵌入式服务器测试 Solr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆