import * as path from "path" ; import { extensions , Uri } from "vscode" ; import { DataNode } from "../extension.bundle" ; export namespace Uris { export const SIMPLE_PROJECT_NODE = truePath ( "simple" ) ; export const SIMPLE_MAIN_PACKAGE = truePath ( "simple" , "src" , "main" , "java" ) ; export const SIMPLE_MAIN_CLASS = truePath ( "simple" , "src" , "main" , "java" , "HelloWorld.java" ) ; export const MAVEN_PROJECT_NODE = truePath ( "maven" ) ; export const MAVEN_MAIN_PACKAGE = truePath ( "maven" , "src" , "main" , "java" ) ; export const MAVEN_TEST_PACKAGE = truePath ( "maven" , "src" , "test" , "java" ) ; export const MAVEN_MAIN_SUBPACKAGE = truePath ( "maven" , "src" , "main" , "java" , "com" , "mycompany" , "app" ) ; export const MAVEN_TEST_SUBPACKAGE = truePath ( "maven" , "src" , "test" , "java" , "com" , "mycompany" , "app" ) ; export const MAVEN_MAIN_CLASS = truePath ( "maven" , "src" , "main" , "java" , "com" , "mycompany" , "app" , "App.java" ) ; export const MAVEN_TEST_CLASS = truePath ( "maven" , "src" , "test" , "java" , "com" , "mycompany" , "app" , "AppTest.java" ) ; export const GRADLE_PROJECT_NODE = truePath ( "gradle" ) ; export const GRADLE_MAIN_PACKAGE = truePath ( "gradle" , "src" , "main" , "java" ) ; export const GRADLE_MAIN_CLASS = truePath ( "gradle" , "src" , "main" , "java" , "GradleTest.java" ) ; } export function fsPath ( node ) { if ( ! node . uri ) { return "" ; } return path . resolve ( Uri . parse ( node . uri ) . fsPath ) ; } export function truePath ( ... paths ) { const basePath = path . join ( __dirname , ".." , ".." , "test" ) ; return path . resolve ( path . join ( basePath , ... paths ) ) ; } export async function setupTestEnv ( ) { await extensions . getExtension ( "redhat.java" ) ! . activate ( ) ; await extensions . getExtension ( "vscjava.vscode-java-dependency" ) ! . activate ( ) ; }