-
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.
* [Refactor] Memory optimizing with OOP Refactoring (#11) * [Refactor] Apply Flyweight Pattern for UI Memory Optimization - Components in EditorPanel uses same instance, such as `JLabel` and `JBorder` - These components are immutable objects, so by creating one and sharing it, we can save memory. - So, I apply Flyweight pattern * [Refactor] Seperate Component with responsibility - according to Single Responsibility Principle in `Object Oriented Programming Principles`, They must have only their responsibility. - so seperate responsibility and Use IOC&DI with interface * [Feat] Add `remove all action` * [Refactor] Remove ToolbarPanel Dependency in mainViewPanel In mainView, toolbarPanel is not neccessary. so remove it. * [Refactor] Change ThreadStore's Creational Patterns, Singleton to Normal Object for making tests easier * [Refactor] Restructure to Enable DI in ToolWindowFactory and Remove Singleton Pattern * [Test] Add Action Tests - AddTest - RemoveAllTest - RemoveTest - RunAllTest - RunTest - StopAllTest * [Refactor] Remove dependencies each editor components from EditorPanel using interface and abstract class * [Test] Adding EditorPanel tests * [Test] Adding MyTestList tests * [Refactor] Remove dependencies subTestList from TestListPanel using interface and abstract class * [Test] Adding TestListPanel tests * [Test] Adding MainView tests --------- Signed-off-by: Hyeon-Uk <[email protected]>
- Loading branch information
Showing
60 changed files
with
2,582 additions
and
519 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,63 @@ | ||
plugins { | ||
id("java") | ||
id("org.jetbrains.kotlin.jvm") version "1.9.0" | ||
id("org.jetbrains.intellij") version "1.15.0" | ||
id("java") | ||
id("org.jetbrains.kotlin.jvm") version "1.9.0" | ||
id("org.jetbrains.intellij") version "1.15.0" | ||
} | ||
|
||
group = "com.example" | ||
version = "1.0.2" | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
// Configure Gradle IntelliJ Plugin | ||
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html | ||
intellij { | ||
version.set("2022.2.5") | ||
type.set("IC") // Target IDE Platform | ||
version.set("2022.2.5") | ||
type.set("IC") // Target IDE Platform | ||
|
||
plugins.set(listOf("com.intellij.java","org.jetbrains.plugins.terminal")) | ||
plugins.set(listOf("com.intellij.java", "org.jetbrains.plugins.terminal")) | ||
} | ||
|
||
dependencies{ | ||
dependencies { | ||
// implementation("junit:junit:4.13.2") | ||
// testImplementation("junit:junit:4.13.2") | ||
// testImplementation("org.mockito:mockito-core:3.4.6") | ||
// testImplementation("org.powermock:powermock-module-junit4:2.0.9") | ||
// testImplementation("org.powermock:powermock-api-mockito2:2.0.9") | ||
testImplementation("org.mockito:mockito-junit-jupiter:5.8.0") | ||
testImplementation("org.junit.jupiter:junit-jupiter:5.8.1") | ||
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.2") | ||
testImplementation("org.mockito:mockito-junit-jupiter:5.8.0") | ||
testImplementation("org.junit.jupiter:junit-jupiter:5.8.1") | ||
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.2") | ||
// https://mvnrepository.com/artifact/org.mockito/mockito-inline | ||
testImplementation("org.mockito:mockito-inline:5.2.0") | ||
} | ||
|
||
tasks { | ||
// Set the JVM compatibility versions | ||
withType<JavaCompile> { | ||
sourceCompatibility = "17" | ||
targetCompatibility = "17" | ||
} | ||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions.jvmTarget = "17" | ||
} | ||
|
||
patchPluginXml { | ||
sinceBuild.set("222") | ||
untilBuild.set("232.*") | ||
} | ||
|
||
signPlugin { | ||
certificateChain.set(System.getenv("CERTIFICATE_CHAIN")) | ||
privateKey.set(System.getenv("PRIVATE_KEY")) | ||
password.set(System.getenv("PRIVATE_KEY_PASSWORD")) | ||
} | ||
|
||
publishPlugin { | ||
token.set(System.getenv("PUBLISH_TOKEN")) | ||
} | ||
test { | ||
useJUnitPlatform() | ||
} | ||
// Set the JVM compatibility versions | ||
withType<JavaCompile> { | ||
sourceCompatibility = "17" | ||
targetCompatibility = "17" | ||
} | ||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions.jvmTarget = "17" | ||
} | ||
|
||
patchPluginXml { | ||
sinceBuild.set("222") | ||
untilBuild.set("232.*") | ||
} | ||
|
||
signPlugin { | ||
certificateChain.set(System.getenv("CERTIFICATE_CHAIN")) | ||
privateKey.set(System.getenv("PRIVATE_KEY")) | ||
password.set(System.getenv("PRIVATE_KEY_PASSWORD")) | ||
} | ||
|
||
publishPlugin { | ||
token.set(System.getenv("PUBLISH_TOKEN")) | ||
} | ||
test { | ||
useJUnitPlatform() | ||
} | ||
} |
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
41 changes: 41 additions & 0 deletions
41
src/main/java/com/example/pssupporter/actions/MyRemoveAllTestAction.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,41 @@ | ||
/* | ||
* Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package com.example.pssupporter.actions; | ||
|
||
import com.example.pssupporter.ui.editor.EditorPanel; | ||
import com.example.pssupporter.ui.list.TestListPanel; | ||
import com.example.pssupporter.utils.thread.MyThreadStore; | ||
import com.example.pssupporter.utils.thread.vo.ThreadGroupName; | ||
import com.intellij.icons.AllIcons; | ||
import com.intellij.openapi.actionSystem.AnAction; | ||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class MyRemoveAllTestAction extends AnAction { | ||
private final TestListPanel myTestListPanel; | ||
private final EditorPanel myEditorPanel; | ||
private final MyThreadStore myThreadStore; | ||
|
||
public MyRemoveAllTestAction(TestListPanel myTestListPanel, EditorPanel myEditorPanel, MyThreadStore myThreadStore) { | ||
super("Remove All Test DataSets", "This action can remove all test data sets", AllIcons.Actions.GC); | ||
this.myTestListPanel = myTestListPanel; | ||
this.myEditorPanel = myEditorPanel; | ||
this.myThreadStore = myThreadStore; | ||
} | ||
|
||
@Override | ||
public void update(@NotNull AnActionEvent e) { | ||
super.update(e); | ||
boolean isRunning = myThreadStore | ||
.hasRunningThreads(ThreadGroupName.TEST_RUNNING); | ||
e.getPresentation().setEnabled(!isRunning); | ||
} | ||
|
||
@Override | ||
public void actionPerformed(@NotNull AnActionEvent e) { | ||
myEditorPanel.clearAll(); | ||
myTestListPanel.removeAllTestDatas(); | ||
} | ||
} |
Oops, something went wrong.