### Question:
DIRepositoryLocator extends RepositoryLocator { public void setRepository( Repository repository ) { this.repository = repository; } DIRepositoryLocator();  DIRepositoryLocator( List<IDocumentListener> documentListeners ); void setUnifiedRepository( IUnifiedRepository unifiedRepository ); void setRepository( Repository repository ); @Override URI getRootUri(); static final String LOCATOR_TYPE; }### Answer:
@Test public void testStartLocator() throws Exception { TinkerGraph graph = new TinkerGraph(); IMetaverseBuilder metaverseBuilder = new MetaverseBuilder( graph ); spyLocator.setMetaverseBuilder( metaverseBuilder ); spyLocator.addDocumentListener( this ); spyLocator.setRepository( LocatorTestUtils.getFakeDiRepository() ); LocatorTestUtils.delay = 0; spyLocator.setRepositoryId( "testrepo" ); assertEquals( "Repo id is wrong", "testrepo", spyLocator.getRepositoryId() ); assertNotNull( "Indexer type is null", spyLocator.getLocatorType() ); events = new ArrayList<IDocumentEvent>(); spyLocator.startScan(); spyLocator.futureTask.get(); assertEquals( "Event count is wrong", 7, events.size() ); for ( IDocumentEvent event : events ) { System.out.println( event.getDocument().getStringID() ); assertNotNull( event.getDocument() ); MetaverseDocument document = (MetaverseDocument) event.getDocument(); if ( document.getExtension().equals( "ktr" ) ) { assertTrue( document.getContent() instanceof TransMeta ); } else if ( document.getExtension().equals( "kjb" ) ) { assertTrue( document.getContent() instanceof JobMeta ); } } spyLocator.removeDocumentListener( this ); events = new ArrayList<IDocumentEvent>(); spyLocator.startScan(); spyLocator.futureTask.get(); assertEquals( "Event count is wrong", 0, events.size() ); }