diff --git a/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java b/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java index 0609009dbf81..4305c37547e5 100644 --- a/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java +++ b/java/compiler/impl/testSrc/com/intellij/compiler/BaseCompilerTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -335,6 +335,7 @@ public abstract class BaseCompilerTestCase extends ModuleTestCase { return iprFile; } + @NotNull @Override protected Module doCreateRealModule(String moduleName) { //todo[nik] reuse code from PlatformTestCase diff --git a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceFieldWitSetUpInitializationTest.java b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceFieldWitSetUpInitializationTest.java index f2b71328a349..f35843479b31 100644 --- a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceFieldWitSetUpInitializationTest.java +++ b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceFieldWitSetUpInitializationTest.java @@ -1,5 +1,17 @@ /* - * Copyright (c) 2000-2007 JetBrains s.r.o. All Rights Reserved. + * Copyright 2000-2017 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /* @@ -21,6 +33,7 @@ import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.introduceField.BaseExpressionToFieldHandler; import com.intellij.refactoring.introduceField.LocalToFieldHandler; import com.intellij.util.PathUtil; +import org.jetbrains.annotations.NotNull; import org.junit.Before; import java.io.File; @@ -31,6 +44,7 @@ public class IntroduceFieldWitSetUpInitializationTest extends CodeInsightTestCas return JavaTestUtil.getJavaTestDataPath(); } + @NotNull @Override protected Module createModule(final String name) { final Module module = super.createModule(name); diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java index 057fa9cbc951..756a9593decd 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -325,25 +325,29 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro }.execute().throwException(); } + @NotNull protected Module createMainModule() throws IOException { return createModule(myProject.getName()); } + @NotNull protected Module createModule(@NonNls final String moduleName) { return doCreateRealModule(moduleName); } + @NotNull protected Module doCreateRealModule(final String moduleName) { return doCreateRealModuleIn(moduleName, myProject, getModuleType()); } + @NotNull protected static Module doCreateRealModuleIn(String moduleName, final Project project, final ModuleType moduleType) { final VirtualFile baseDir = project.getBaseDir(); assertNotNull(baseDir); - String path = baseDir.getPath(); - return createModuleAt(moduleName, project, moduleType, path); + return createModuleAt(moduleName, project, moduleType, baseDir.getPath()); } + @NotNull protected static Module createModuleAt(String moduleName, Project project, ModuleType moduleType, String path) { File moduleFile = new File(FileUtil.toSystemDependentName(path), moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION); FileUtil.createIfDoesntExist(moduleFile); diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/Eclipse2ModulesTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/Eclipse2ModulesTest.java index f2b6ca4904d9..bd6dce66a6ca 100644 --- a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/Eclipse2ModulesTest.java +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/Eclipse2ModulesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -55,6 +55,7 @@ public abstract class Eclipse2ModulesTest extends IdeaTestCase { copyDirContentsTo(vTestRoot, getProject().getBaseDir()); } + @NotNull @Override protected Module createMainModule() { return createModule(DEPEND_MODULE_NAME);