import * as fse from 'fs-extra' ; import * as path from 'path' ; import { runWithTestActionContext , TestInput } from 'vscode-azureextensiondev' ; import { createNewProjectInternal , ProjectLanguage } from '../../extension.bundle' ; import { cleanTestWorkspace } from '../global.test' ; export namespace javaUtils { export async function addJavaProjectToWorkspace ( testWorkspacePath ) { if ( ! await fse . pathExists ( path . join ( testWorkspacePath , 'pom.xml' ) ) ) { const inputs = [ testWorkspacePath , ProjectLanguage . Java , TestInput . UseDefaultValue , TestInput . UseDefaultValue , TestInput . UseDefaultValue , TestInput . UseDefaultValue , TestInput . UseDefaultValue , 'javaAppName' ] ; await cleanTestWorkspace ( ) ; await runWithTestActionContext ( 'createNewProject' , async ( context ) => { await context . ui . runWithInputs ( inputs , async ( ) => { await createNewProjectInternal ( context , { } ) ; } ) ; } ) ; } } }