Beispiel #1
0
  @Test
  public void shutdown_WITHOUT_CLEANUP() {
    solrLoader.setCopyConfiguration(false);

    solrLoader.shutdown();

    verify(solrHomeLocationPolicy).cleanup();
    verifyZeroInteractions(indexConfigurationCopier, indexReloader);
  }
Beispiel #2
0
  @Before
  public void setUp() {
    when(solrHomeLocationPolicy.getSolrHome()).thenReturn(CONFIGURATION_PATH);
    solrLoader.setSolrHomeLocationPolicy(solrHomeLocationPolicy);
    solrLoader.setCopyConfiguration(true);
    solrLoader.setIndexesConfigurations(
        Lists.newArrayList(firstIndexConfiguration, secondIndexConfiguration));

    solrLoader.setIndexConfigurationCopier(indexConfigurationCopier);
    solrLoader.setIndexReloader(indexReloader);
  }
Beispiel #3
0
  @Test
  public void load_WITHOUT_COPYING() {
    solrLoader.setCopyConfiguration(false);

    solrLoader.load();

    verifyZeroInteractions(indexConfigurationCopier);

    verify(indexReloader).reloadIndex(firstIndexConfiguration);
    verify(indexReloader).reloadIndex(secondIndexConfiguration);
    verifyNoMoreInteractions(indexReloader);
  }
Beispiel #4
0
  @Test
  public void shutdown_WITH_CLEANUP() {

    solrLoader.shutdown();

    verify(indexConfigurationCopier)
        .cleanupIndexConfiguration(firstIndexConfiguration, CONFIGURATION_PATH);
    verify(indexConfigurationCopier)
        .cleanupIndexConfiguration(secondIndexConfiguration, CONFIGURATION_PATH);
    verify(solrHomeLocationPolicy).cleanup();
    verifyNoMoreInteractions(indexConfigurationCopier);
    verifyZeroInteractions(indexReloader);
  }
Beispiel #5
0
  @Test
  public void load_WITH_COPYING() {

    solrLoader.load();

    verify(indexConfigurationCopier)
        .copyIndexConfiguration(firstIndexConfiguration, CONFIGURATION_PATH);
    verify(indexConfigurationCopier)
        .copyIndexConfiguration(secondIndexConfiguration, CONFIGURATION_PATH);

    verify(indexReloader).reloadIndex(firstIndexConfiguration);
    verify(indexReloader).reloadIndex(secondIndexConfiguration);

    verifyNoMoreInteractions(indexConfigurationCopier, indexReloader);
  }