Skip to content

Commit

Permalink
Merge branch 'private-release/v1.1.0-221' into zowe-release/v1.1.0-221
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzianis Lisiankou authored and dnlsv committed Sep 18, 2023
2 parents f429d43 + 4de35a9 commit d369f0b
Show file tree
Hide file tree
Showing 24 changed files with 610 additions and 702 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ buildscript {
plugins {
id("org.sonarqube") version "3.3"
id("org.jetbrains.intellij") version "1.14.2"
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.8.10"
java
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}
Expand All @@ -32,10 +32,10 @@ apply(plugin = "org.jetbrains.intellij")
apply(from = "gradle/sonar.gradle")

group = "org.zowe"
version = "1.1.0-221"
val remoteRobotVersion = "0.11.18"
version = "1.1.1-221"
val remoteRobotVersion = "0.11.19"
val okHttp3Version = "4.10.0"
val kotestVersion = "5.5.5"
val kotestVersion = "5.6.2"

repositories {
mavenCentral()
Expand Down Expand Up @@ -71,7 +71,7 @@ dependencies {
implementation("org.jgrapht:jgrapht-core:1.5.1")
implementation("com.starxg:java-keytar:1.0.0")
implementation("org.zowe.sdk:zowe-kotlin-sdk:0.4.0")
implementation("com.ibm.mq:com.ibm.mq.allclient:9.3.0.0")
implementation("com.ibm.mq:com.ibm.mq.allclient:9.3.3.0")
testImplementation("io.mockk:mockk:1.13.5")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,18 @@ Thank you for considering IBA Group for your mainframe needs.

<applicationService serviceInterface="org.zowe.explorer.config.connect.CredentialService"
serviceImplementation="org.zowe.explorer.config.connect.CredentialServiceImpl"
testServiceImplementation="org.zowe.explorer.testServiceImpl.TestCredentialsServiceImpl"/>
testServiceImplementation="org.zowe.explorer.testutils.testServiceImpl.TestCredentialsServiceImpl"/>

<applicationService serviceInterface="org.zowe.explorer.config.ConfigSandbox"
serviceImplementation="org.zowe.explorer.config.ConfigSandboxImpl"/>

<applicationService serviceInterface="org.zowe.explorer.dataops.DataOpsManager" preload="true"
serviceImplementation="org.zowe.explorer.dataops.DataOpsManagerImpl"
testServiceImplementation="org.zowe.explorer.testServiceImpl.TestDataOpsManagerImpl"/>
testServiceImplementation="org.zowe.explorer.testutils.testServiceImpl.TestDataOpsManagerImpl"/>

<applicationService serviceInterface="org.zowe.explorer.api.ZosmfApi"
serviceImplementation="org.zowe.explorer.api.ZosmfApiImpl"
testServiceImplementation="org.zowe.explorer.testServiceImpl.TestZosmfApiImpl"/>
testServiceImplementation="org.zowe.explorer.testutils.testServiceImpl.TestZosmfApiImpl"/>

<applicationService serviceInterface="org.zowe.explorer.explorer.UIComponentManager"
serviceImplementation="org.zowe.explorer.explorer.UIComponentManagerImpl"/>
Expand Down
59 changes: 20 additions & 39 deletions src/test/kotlin/org/zowe/explorer/config/ConfigTestSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@ package org.zowe.explorer.config

import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl
import io.kotest.assertions.assertSoftly
import io.kotest.core.spec.style.ShouldSpec
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.zowe.explorer.config.connect.ConnectionConfig
import org.zowe.explorer.config.connect.Credentials
import org.zowe.explorer.config.connect.CredentialsConfigDeclaration
Expand All @@ -42,29 +29,27 @@ import org.zowe.explorer.dataops.operations.TsoOperation
import org.zowe.explorer.dataops.operations.TsoOperationMode
import org.zowe.explorer.explorer.Explorer
import org.zowe.explorer.explorer.WorkingSet
import org.zowe.explorer.testServiceImpl.TestDataOpsManagerImpl
import org.zowe.explorer.testutils.WithApplicationShouldSpec
import org.zowe.explorer.testutils.testServiceImpl.TestDataOpsManagerImpl
import org.zowe.explorer.ui.build.tso.TSOWindowFactory
import org.zowe.explorer.utils.crudable.Crudable
import org.zowe.explorer.utils.service
import io.kotest.assertions.assertSoftly
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.zowe.kotlinsdk.MessageType
import org.zowe.kotlinsdk.TsoData
import org.zowe.kotlinsdk.TsoResponse
import org.zowe.kotlinsdk.annotations.ZVersion
import kotlin.reflect.KFunction

class ConfigTestSpec : ShouldSpec({
beforeSpec {
// FIXTURE SETUP TO HAVE ACCESS TO APPLICATION INSTANCE
val factory = IdeaTestFixtureFactory.getFixtureFactory()
val projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR
val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor, "for-mainframe")
val fixture = fixtureBuilder.fixture
val myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(
fixture,
LightTempDirTestFixtureImpl(true)
)
myFixture.setUp()
}
class ConfigTestSpec : WithApplicationShouldSpec({
afterSpec {
clearAllMocks()
}
Expand All @@ -76,12 +61,12 @@ class ConfigTestSpec : ShouldSpec({

fun mockConfigService() {
val mockConfigServiceInstance = mockk<ConfigService>()
every { mockConfigServiceInstance.getConfigDeclaration(ConnectionConfig::class.java) } returns ZOSMFConnectionConfigDeclaration(
crudable
)
every { mockConfigServiceInstance.getConfigDeclaration(Credentials::class.java) } returns CredentialsConfigDeclaration(
crudable
)
every {
mockConfigServiceInstance.getConfigDeclaration(ConnectionConfig::class.java)
} returns ZOSMFConnectionConfigDeclaration(crudable)
every {
mockConfigServiceInstance.getConfigDeclaration(Credentials::class.java)
} returns CredentialsConfigDeclaration(crudable)

mockkObject(ConfigService)
every { ConfigService.instance } returns mockConfigServiceInstance
Expand Down Expand Up @@ -292,18 +277,14 @@ class ConfigTestSpec : ShouldSpec({
// getOwner
should("get owner by connection config when owner is not empty") {
val owner = getOwner(
ConnectionConfig(
"", "", "", true, ZVersion.ZOS_2_3, null, "ZOSMFAD"
)
ConnectionConfig("", "", "", true, ZVersion.ZOS_2_3, null, "ZOSMFAD")
)

assertSoftly { owner shouldBe "ZOSMFAD" }
}
should("get owner by connection config when owner is empty") {
val owner = getOwner(
ConnectionConfig(
"", "", "", true, ZVersion.ZOS_2_3, null, ""
)
ConnectionConfig("", "", "", true, ZVersion.ZOS_2_3, null, "")
)

assertSoftly { owner shouldBe "ZOSMF" }
Expand Down
42 changes: 20 additions & 22 deletions src/test/kotlin/org/zowe/explorer/dataops/OperationsTestSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,43 @@ import com.intellij.openapi.fileEditor.impl.LoadTextUtil
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl
import org.zowe.explorer.api.ZosmfApi
import org.zowe.explorer.config.connect.ConnectionConfig
import org.zowe.explorer.config.ws.DSMask
import org.zowe.explorer.dataops.attributes.*
import org.zowe.explorer.dataops.attributes.FileAttributes
import org.zowe.explorer.dataops.attributes.MFRemoteFileAttributes
import org.zowe.explorer.dataops.attributes.MaskedRequester
import org.zowe.explorer.dataops.attributes.RemoteDatasetAttributes
import org.zowe.explorer.dataops.attributes.RemoteDatasetAttributesService
import org.zowe.explorer.dataops.attributes.RemoteMemberAttributes
import org.zowe.explorer.dataops.attributes.RemoteUssAttributes
import org.zowe.explorer.dataops.attributes.Requester
import org.zowe.explorer.dataops.attributes.UssRequester
import org.zowe.explorer.dataops.content.synchronizer.ContentSynchronizer
import org.zowe.explorer.dataops.content.synchronizer.DocumentedSyncProvider
import org.zowe.explorer.dataops.content.synchronizer.LF_LINE_SEPARATOR
import org.zowe.explorer.dataops.operations.DeleteOperation
import org.zowe.explorer.dataops.operations.mover.CrossSystemMemberOrUssFileOrSequentialToUssDirMover
import org.zowe.explorer.dataops.operations.mover.MoveCopyOperation
import org.zowe.explorer.dataops.operations.mover.RemoteToLocalFileMover
import org.zowe.explorer.testServiceImpl.TestDataOpsManagerImpl
import org.zowe.explorer.testServiceImpl.TestZosmfApiImpl
import org.zowe.explorer.testutils.WithApplicationShouldSpec
import org.zowe.explorer.testutils.testServiceImpl.TestDataOpsManagerImpl
import org.zowe.explorer.testutils.testServiceImpl.TestZosmfApiImpl
import org.zowe.explorer.utils.castOrNull
import org.zowe.explorer.utils.changeFileEncodingTo
import org.zowe.explorer.utils.service
import org.zowe.explorer.utils.setUssFileTag
import org.zowe.explorer.vfs.MFVirtualFile
import io.kotest.assertions.assertSoftly
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.ShouldSpec
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldContain
import io.mockk.*
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
import io.mockk.mockkStatic
import io.mockk.spyk
import io.mockk.unmockkAll
import org.zowe.kotlinsdk.DataAPI
import org.zowe.kotlinsdk.FilePath
import org.zowe.kotlinsdk.XIBMDataType
Expand All @@ -61,7 +71,7 @@ inline fun mockkRequesters(
every { attributes.requesters } returns mutableListOf(connectionConfigToRequester(connection))
}

inline fun <reified S: FileAttributes, reified D: MFRemoteFileAttributes<*, *>> prepareBareOperation(
inline fun <reified S : FileAttributes, reified D : MFRemoteFileAttributes<*, *>> prepareBareOperation(
isCrossystem: Boolean = false,
sourceConnectionConfigToRequester: (ConnectionConfig) -> Requester<*>,
destConnectionConfigToRequester: (ConnectionConfig) -> Requester<*>
Expand All @@ -83,19 +93,7 @@ inline fun <reified S: FileAttributes, reified D: MFRemoteFileAttributes<*, *>>
)
}

class OperationsTestSpec : ShouldSpec({
beforeSpec {
// FIXTURE SETUP TO HAVE ACCESS TO APPLICATION INSTANCE
val factory = IdeaTestFixtureFactory.getFixtureFactory()
val projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR
val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor, "for-mainframe")
val fixture = fixtureBuilder.fixture
val myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(
fixture,
LightTempDirTestFixtureImpl(true)
)
myFixture.setUp()
}
class OperationsTestSpec : WithApplicationShouldSpec({
afterSpec {
clearAllMocks()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,18 @@ import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.project.Project
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl
import org.zowe.explorer.dataops.content.synchronizer.SyncToolbarProvider
import org.zowe.explorer.testutils.WithApplicationShouldSpec
import io.kotest.assertions.assertSoftly
import io.kotest.core.spec.style.ShouldSpec
import io.kotest.matchers.shouldBe
import io.mockk.*
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
import io.mockk.mockkStatic
import io.mockk.spyk
import io.mockk.unmockkAll

class SyncToolbarProviderTestSpec : ShouldSpec({
beforeSpec {
// FIXTURE SETUP TO HAVE ACCESS TO APPLICATION INSTANCE
val factory = IdeaTestFixtureFactory.getFixtureFactory()
val projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR
val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor, "for-mainframe")
val fixture = fixtureBuilder.fixture
val myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(
fixture,
LightTempDirTestFixtureImpl(true)
)
myFixture.setUp()
}
class SyncToolbarProviderTestSpec : WithApplicationShouldSpec({
afterSpec {
clearAllMocks()
}
Expand All @@ -52,7 +42,9 @@ class SyncToolbarProviderTestSpec : ShouldSpec({
var isResolved = false
val mockedActionGroupForTest = mockk<ActionGroup>()
every { ActionManager.getInstance() } returns mockedActionManagerInstance
every { mockedActionManagerInstance.getAction(any() as String)} answers {
every {
mockedActionManagerInstance.getAction(any() as String)
} answers {
isResolved = true
mockedActionGroupForTest
}
Expand All @@ -67,7 +59,7 @@ class SyncToolbarProviderTestSpec : ShouldSpec({
var isResolved = false
val mockedNotActionGroupForTest = mockk<AnAction>()
every { ActionManager.getInstance() } returns mockedActionManagerInstance
every { mockedActionManagerInstance.getAction(any() as String)} returns mockedNotActionGroupForTest
every { mockedActionManagerInstance.getAction(any() as String) } returns mockedNotActionGroupForTest
every { mockedActionManagerInstance.registerAction(any() as String, any() as DefaultActionGroup) } answers {
isResolved = true
}
Expand Down
48 changes: 25 additions & 23 deletions src/test/kotlin/org/zowe/explorer/editor/EditorTestSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

package org.zowe.explorer.editor

import com.intellij.codeInspection.*
// import com.intellij.openapi.ui.isComponentUnderMouse // TODO: needed in v1.*.*-223 and greater
import com.intellij.codeInspection.InspectionManager
import com.intellij.codeInspection.ProblemDescriptor
import com.intellij.codeInspection.ProblemHighlightType
import com.intellij.lang.Language
import com.intellij.lang.injection.InjectedLanguageManager
import com.intellij.lang.properties.charset.Native2AsciiCharset
Expand All @@ -19,7 +22,6 @@ import com.intellij.openapi.components.ComponentManager
import com.intellij.openapi.editor.ex.EditorEx
import com.intellij.openapi.fileEditor.impl.LoadTextUtil
import com.intellij.openapi.project.Project
// import com.intellij.openapi.ui.isComponentUnderMouse // TODO: needed in v1.*.*-223 and greater
import com.intellij.openapi.util.Ref
import com.intellij.openapi.util.TextRange
import com.intellij.openapi.util.text.StringUtil
Expand All @@ -28,9 +30,6 @@ import com.intellij.psi.FileViewProvider
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.SmartPointerManager
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl
import com.intellij.util.containers.ContainerUtil
import com.intellij.util.messages.Topic
import org.zowe.explorer.config.ConfigService
Expand All @@ -45,37 +44,40 @@ import org.zowe.explorer.dataops.content.synchronizer.DocumentedSyncProvider
import org.zowe.explorer.editor.inspection.MFLossyEncodingInspection
import org.zowe.explorer.explorer.Explorer
import org.zowe.explorer.explorer.WorkingSet
import org.zowe.explorer.testServiceImpl.TestDataOpsManagerImpl
import org.zowe.explorer.utils.*
import org.zowe.explorer.testutils.WithApplicationShouldSpec
import org.zowe.explorer.testutils.testServiceImpl.TestDataOpsManagerImpl
import org.zowe.explorer.utils.checkEncodingCompatibility
import org.zowe.explorer.utils.isComponentUnderMouse
import org.zowe.explorer.utils.sendTopic
import org.zowe.explorer.utils.service
import org.zowe.explorer.utils.showSaveAnywayDialog
import org.zowe.explorer.vfs.MFVirtualFile
import io.kotest.assertions.assertSoftly
import io.kotest.core.spec.style.ShouldSpec
import io.kotest.matchers.shouldBe
import io.mockk.*
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
import io.mockk.mockkConstructor
import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.spyk
import io.mockk.unmockkAll
import io.mockk.unmockkStatic
import java.awt.Component
import java.awt.Point
import java.awt.event.FocusEvent
import java.nio.ByteBuffer
import java.nio.CharBuffer
import java.nio.charset.*
import java.nio.charset.Charset
import java.nio.charset.CharsetDecoder
import java.nio.charset.CharsetEncoder
import java.nio.charset.CoderResult
import javax.swing.JComponent
import javax.swing.SwingUtilities
import kotlin.reflect.KFunction
import kotlin.reflect.full.declaredFunctions

class EditorTestSpec : ShouldSpec({
beforeSpec {
// FIXTURE SETUP TO HAVE ACCESS TO APPLICATION INSTANCE
val factory = IdeaTestFixtureFactory.getFixtureFactory()
val projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR
val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor, "for-mainframe")
val fixture = fixtureBuilder.fixture
val myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(
fixture,
LightTempDirTestFixtureImpl(true)
)
myFixture.setUp()
}
class EditorTestSpec : WithApplicationShouldSpec({
afterSpec {
clearAllMocks()
}
Expand Down
Loading

0 comments on commit d369f0b

Please sign in to comment.