@@ -26,11 +26,11 @@ import * as assert from 'assert';
2626import * as fs from 'fs' ;
2727import * as path from 'path' ;
2828import * as vscode from 'vscode' ;
29- import * as myExtension from '../../../extension' ;
3029import * as myExplorer from '../../../explorer' ;
3130import { CodeAction , commands , extensions , Selection , Uri , window , workspace , TreeItem } from 'vscode' ;
32- import { assertWorkspace , dumpJava , getFilePaths , openFile , prepareProject , replaceCode } from '../../testutils' ;
31+ import { assertWorkspace , awaitClient , dumpJava , findClusters , getFilePaths , openFile , prepareProject , replaceCode } from '../../testutils' ;
3332import { FORMATTED_POM_XML , SAMPLE_CODE_FORMAT_DOCUMENT , SAMPLE_CODE_SORT_IMPORTS , SAMPLE_CODE_UNUSED_IMPORTS } from '../../constants' ;
33+ import { extConstants } from '../../../constants' ;
3434
3535suite ( 'Extension Test Suite' , function ( ) {
3636 window . showInformationMessage ( 'Start all tests.' ) ;
@@ -67,7 +67,7 @@ suite('Extension Test Suite', function () {
6767 assert ( nbcode ) ;
6868
6969 const extraCluster = path . join ( nbcode . extensionPath , "nbcode" , "extra" ) ;
70- let clusters = myExtension . findClusters ( 'non-existent' ) .
70+ let clusters = findClusters ( 'non-existent' ) .
7171 // ignore 'extra' cluster in the extension path, since nbjavac is there during development:
7272 filter ( s => ! s . startsWith ( extraCluster ) ) ;
7373
@@ -166,7 +166,7 @@ suite('Extension Test Suite', function () {
166166 if ( refactorActions && refactorActions . length > 0 ) {
167167 for await ( const action of refactorActions ) {
168168 if ( action . command && action . command . arguments ) {
169- if ( action . command . command === myExtension . COMMAND_PREFIX + ".surround.with" ) {
169+ if ( action . command . command === extConstants . COMMAND_PREFIX + ".surround.with" ) {
170170 //this action has a popup where the user needs to
171171 //select a template that should be used for the surround:
172172 continue ;
@@ -197,7 +197,7 @@ suite('Extension Test Suite', function () {
197197 assert . strictEqual ( tests [ 1 ] . tests [ 0 ] . name , 'testTrue' , `Invalid test name returned` ) ;
198198
199199 console . log ( "Test: run all workspace tests" ) ;
200- await vscode . commands . executeCommand ( myExtension . COMMAND_PREFIX + '.run.test' , workspaceFolder . uri . toString ( ) ) ;
200+ await vscode . commands . executeCommand ( extConstants . COMMAND_PREFIX + '.run.test' , workspaceFolder . uri . toString ( ) ) ;
201201 console . log ( `Test: run all workspace tests finished` ) ;
202202 } catch ( error ) {
203203 dumpJava ( ) ;
@@ -215,7 +215,7 @@ suite('Extension Test Suite', function () {
215215 const mainClass = path . join ( folder , 'target' , 'classes' , 'pkg' , 'Main.class' ) ;
216216 assert . ok ( fs . statSync ( mainClass ) . isFile ( ) , "Class created by compilation: " + mainClass ) ;
217217
218- myExplorer . createViewProvider ( await myExtension . awaitClient ( ) , "foundProjects" ) . then ( async ( lvp ) => {
218+ myExplorer . createViewProvider ( await awaitClient ( ) , "foundProjects" ) . then ( async ( lvp ) => {
219219 const firstLevelChildren = await ( lvp . getChildren ( ) as Thenable < any [ ] > ) ;
220220 assert . strictEqual ( firstLevelChildren . length , 1 , "One child under the root" ) ;
221221 const item = await ( lvp . getTreeItem ( firstLevelChildren [ 0 ] ) as Thenable < TreeItem > ) ;
0 commit comments