use of org.kie.workbench.common.services.refactoring.backend.server.query.NamedQuery in project kie-wb-common by kiegroup.
the class BaseLibraryIndexingTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() throws IOException {
if (!created) {
final String repositoryName = getRepositoryName();
final String path = createTempDirectory().getAbsolutePath();
System.setProperty("org.uberfire.nio.git.dir", path);
System.setProperty("org.uberfire.nio.git.daemon.enabled", "false");
System.setProperty("org.uberfire.nio.git.ssh.enabled", "false");
System.setProperty("org.uberfire.sys.repo.monitor.disabled", "true");
System.out.println(".niogit: " + path);
final URI newRepo = URI.create("git://" + repositoryName);
try {
IOService ioService = ioService();
ioService.newFileSystem(newRepo, new HashMap<>());
// Don't ask, but we need to write a single file first in order for indexing to work
basePath = getDirectoryPath().resolveSibling("someNewOtherPath");
ioService().write(basePath.resolve("dummy"), "<none>");
} catch (final Exception e) {
e.printStackTrace();
logger.warn("Failed to initialize IOService instance: " + e.getClass().getSimpleName() + ": " + e.getMessage(), e);
} finally {
created = true;
}
final Instance<NamedQuery> namedQueriesProducer = mock(Instance.class);
when(namedQueriesProducer.iterator()).thenReturn(getQueries().iterator());
service = new RefactoringQueryServiceImpl(config, new NamedQueries(namedQueriesProducer));
service.init();
}
}
use of org.kie.workbench.common.services.refactoring.backend.server.query.NamedQuery in project kie-wb-common by kiegroup.
the class BaseIndexingTest method setup.
@Before
public void setup() throws IOException {
if (!created) {
final String repositoryName = getRepositoryName();
final String path = createTempDirectory().getAbsolutePath();
System.setProperty("org.uberfire.nio.git.dir", path);
System.setProperty("org.uberfire.nio.git.daemon.enabled", "false");
System.setProperty("org.uberfire.nio.git.ssh.enabled", "false");
System.setProperty("org.uberfire.sys.repo.monitor.disabled", "true");
System.out.println(".niogit: " + path);
final URI newRepo = URI.create("git://" + repositoryName);
try {
IOService ioService = ioService();
ioService.newFileSystem(newRepo, new HashMap<String, Object>());
// Don't ask, but we need to write a single file first in order for indexing to work
basePath = getDirectoryPath().resolveSibling("someNewOtherPath");
ioService().write(basePath.resolve("dummy"), "<none>");
} catch (final Exception e) {
e.printStackTrace();
logger.warn("Failed to initialize IOService instance: " + e.getClass().getSimpleName() + ": " + e.getMessage(), e);
} finally {
created = true;
}
final Instance<NamedQuery> namedQueriesProducer = mock(Instance.class);
when(namedQueriesProducer.iterator()).thenReturn(getQueries().iterator());
service = new RefactoringQueryServiceImpl(getConfig(), new NamedQueries(namedQueriesProducer));
service.init();
}
}
Aggregations