generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29: Add resource bundle key resolution logic to inspection EP tag fo…
…lding
- Loading branch information
Showing
18 changed files
with
344 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/java/com/picimako/justkitting/ContentRootsBasedJustKittingTestBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//Copyright 2023 Tamás Balog. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
package com.picimako.justkitting; | ||
|
||
import com.intellij.testFramework.LightProjectDescriptor; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Base class for tests that need to leverage main/ and test/ sources and resources folders in test data. | ||
*/ | ||
public abstract class ContentRootsBasedJustKittingTestBase extends JustKittingTestBase { | ||
|
||
@NotNull | ||
@Override | ||
protected LightProjectDescriptor getProjectDescriptor() { | ||
return new ContentRootsProjectDescriptor(); | ||
} | ||
|
||
@Override | ||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
myFixture.copyDirectoryToProject("src", ""); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/test/java/com/picimako/justkitting/ContentRootsProjectDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//Copyright 2023 Tamás Balog. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
|
||
package com.picimako.justkitting; | ||
|
||
import com.intellij.openapi.module.Module; | ||
import com.intellij.openapi.projectRoots.JavaSdk; | ||
import com.intellij.openapi.projectRoots.Sdk; | ||
import com.intellij.openapi.roots.ContentEntry; | ||
import com.intellij.openapi.roots.ModifiableRootModel; | ||
import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.jps.model.java.JavaResourceRootType; | ||
|
||
/** | ||
* Project descriptor that loads main/ and test/ sources and resources folders. | ||
*/ | ||
public class ContentRootsProjectDescriptor extends DefaultLightProjectDescriptor { | ||
|
||
@Override | ||
public Sdk getSdk() { | ||
return JavaSdk.getInstance().createJdk("Real JDK", System.getenv("JAVA_HOME"), false); | ||
} | ||
|
||
@Override | ||
public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { | ||
super.configureModule(module, model, contentEntry); | ||
|
||
contentEntry.clearSourceFolders(); | ||
|
||
String contentEntryUrl = contentEntry.getUrl(); | ||
// contentEntry.addSourceFolder(contentEntryUrl + "/main/java", JavaSourceRootType.SOURCE); | ||
contentEntry.addSourceFolder(contentEntryUrl + "/main/resources", JavaResourceRootType.RESOURCE); | ||
// contentEntry.addSourceFolder(contentEntryUrl + "/test/java", JavaSourceRootType.TEST_SOURCE); | ||
// contentEntry.addSourceFolder(contentEntryUrl + "/test/resources", JavaResourceRootType.TEST_RESOURCE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...java/com/picimako/justkitting/codefolding/ContentRootsJustKittingCodeFoldingTestBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2023 Tamás Balog. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
|
||
package com.picimako.justkitting.codefolding; | ||
|
||
import com.picimako.justkitting.ContentRootsBasedJustKittingTestBase; | ||
|
||
/** | ||
* Base class for testing code folding. | ||
*/ | ||
public abstract class ContentRootsJustKittingCodeFoldingTestBase extends ContentRootsBasedJustKittingTestBase { | ||
|
||
protected void doXmlTestFolding(String filePath) { | ||
myFixture.configureByFile(filePath); | ||
myFixture.testFoldingWithCollapseStatus(getTestDataPath() + "/" + filePath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.