public void CollectionTemplate_solr5_SetToConfigSetDataDrivenConfig()
        {
            SolrInformation sut = new SolrInformation(solr5definition);

            Assert.AreEqual(@"configsets\data_driven_schema_configs", sut.CollectionTemplate);
            Assert.AreEqual(@"anonymousPath\configsets\data_driven_schema_configs", sut.TemplateFullPath);
        }
        public void CollectionTemplate_Solr4_SetToCollection1()
        {
            SolrInformation sut = new SolrInformation(solr4definition);

            Assert.AreEqual("collection1", sut.CollectionTemplate);
            Assert.AreEqual(@"anonymousPath\collection1", sut.TemplateFullPath);
        }
        public void Constructor_PathInSolrHome_SetsProperty()
        {
            string        anonymousPath  = "anonymousPath" + Guid.NewGuid();
            XmlDocumentEx solrDefinition = XmlDocumentEx.LoadXml($@"<response><lst name=""lucene""><str name=""solr-spec-version"">5.0.0</str></lst><str name=""solr_home"">{anonymousPath}</str></response>");

            var info = new SolrInformation(solrDefinition);

            Assert.AreEqual(info.SolrBasePath, anonymousPath);
        }
        public void Constructor_PathInJavaRuntimeSetting_SetsProperty()
        {
            string        anonymousPath  = "anonymousPath" + Guid.NewGuid();
            XmlDocumentEx solrDefinition = XmlDocumentEx.LoadXml($@"
    <response>
      <lst name=""lucene""><str name=""solr-spec-version"">4.0.0</str></lst>
      <lst name=""jvm"">
        <lst name=""jmx"">
          <arr name=""commandLineArgs"">
            <str>other setting</str>
            <str>-Dsolr.solr.home={anonymousPath}</str>
            <str>other setting</str>
          </arr>
      </lst>
    </lst>
</response>");

            var info = new SolrInformation(solrDefinition);

            Assert.AreEqual(info.SolrBasePath, anonymousPath);
        }
        public void Constructor_PathInSettingArgs_UsesSetting()
        {
            // Randomized to ensure separate, with embedded helper value. This
            // pattern is borrowed from AutoFixture.
            string        pathFromSettings = "pathFromSettings" + Guid.NewGuid();
            string        pathFromArgs     = "pathFromArgs" + Guid.NewGuid();
            XmlDocumentEx solrDefinition   = XmlDocumentEx.LoadXml($@"
    <response>
      <lst name=""lucene""><str name=""solr-spec-version"">4.0.0</str></lst>
        <lst name=""jvm""><lst name=""jmx"">
          <arr name=""commandLineArgs"">
            <str>-Dsolr.solr.home={pathFromArgs}</str>
          </arr>
      </lst>
    </lst>
<str name=""solr_home"">{pathFromSettings}</str>
</response>");

            var info = new SolrInformation(solrDefinition);

            Assert.AreEqual(pathFromSettings, info.SolrBasePath);
        }
        public void Constructor_PassedSolr5_ReturnsObject()
        {
            SolrInformation sut = new SolrInformation(solr5definition);

            Assert.IsNotNull(sut);
        }
Ejemplo n.º 7
0
        public void ConstructorPassedSolr4ReturnsObject()
        {
            SolrInformation sut = new SolrInformation(Solr4Definition);

            Assert.IsNotNull(sut);
        }