IndexImporter { static String getAsyncLaneName(String indexPath, NodeState indexState) { PropertyState asyncPrevious = indexState.getProperty(AsyncLaneSwitcher.ASYNC_PREVIOUS); if (asyncPrevious != null && !AsyncLaneSwitcher.isNone(asyncPrevious)){ return IndexUtils.getAsyncLaneName(indexState, indexPath, asyncPrevious); } return IndexUtils.getAsyncLaneName(indexState, indexPath); } IndexImporter(NodeStore nodeStore, File indexDir, IndexEditorProvider indexEditorProvider,
                         AsyncIndexerLock indexerLock); void importIndex(); void addImporterProvider(IndexImporterProvider importerProvider);  }
@Test public void laneName() throws Exception{ NodeBuilder builder = EMPTY_NODE.builder(); builder.setProperty(IndexConstants.ASYNC_PROPERTY_NAME, "async"); assertEquals("async", IndexImporter.getAsyncLaneName("foo", builder.getNodeState())); builder = EMPTY_NODE.builder(); builder.setProperty(IndexConstants.ASYNC_PROPERTY_NAME, asList("async", "nrt"), Type.STRINGS); assertEquals("async", IndexImporter.getAsyncLaneName("foo", builder.getNodeState())); builder = EMPTY_NODE.builder(); builder.setProperty(IndexConstants.ASYNC_PROPERTY_NAME, asList("async", "nrt"), Type.STRINGS); AsyncLaneSwitcher.switchLane(builder, "tmp-async"); assertEquals("async", IndexImporter.getAsyncLaneName("foo", builder.getNodeState())); builder = EMPTY_NODE.builder(); builder.setProperty(IndexConstants.ASYNC_PROPERTY_NAME, asList("async", "nrt"), Type.STRINGS); AsyncLaneSwitcher.switchLane(builder, "tmp-async"); assertEquals("async", IndexImporter.getAsyncLaneName("foo", builder.getNodeState())); }