/*********************************************************************
 * Copyright (c) 2020 Red Hat, Inc.
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 **********************************************************************/ import { CLASSES } from '../../inversify.types' ; import 'reflect-metadata' ; import { LanguageServerTests } from '../../testsLibrary/LanguageServerTests' ; import { e2eContainer } from '../../inversify.config' ; import { CodeExecutionTests } from '../../testsLibrary/CodeExecutionTests' ; import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests' ; import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests' ; import CheReporter from '../../driver/CheReporter' ; const workspaceHandlingTests = e2eContainer . get ( CLASSES . WorkspaceHandlingTests ) ; const projectAndFileTests = e2eContainer . get ( CLASSES . ProjectAndFileTests ) ; const commonLanguageServerTests = e2eContainer . get ( CLASSES . LanguageServerTests ) ; const codeExecutionTests = e2eContainer . get ( CLASSES . CodeExecutionTests ) ; const workspaceStack = 'Quarkus CLI' ; const workspaceSampleName = 'quarkus-quickstarts' ; const workspaceRootFolderName = 'getting-started-command-mode' ; const fileFolderPath = `${ workspaceSampleName }/${ workspaceRootFolderName }/src/main/java/org/acme/getting/started/commandmode` ; const fileName = `GreetingService.java` ; const taskPackage = 'Package' ; const taskPackageNative = 'Package Native' ; const taskStartNative = 'Start Native' ; let workspaceName ; suite ( `${ workspaceStack } test` , async ( ) => { suite ( `Create ${ workspaceStack }` , async ( ) => { workspaceHandlingTests . createAndOpenWorkspace ( workspaceStack ) ; test ( 'Register running workspace' , async ( ) => { workspaceName = WorkspaceHandlingTests . getWorkspaceName ( ) ; CheReporter . registerRunningWorkspace ( workspaceName ) ; } ) ; projectAndFileTests . waitWorkspaceReadiness ( workspaceSampleName , workspaceRootFolderName , false ) ; } ) ; suite ( `Test opening the file` , async ( ) => { projectAndFileTests . openFile ( fileFolderPath , fileName ) ; } ) ; suite ( 'Package Quarkus application' , async ( ) => { codeExecutionTests . runTask ( taskPackage , 180000 ) ; codeExecutionTests . closeTerminal ( taskPackage ) ; } ) ; suite ( 'Package Quarkus Native bundle' , async ( ) => { codeExecutionTests . runTask ( taskPackageNative , 600000 ) ; codeExecutionTests . closeTerminal ( taskPackageNative ) ; } ) ; suite . skip ( 'Start Quarkus Native application' , async ( ) => { codeExecutionTests . runTaskInputText ( taskStartNative , 'Enter your name' , 'Test User' , 90000 ) ; } ) ; suite ( `'Language server validation'` , async ( ) => { commonLanguageServerTests . errorHighlighting ( fileName , 'error_text;' , 7 ) ; commonLanguageServerTests . suggestionInvoking ( fileName , 8 , 33 , 'String' ) ; commonLanguageServerTests . autocomplete ( fileName , 8 , 33 , 'String' ) ; commonLanguageServerTests . goToImplementations ( fileName , 8 , 33 , 'String.class' , 30000 ) ; } ) ; suite ( 'Stop and remove workspace' , async ( ) => { test ( `Stop and remowe workspace` , async ( ) => { await workspaceHandlingTests . stopAndRemoveWorkspace ( workspaceName ) ; } ) ; } ) ; } ) ;