Package org.hibernate.search.testsupport.leakdetection

Examples of org.hibernate.search.testsupport.leakdetection.FileMonitoringDirectory


  @Test
  public void testFileHandlesReleased() {
    //We initialize the SearchFactory in the test itself as we want to test it's state *after* shutdown
    searchFactory = initializeSearchFactory();
    //extract the directories now, as they won't be available after SearchFactory#close :
    FileMonitoringDirectory directoryOne = getDirectory( "index1" );
    FileMonitoringDirectory directoryTwo = getDirectory( "index2" );
    try {
      doSomeOperations();
      assertDirectoryOpen( directoryOne );
      assertDirectoryOpen( directoryTwo );
      if ( nrtNotEnabled() ) {
View Full Code Here


  }

  private FileMonitoringDirectory getDirectory(String indexName) {
    DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) searchFactory.getIndexManagerHolder().getIndexManager( indexName );
    FileMonitoringDirectoryProvider directoryProvider = (FileMonitoringDirectoryProvider) indexManager.getDirectoryProvider();
    FileMonitoringDirectory directory = (FileMonitoringDirectory) directoryProvider.getDirectory();
    return directory;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.testsupport.leakdetection.FileMonitoringDirectory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.