-
Notifications
You must be signed in to change notification settings - Fork 528
Expand file tree
/
Copy pathextension.test.ts
More file actions
42 lines (39 loc) · 1.5 KB
/
extension.test.ts
File metadata and controls
42 lines (39 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import * as assert from 'assert';
import * as vscode from 'vscode';
import { extensions } from 'vscode';
import { Commands } from '../../src/commands';
import { getJavaConfiguration } from '../../src/utils';
suite('Java Language Extension - LightWeight', () => {
suiteSetup(async function() {
getJavaConfiguration().update('server.launchMode', 'LightWeight');
await extensions.getExtension('redhat.java').activate();
});
test('should register syntax-only java commands', () => {
return vscode.commands.getCommands(true).then((commands) =>
{
const JAVA_COMMANDS = [
Commands.EXECUTE_WORKSPACE_COMMAND,
Commands.OPEN_SERVER_LOG,
Commands.OPEN_SERVER_STDOUT_LOG,
Commands.OPEN_SERVER_STDERR_LOG,
Commands.OPEN_CLIENT_LOG,
Commands.OPEN_LOGS,
Commands.OPEN_FORMATTER,
Commands.CLEAN_WORKSPACE,
Commands.SWITCH_SERVER_MODE,
Commands.OPEN_FILE,
Commands.CLEAN_SHARED_INDEXES,
Commands.RESTART_INTELLISENSE_FOR_ACTIVE_FILE,
Commands.RESTART_LANGUAGE_SERVER,
Commands.FILESEXPLORER_ONPASTE,
Commands.CHANGE_JAVA_SEARCH_SCOPE,
Commands.OPEN_JAVA_DASHBOARD,
Commands.ADD_JAVA_RUNTIME
].sort();
const foundJavaCommands = commands.filter((value) => {
return JAVA_COMMANDS.indexOf(value)>=0 || value.startsWith('java.');
}).sort();
assert.deepEqual(foundJavaCommands, JAVA_COMMANDS, `Some Java commands are not registered properly or a new command is not added to the test.\nActual: ${foundJavaCommands}\nExpected: ${JAVA_COMMANDS}`);
});
});
});