Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
uses: jlumbroso/free-disk-space@v2
with:
tool-cache: false
large-packages: false
Expand All @@ -50,11 +50,11 @@ jobs:

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
uses: gradle/actions/wrapper-validation@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
uses: jlumbroso/free-disk-space@v2
with:
tool-cache: false
large-packages: false
Expand All @@ -121,7 +121,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 17
Expand All @@ -144,7 +144,7 @@ jobs:

# Upload the Kover report to CodeCov
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ${{ github.workspace }}/build/reports/kover/report.xml

Expand All @@ -158,7 +158,7 @@ jobs:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
uses: jlumbroso/free-disk-space@v2
with:
tool-cache: false
large-packages: false
Expand All @@ -169,7 +169,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 17
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4

# Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
uses: jlumbroso/free-disk-space@v2
with:
tool-cache: false
large-packages: false
Expand All @@ -33,7 +33,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 17
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,26 @@ jobs:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4

# Setup Java 11 environment for the next steps
# Setup Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 11
cache: gradle
java-version: 17

# Run IDEA prepared for UI testing
- name: Run IDE
run: ${{ matrix.runIde }}

# Wait for IDEA to be started
- name: Health Check
uses: jtalk/url-health-check-action@v2
uses: jtalk/url-health-check-action@v3
with:
url: http://127.0.0.1:8082
max-attempts: 15
retry-delay: 30s
retry-delay: 30

# Run tests
- name: Tests
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
.qodana
build
local
.intellijPlatform
.kotlin
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
intellijPlatform {
pluginConfiguration {
ideaVersion {
sinceBuild = "242.*"
sinceBuild = "242"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<id>com.github.serverfrog.bitburnerplugin</id>
<name>Bitburner-Connector</name>
<vendor>Serverfrog</vendor>
<description>IntelliJ plugin for Bitburner game integration, enabling file synchronization and project actions.</description>

<depends>com.intellij.modules.platform</depends>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package com.github.serverfrog.bitburnerplugin.action

import com.intellij.openapi.actionSystem.AnAction
import org.junit.Before
import org.junit.Test
import org.junit.Assert.*

class BitburnerActionGroupTest {

private lateinit var actionGroup: BitburnerActionGroup

@Before
fun setUp() {
actionGroup = BitburnerActionGroup()
}

@Test
fun testExtensionsContainsSupportedFiles() {
assertTrue("js should be supported", extensions.contains("js"))
assertTrue("script should be supported", extensions.contains("script"))
assertTrue("ns should be supported", extensions.contains("ns"))
assertTrue("txt should be supported", extensions.contains("txt"))
}

@Test
fun testExtensionsDoesNotContainUnsupportedFiles() {
assertFalse("java should not be supported", extensions.contains("java"))
assertFalse("py should not be supported", extensions.contains("py"))
assertFalse("kt should not be supported", extensions.contains("kt"))
}

@Test
fun testGetChildrenReturnsEmptyForNullEvent() {
// Act
val actions = actionGroup.getChildren(null)

// Assert
assertEquals(0, actions.size)
}

@Test
fun testAppendAddsElementToArray() {
// Arrange
val emptyArray = emptyArray<AnAction>()
val action = BitburnerPushAction()

// Act
val result = actionGroup.append(emptyArray, action)

// Assert
assertEquals(1, result.size)
assertTrue(result[0] is BitburnerPushAction)
}

@Test
fun testAppendToNonEmptyArray() {
// Arrange
val existing: Array<AnAction> = arrayOf(BitburnerPushAction())
val action = BitburnerPushAction()

// Act
val result = actionGroup.append(existing, action)

// Assert
assertEquals(2, result.size)
}

@Test
fun testActionGroupInstantiation() {
// Act
val group = BitburnerActionGroup()

// Assert
assertNotNull(group)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.github.serverfrog.bitburnerplugin.action

import org.junit.Test
import org.junit.Assert.*

class BitburnerPushActionTest {

@Test
fun testPushActionInstantiation() {
// Act
val action = BitburnerPushAction()

// Assert
assertNotNull(action)
}

@Test
fun testPushActionHasTemplatePresentation() {
// Act
val action = BitburnerPushAction()

// Assert
assertNotNull(action.templatePresentation)
}

@Test
fun testPushActionTemplateName() {
// Act
val action = BitburnerPushAction()

// Assert - the action should have a non-null template presentation text
assertNotNull(action.templatePresentation.text)
}
}
Loading
Loading