/*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@Test
public void environmentPassing() throws Exception {
- Map<String, String> testEnv = new HashMap<String, String>();
+ Map<String, String> testEnv = new HashMap<>();
testEnv.put("VALUE_1", "some value");
testEnv.put("VALUE_2", "another\n\"value\"");
public void unicodeEnvironment() throws Exception {
assumeTrue("UTF-8".equals(System.getProperty("file.encoding")));
- Map<String, String> testEnv = new HashMap<String, String>();
- testEnv.put("VALUE_1", UNICODE_RU);
- testEnv.put("VALUE_2", UNICODE_EU);
-
+ Map<String, String> testEnv = newHashMap(pair("VALUE_1", UNICODE_RU), pair("VALUE_2", UNICODE_EU));
Pair<GeneralCommandLine, File> command = makeHelperCommand(null, CommandTestHelper.ENV);
checkEnvPassing(command, testEnv, true);
checkEnvPassing(command, testEnv, false);
}
Map<String, String> parentEnv = System.getenv();
- List<String> missed = new ArrayList<String>();
+ List<String> missed = new ArrayList<>();
for (Map.Entry<String, String> entry : parentEnv.entrySet()) {
String str = CommandTestHelper.format(entry);
if (!lines.contains(str)) {
/*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
assertNotNull(vFile);
assertWritable(file, vFile, true);
- ApplicationManager.getApplication().runWriteAction(new ThrowableComputable<Object, IOException>() {
- @Override
- public Object compute() throws IOException {
- vFile.setWritable(false);
- return null;
- }
+ ApplicationManager.getApplication().runWriteAction((ThrowableComputable<Object, IOException>)() -> {
+ vFile.setWritable(false);
+ return null;
});
assertWritable(file, vFile, false);
vFile.refresh(false, false);
assertWritable(file, vFile, false);
- ApplicationManager.getApplication().runWriteAction(new ThrowableComputable<Object, IOException>() {
- @Override
- public Object compute() throws IOException {
- vFile.setWritable(true);
- return null;
- }
+ ApplicationManager.getApplication().runWriteAction((ThrowableComputable<Object, IOException>)() -> {
+ vFile.setWritable(true);
+ return null;
});
assertWritable(file, vFile, true);
vFile.refresh(false, false);