├── .github ├── ISSUE_TEMPLATE │ ├── Bug.md │ ├── Documentation.md │ ├── Enhancement.md │ └── Feature.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── IJ-latest.yml │ ├── check-helm.yml │ ├── check-oc.yml │ ├── check-odo.yml │ ├── ci.yml │ ├── conventionalCheck.yml │ ├── dependency-submission.yml │ ├── nightly.yml │ ├── publish_reports.yml │ ├── release.yml │ ├── sonar.yml │ └── validate_IJ_versions.yml ├── .gitignore ├── CONTRIBUTING.md ├── DCO ├── LICENSE ├── OWNERS ├── README.md ├── USAGE_DATA.md ├── build.gradle.kts ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images ├── 0.4.0 │ └── openshift1.gif ├── 0.5.0 │ ├── openshift1.gif │ └── openshift2.gif ├── 0.6.0 │ └── openshift1.png ├── 0.7.0 │ ├── openshift1.png │ ├── openshift2.png │ └── openshift3.gif ├── 0.8.0 │ ├── openshift1.gif │ └── openshift2.gif ├── 0.9.0 │ ├── openshift1.png │ ├── openshift10.png │ ├── openshift11.gif │ ├── openshift12.png │ ├── openshift2.png │ ├── openshift3.png │ ├── openshift4.png │ ├── openshift5.png │ ├── openshift6.png │ ├── openshift7.png │ ├── openshift8.png │ └── openshift9.png ├── 1.10.0 │ ├── helm-add-dialog.png │ ├── helm-chart-install-validation.png │ ├── helm-chart-install.png │ ├── helm-edit-dialog.png │ ├── helm-edit.png │ └── helm-refresh.png ├── 1.5.0 │ └── feedback.gif ├── 1.7.0 │ └── helm.gif └── 1.8.0 │ ├── debug_on_podman.gif │ └── project_or_namespace.gif ├── settings.gradle.kts └── src ├── it ├── java │ └── org │ │ └── jboss │ │ └── tools │ │ └── intellij │ │ └── openshift │ │ ├── test │ │ └── ui │ │ │ ├── AbstractBaseTest.java │ │ │ ├── ClusterTestsSuite.java │ │ │ ├── PublicTestsSuite.java │ │ │ ├── annotations │ │ │ └── UITest.java │ │ │ ├── dialogs │ │ │ ├── ClusterLoginDialog.java │ │ │ ├── ProjectStructureDialog.java │ │ │ ├── cluster_project │ │ │ │ ├── ChangeProjectDialog.java │ │ │ │ ├── CreateNewProjectDialog.java │ │ │ │ └── DeleteProjectDialog.java │ │ │ ├── component │ │ │ │ └── CreateComponentDialog.java │ │ │ └── service │ │ │ │ └── CreateNewServiceDialog.java │ │ │ ├── junit │ │ │ └── TestRunnerExtension.java │ │ │ ├── runner │ │ │ └── IdeaRunner.java │ │ │ ├── tests_cluster │ │ │ ├── AboutClusterTest.java │ │ │ ├── AbstractClusterTest.java │ │ │ ├── CreateComponentTest.java │ │ │ ├── CreateServiceTest.java │ │ │ ├── LoginClusterTest.java │ │ │ └── ProjectClusterTest.java │ │ │ ├── tests_public │ │ │ ├── AboutPublicTest.java │ │ │ ├── ClusterLoginDialogPublicTest.java │ │ │ ├── GettingStartedTest.java │ │ │ └── OpenshiftExtensionTest.java │ │ │ ├── utils │ │ │ ├── CleanUpUtility.java │ │ │ ├── KubeConfigUtility.java │ │ │ ├── ProjectUtility.java │ │ │ └── constants │ │ │ │ ├── LabelConstants.java │ │ │ │ └── XPathConstants.java │ │ │ └── views │ │ │ ├── GettingStartedView.java │ │ │ └── OpenshiftView.java │ │ └── utils │ │ ├── OdoCluster.java │ │ ├── ToolFactoryTest.java │ │ ├── helm │ │ ├── Charts.java │ │ ├── HelmCliEnvTest.java │ │ ├── HelmCliInstallTest.java │ │ ├── HelmCliListTest.java │ │ ├── HelmCliRepoTest.java │ │ ├── HelmCliSearchTest.java │ │ └── HelmCliTest.java │ │ └── odo │ │ ├── OdoCliCatalogTest.java │ │ ├── OdoCliComponentTest.java │ │ ├── OdoCliProjectTest.java │ │ ├── OdoCliRegistryTest.java │ │ ├── OdoCliServiceTest.java │ │ ├── OdoCliTest.java │ │ └── OdoKubernetesClientTest.java └── projects │ ├── go.zip │ ├── nodejs.zip │ └── springboot-rest.zip ├── main ├── java │ └── org │ │ └── jboss │ │ └── tools │ │ └── intellij │ │ └── openshift │ │ ├── Constants.java │ │ ├── GettingStartedToolWindow.java │ │ ├── KubernetesLabels.java │ │ ├── WindowToolFactory.java │ │ ├── actions │ │ ├── ActionUtils.java │ │ ├── HelmAction.java │ │ ├── NodeUtils.java │ │ ├── NotificationUtils.java │ │ ├── OcAction.java │ │ ├── OdoAction.java │ │ ├── OpenGettingStartedAction.java │ │ ├── TelemetryAction.java │ │ ├── binding │ │ │ ├── DeleteBindingAction.java │ │ │ └── ShowBindingDetailsAction.java │ │ ├── cluster │ │ │ ├── AboutAction.java │ │ │ ├── LoggedInClusterAction.java │ │ │ ├── LoginAction.java │ │ │ └── RefreshAction.java │ │ ├── component │ │ │ ├── ContextAwareComponentAction.java │ │ │ ├── CreateComponentAction.java │ │ │ ├── DebugComponentAction.java │ │ │ ├── DebugJavaComponentAction.java │ │ │ ├── DeleteComponentAction.java │ │ │ ├── DeployComponentAction.java │ │ │ ├── DescribeComponentAction.java │ │ │ ├── DevComponentAction.java │ │ │ ├── DevOnPodmanComponentAction.java │ │ │ ├── FeatureComponentAction.java │ │ │ ├── FollowLogComponentAction.java │ │ │ ├── ImportComponentAction.java │ │ │ ├── LinkComponentAction.java │ │ │ ├── LinkServiceAction.java │ │ │ └── ShowLogComponentAction.java │ │ ├── helm │ │ │ ├── AddHelmRepoAction.java │ │ │ ├── EditHelmRepoAction.java │ │ │ ├── OpenHelmChartsAction.java │ │ │ ├── RefreshAction.java │ │ │ ├── RemoveRepositoriesAction.java │ │ │ └── UninstallReleaseAction.java │ │ ├── project │ │ │ ├── ChangeActiveProjectAction.java │ │ │ ├── CreateProjectAction.java │ │ │ └── DeleteProjectAction.java │ │ ├── registry │ │ │ ├── CreateRegistryAction.java │ │ │ └── DeleteRegistryAction.java │ │ ├── service │ │ │ ├── CreateServiceAction.java │ │ │ ├── DeleteServiceAction.java │ │ │ └── LinkComponentAction.java │ │ ├── toolwindow │ │ │ └── FeedBackAction.java │ │ └── url │ │ │ └── OpenInBrowserAction.java │ │ ├── oauth │ │ ├── AccountService.java │ │ ├── AccountStatus.java │ │ ├── DefaultTokenProvider.java │ │ ├── LoginProvider.java │ │ ├── LoginResponse.java │ │ ├── OAuthCoreConstants.java │ │ ├── OAuthUtils.java │ │ ├── TokenProvider.java │ │ ├── exception │ │ │ ├── OAuthConfigurationException.java │ │ │ ├── OAuthException.java │ │ │ ├── OAuthLoginException.java │ │ │ └── OAuthRefreshException.java │ │ ├── model │ │ │ ├── Account.java │ │ │ ├── AccountModel.java │ │ │ ├── AuthorizationServer.java │ │ │ ├── IAccount.java │ │ │ ├── IAccountModel.java │ │ │ ├── IAuthorizationServer.java │ │ │ ├── ServerExtensionPoint.java │ │ │ └── ServersRepository.java │ │ └── ui │ │ │ ├── BrowserBasedLoginDialog.form │ │ │ ├── BrowserBasedLoginDialog.java │ │ │ ├── DefaultLoginProvider.java │ │ │ └── OAuthBrowser.java │ │ ├── settings │ │ └── SettingsState.java │ │ ├── telemetry │ │ ├── TelemetryHandler.java │ │ ├── TelemetrySender.java │ │ ├── TelemetrySenderAware.java │ │ └── TelemetryService.java │ │ ├── tree │ │ └── application │ │ │ ├── ApplicationRootNodeOdo.java │ │ │ ├── ApplicationsRootNode.java │ │ │ ├── ApplicationsTreeStructure.java │ │ │ ├── BaseNode.java │ │ │ ├── BindingNode.java │ │ │ ├── ChangeActiveProjectLinkNode.java │ │ │ ├── ChartReleaseNode.java │ │ │ ├── ComponentNode.java │ │ │ ├── CreateComponentLinkNode.java │ │ │ ├── CreateNamespaceLinkNode.java │ │ │ ├── DescriptorFactory.java │ │ │ ├── DevfileRegistriesNode.java │ │ │ ├── DevfileRegistryComponentTypeNode.java │ │ │ ├── DevfileRegistryComponentTypeStarterNode.java │ │ │ ├── DevfileRegistryNode.java │ │ │ ├── HelmRepositoriesNode.java │ │ │ ├── HelmRepositoryNode.java │ │ │ ├── MessageNode.java │ │ │ ├── NamespaceNode.java │ │ │ ├── ParentableNode.java │ │ │ ├── ProcessingNode.java │ │ │ ├── ServiceNode.java │ │ │ ├── StructureAwareNode.java │ │ │ └── URLNode.java │ │ ├── ui │ │ ├── BaseDialog.java │ │ ├── Icons.java │ │ ├── StatusIcon.java │ │ ├── SwingUtils.java │ │ ├── TableRowFilterFactory.java │ │ ├── binding │ │ │ ├── BindingDetailDialog.form │ │ │ └── BindingDetailDialog.java │ │ ├── cluster │ │ │ ├── LoginDialog.form │ │ │ ├── LoginDialog.java │ │ │ ├── OAuthBrowser.java │ │ │ └── TokenExtractor.java │ │ ├── component │ │ │ ├── CreateComponentDialog.java │ │ │ ├── CreateComponentDialogStep.form │ │ │ ├── CreateComponentDialogStep.java │ │ │ ├── CreateComponentModel.java │ │ │ ├── ModuleSelectionDialog.form │ │ │ └── ModuleSelectionDialog.java │ │ ├── feedback │ │ │ ├── FeedBackDialog.form │ │ │ └── FeedBackDialog.java │ │ ├── helm │ │ │ ├── AddHelmRepoDialog.java │ │ │ ├── ChartIcons.java │ │ │ ├── ChartPanel.java │ │ │ ├── ChartVersions.java │ │ │ ├── ChartsDialog.java │ │ │ ├── DetailsPanel.java │ │ │ ├── EditHelmRepoDialog.java │ │ │ ├── InstallOrDetailsPanels.java │ │ │ └── install │ │ │ │ ├── InstallPanel.java │ │ │ │ ├── LoadingPanel.java │ │ │ │ ├── ResultPanel.java │ │ │ │ ├── ValuesEditor.java │ │ │ │ └── ValuesOrResultPanel.java │ │ ├── project │ │ │ ├── ChangeActiveProjectDialog.java │ │ │ └── CreateNewProjectDialog.java │ │ ├── registry │ │ │ ├── CreateRegistryDialog.form │ │ │ └── CreateRegistryDialog.java │ │ ├── sandbox │ │ │ ├── CountryCodeValidator.java │ │ │ ├── PhoneNumberValidator.java │ │ │ ├── SandboxAPI.java │ │ │ ├── SandboxDialog.java │ │ │ ├── SandboxLoginPage.form │ │ │ ├── SandboxLoginPage.java │ │ │ ├── SandboxModel.java │ │ │ ├── SandboxProcessor.java │ │ │ ├── SandboxWorkflowPage.form │ │ │ └── SandboxWorkflowPage.java │ │ ├── service │ │ │ ├── CreateServiceDialog.form │ │ │ └── CreateServiceDialog.java │ │ └── widgets │ │ │ └── JsonSchemaWidget.java │ │ ├── utils │ │ ├── Cli.java │ │ ├── ClientAwareCli.java │ │ ├── ExceptionUtils.java │ │ ├── KubernetesClientExceptionUtils.java │ │ ├── KubernetesClientFactory.java │ │ ├── KubernetesClusterHelper.java │ │ ├── OCCommandUtils.java │ │ ├── ProjectUtils.java │ │ ├── Serialization.java │ │ ├── ToolFactory.java │ │ ├── helm │ │ │ ├── Chart.java │ │ │ ├── ChartRelease.java │ │ │ ├── Helm.java │ │ │ ├── HelmCli.java │ │ │ └── HelmRepository.java │ │ ├── oc │ │ │ ├── Oc.java │ │ │ └── OcCli.java │ │ └── odo │ │ │ ├── AbstractComponentType.java │ │ │ ├── Binding.java │ │ │ ├── BindingDeserializer.java │ │ │ ├── Component.java │ │ │ ├── ComponentDescriptor.java │ │ │ ├── ComponentDescriptorsDeserializer.java │ │ │ ├── ComponentDeserializer.java │ │ │ ├── ComponentFeature.java │ │ │ ├── ComponentFeatures.java │ │ │ ├── ComponentInfo.java │ │ │ ├── ComponentKind.java │ │ │ ├── ComponentMetadata.java │ │ │ ├── ComponentMetadatasDeserializer.java │ │ │ ├── ComponentType.java │ │ │ ├── ComponentTypeInfo.java │ │ │ ├── ComponentTypesDeserializer.java │ │ │ ├── DebugComponentFeature.java │ │ │ ├── DevfileComponentType.java │ │ │ ├── DevfileRegistriesDeserializer.java │ │ │ ├── DevfileRegistry.java │ │ │ ├── JSonParser.java │ │ │ ├── Odo.java │ │ │ ├── OdoCli.java │ │ │ ├── OdoDelegate.java │ │ │ ├── OdoFacade.java │ │ │ ├── OdoProcessHelper.java │ │ │ ├── OperatorCRD.java │ │ │ ├── OperatorCRDSpecDescriptor.java │ │ │ ├── SchemaHelper.java │ │ │ ├── Service.java │ │ │ ├── ServiceDeserializer.java │ │ │ ├── ServiceTemplate.java │ │ │ ├── ServiceTemplatesDeserializer.java │ │ │ ├── Starter.java │ │ │ └── URL.java │ │ └── validation │ │ ├── DevfileJsonSchemaFileProvider.java │ │ └── DevfileJsonSchemaProviderFactory.java └── resources │ ├── META-INF │ ├── OpenShiftPluginIcon13x13.svg │ ├── plugin-openshift-validation-json.xml │ ├── plugin.xml │ ├── pluginIcon.svg │ ├── pluginIcon_dark.svg │ └── withJava.xml │ ├── gettingstarted │ ├── browse-devfile-registries.gif │ ├── create-component.gif │ ├── login.gif │ ├── start-debug.gif │ ├── start-deploy.gif │ └── start-dev.gif │ ├── images │ ├── application.png │ ├── chevron-down-solid-dark.png │ ├── chevron-down-solid-light.png │ ├── cluster.svg │ ├── component-type-light.png │ ├── component.png │ ├── error.png │ ├── github-mark.png │ ├── helm │ │ ├── a10-thunder.png │ │ ├── backstage.png │ │ ├── broadpeak.png │ │ ├── cryostat.png │ │ ├── data-grid.png │ │ ├── eap.png │ │ ├── fiware.png │ │ ├── flomesh.png │ │ ├── helm.svg │ │ ├── ibm-cloud-object-storage.png │ │ ├── ibm-operator-catalog.png │ │ ├── ibm-order-management.png │ │ ├── ibm-spectrum-protect.png │ │ ├── infinispan.png │ │ ├── jenkins.png │ │ ├── kyverno.png │ │ ├── nearby-one.png │ │ ├── node-red.png │ │ ├── rafay.png │ │ ├── redhat.png │ │ ├── repo.svg │ │ ├── solace-pubsub.png │ │ ├── vault.png │ │ ├── wildfly.png │ │ └── yugaware.png │ ├── openshift_extension.png │ ├── plus-solid-dark.png │ ├── plus-solid-light.png │ ├── project.png │ ├── readme.txt │ ├── registry.svg │ ├── registry_dark.svg │ ├── service.png │ ├── start-project-light.png │ ├── storage.png │ ├── success.png │ ├── url-node-secure.png │ └── url-node.png │ ├── schemas │ └── devfile.json │ └── tools.json └── test ├── java └── org │ └── jboss │ └── tools │ └── intellij │ └── openshift │ ├── actions │ ├── ActionTest.java │ ├── OpenGettingStartedActionTest.java │ ├── binding │ │ ├── DeleteBindingActionTest.java │ │ └── ShowBindingDetailsActionTest.java │ ├── cluster │ │ ├── AboutActionTest.java │ │ ├── LoginActionTest.java │ │ └── RefreshActionTest.java │ ├── component │ │ ├── CreateComponentActionTest.java │ │ ├── DebugJavaComponentActionTest.java │ │ ├── DeleteComponentActionTest.java │ │ ├── DeployComponentActionTest.java │ │ ├── DescribeComponentActionTest.java │ │ ├── DevComponentActionTest.java │ │ ├── DevOnPodmanComponentActionTest.java │ │ ├── DevOnPodmanNotPresentComponentActionTest.java │ │ ├── FollowLogComponentActionTest.java │ │ ├── ImportComponentActionTest.java │ │ ├── LinkComponentActionTest.java │ │ ├── LinkServiceActionTest.java │ │ └── OpenInBrowserActionTest.java │ ├── helm │ │ ├── AddHelmRepositoryActionTest.java │ │ ├── EditHelmRepositoryActionTest.java │ │ ├── OpenHelmChartsActionTest.java │ │ ├── RefreshActionTest.java │ │ ├── RemoveHelmRepositoryActionTest.java │ │ └── UninstallReleaseActionTest.java │ ├── project │ │ ├── ChangeActiveProjectActionTest.java │ │ ├── CreateProjectActionTest.java │ │ └── DeleteProjectActionTest.java │ ├── registry │ │ ├── CreateRegistryActionTest.java │ │ └── DeleteRegistryActionTest.java │ ├── service │ │ ├── CreateServiceActionTest.java │ │ ├── DeleteServiceActionTest.java │ │ └── LinkComponentActionTest.java │ └── url │ │ └── OpenInBrowserActionTest.java │ ├── oauth │ └── OAuthUtilsTest.java │ ├── telemetry │ └── TelemetrySenderTest.java │ ├── tree │ └── application │ │ ├── ApplicationRootNodeOdoTest.java │ │ ├── ApplicationTreeModelConfigUpdateTest.java │ │ └── ProcessingNodeImplTest.java │ ├── ui │ ├── cluster │ │ └── TokenExtractorTest.java │ ├── helm │ │ └── ChartVersionsTest.java │ ├── sandbox │ │ ├── CountryCodeValidatorTest.java │ │ ├── PhoneNumberValidatorTest.java │ │ ├── SandboxProcessorTest.java │ │ └── SandboxRegistrationServerMock.java │ └── widgets │ │ └── JsonSchemaWidgetTest.java │ ├── utils │ ├── KubernetesClientExceptionUtilsTest.java │ ├── OCCommandUtilsTest.java │ └── odo │ │ ├── BindingDeserializerTest.java │ │ ├── ComponentDescriptorTest.java │ │ ├── ComponentDeserializerTest.java │ │ ├── JsonParserTest.java │ │ ├── ServiceTemplateRequiredTest.java │ │ ├── ServiceTemplateTest.java │ │ └── ServiceTest.java │ └── validation │ └── DevfileSchemasTest.java └── resources ├── component-descriptor-test.json ├── components-test.json ├── describe-binding-inDev-test.json ├── describe-binding-test.json ├── describe-component-deploy-kubernetes.json ├── describe-component-deploy-openshift.json ├── describe-component-dev.json ├── describe-component-local.json ├── devfile-registry.json ├── devfiles ├── java-quarkus-v200.yaml └── sample-python-v220.yaml ├── service-template-required-test.json ├── service-template-test.json ├── service-test.json └── swagger.json /.github/ISSUE_TEMPLATE/Bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a problem with IntelliJ OpenShift Toolkit to help us resolve it and improve 4 | labels: bug 5 | --- 6 | 15 | 16 | ## What versions of software are you using? 17 | - Operating System: 18 | - IntelliJ version: 19 | - Extension version: 20 | - Are you targeting a kubernetes or an Openshift cluster ? If possible, provide its version: 21 | 22 | ## What did you run exactly? 23 | 24 | 25 | ## Actual behavior 26 | 27 | 28 | ## Expected behavior 29 | 30 | 31 | ## Any logs, error output, etc? 32 | 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation 3 | about: Report mistakes or request for documentation 4 | labels: documentation 5 | --- 6 | 13 | 14 | ## What did you find missing in the documentation? 15 | 16 | 17 | ## What is the relevance of it? 18 | 19 | 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement 3 | about: Suggest an enhancement for existing IntelliJ OpenShift Toolkit functionality 4 | labels: enhancement 5 | --- 6 | 15 | 16 | ## Which functionality do you think we should update/improve? 17 | 18 | 19 | ## Why is this needed? 20 | 21 | 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest a new feature for IntelliJ OpenShift Toolkit 4 | labels: feature 5 | --- 6 | 15 | 16 | ## Which functionality do you think we should add? 17 | 18 | 19 | ## Why is this needed? 20 | 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## What is the purpose of this change? What does it change? 2 | 3 | 4 | ## Was the change discussed in an issue? 5 | fixes #??? 6 | 7 | 8 | ## How to test changes? 9 | 10 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Set update schedule for GitHub Actions and Gradle dependencies 2 | 3 | version: 2 4 | updates: 5 | # Updates for GitHub Actions 6 | - package-ecosystem: "github-actions" 7 | directory: "/" 8 | schedule: 9 | interval: "weekly" 10 | # Updates for Gradle dependencies 11 | - package-ecosystem: "gradle" 12 | directory: "/" 13 | schedule: 14 | interval: "weekly" -------------------------------------------------------------------------------- /.github/workflows/IJ-latest.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Gradle 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle 3 | 4 | name: Latest IJ 5 | 6 | on: 7 | schedule: 8 | - cron: "0 0 * * *" 9 | 10 | jobs: 11 | 12 | build: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | - name: Set up JDK 17 18 | uses: actions/setup-java@v4 19 | with: 20 | java-version: 17 21 | distribution: 'temurin' 22 | cache: 'gradle' 23 | - name: Grant execute permission for gradlew 24 | run: chmod +x gradlew 25 | - name: Build with Gradle 26 | run: | 27 | LATEST_EAP_SNAPSHOT=$(./gradlew printProductsReleases | grep 'IC-' | head -n 1 | cut -d'-' -f2) 28 | echo "building using latest EAP version $LATEST_EAP_SNAPSHOT" 29 | ./gradlew build --continue -PplatformVersion=$LATEST_EAP_SNAPSHOT 30 | - uses: actions/upload-artifact@v4 31 | if: always() 32 | with: 33 | name: test-reports 34 | path: | 35 | build/test-results/**/*.xml 36 | build/jacoco/ 37 | - name: create issue on fail 38 | if: failure() 39 | env: 40 | GH_TOKEN: ${{ github.token }} 41 | run: | 42 | issueNum=$(gh search issues --state open "Next EAP SNAPSHOT build failure") 43 | if [ -z "$issueNum" ]; then 44 | gh issue create --title "Next EAP SNAPSHOT build failure" --body "See https://github.com/redhat-developer/intellij-openshift-connector/actions/runs/${{ github.run_id }}" 45 | else 46 | echo "issue already exists : $issueNum" 47 | fi 48 | 49 | -------------------------------------------------------------------------------- /.github/workflows/conventionalCheck.yml: -------------------------------------------------------------------------------- 1 | name: "Conventional Commits PR Check" 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - edited 8 | - synchronize 9 | - reopened 10 | 11 | permissions: 12 | pull-requests: read 13 | 14 | jobs: 15 | main: 16 | name: Validate PR title 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 #v5.5.3 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | -------------------------------------------------------------------------------- /.github/workflows/dependency-submission.yml: -------------------------------------------------------------------------------- 1 | name: Dependency Submission 2 | 3 | on: 4 | push: 5 | branches: [ 'main' ] 6 | 7 | permissions: 8 | contents: write 9 | 10 | jobs: 11 | dependency-submission: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | - uses: actions/setup-java@v4 16 | with: 17 | distribution: temurin 18 | java-version: 17 19 | 20 | - name: Generate and submit dependency graph 21 | uses: gradle/actions/dependency-submission@v3 22 | -------------------------------------------------------------------------------- /.github/workflows/publish_reports.yml: -------------------------------------------------------------------------------- 1 | name: Publish reports 2 | 3 | on: 4 | workflow_run: 5 | workflows: [ "Java CI with Gradle" ] 6 | types: 7 | - completed 8 | 9 | jobs: 10 | publish: 11 | name: Publish Test Report 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Download Reports 15 | uses: actions/download-artifact@v4 16 | with: 17 | path: reports 18 | pattern: '*-reports' 19 | github-token: ${{ secrets.GITHUB_TOKEN }} 20 | run-id: ${{github.event.workflow_run.id}} 21 | - name: Publish aggregated tests reports 22 | uses: scacap/action-surefire-report@a2911bd1a4412ec18dde2d93b1758b3e56d2a880 #v1.8.0 23 | with: 24 | github_token: ${{secrets.GITHUB_TOKEN}} 25 | report_paths: '${{github.workspace}}/reports/**/TEST-*.xml' 26 | commit: ${{github.event.workflow_run.head_sha}} 27 | check_name: Aggregated Test Report 28 | -------------------------------------------------------------------------------- /.github/workflows/validate_IJ_versions.yml: -------------------------------------------------------------------------------- 1 | name: Validate against IJ versions 2 | 3 | on: 4 | pull_request: 5 | branches: [ main ] 6 | 7 | jobs: 8 | validate: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | # Free GitHub Actions Environment Disk Space 13 | - name: Maximize Build Space 14 | uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main 15 | with: 16 | tool-cache: false 17 | large-packages: false 18 | - name: Checkout Code 19 | uses: actions/checkout@v4 20 | - name: Set up JDK 17 21 | uses: actions/setup-java@v4 22 | with: 23 | java-version: 17 24 | distribution: 'temurin' 25 | cache: 'gradle' 26 | - name: Grant execute permission for gradlew 27 | run: chmod +x gradlew 28 | - name: Verify with Gradle 29 | run: | 30 | ./gradlew verifyPlugin 31 | REPORTS=$(cat ${{ github.workspace }}/build/reports/pluginVerifier/*/report.md | sed 's/^#/##/') 32 | echo "$REPORTS" >> $GITHUB_STEP_SUMMARY 33 | - name: Upload report 34 | uses: actions/upload-artifact@v4 35 | if: always() 36 | with: 37 | name: verifier-reports 38 | path: build/reports/pluginVerifier 39 | if-no-files-found: ignore 40 | - name: Clean up 41 | run: | 42 | ./gradlew clean 43 | if: always() -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea 3 | *.iml 4 | build 5 | .gradle 6 | out 7 | bin/ 8 | 9 | lsp/ 10 | /.run/ 11 | /.intellijPlatform/ -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | Contributions are essential for keeping this plugin great. 4 | We try to keep it as easy as possible to contribute changes and we are 5 | open to suggestions for making it even easier. 6 | There are only a few guidelines that we need contributors to follow. 7 | 8 | ## First Time Setup 9 | 1. Install prerequisites: 10 | * [Java Development Kit](https://adoptopenjdk.net/) 11 | 2. Fork and clone the repository 12 | 3. `cd intellij-openshift-connector` 13 | 4. Import the folder as a project in JetBrains IntelliJ 14 | 15 | ## Run the extension locally 16 | 17 | 1. From root folder, run the below command. 18 | ```bash 19 | $ ./gradlew runIde 20 | ``` 21 | 22 | 2. Once the plugin is installed and reloaded, there will be an OpenShift Icon in the Tool Windows list (bottom left). 23 | 24 | ## Red Hat Developer Sandbox integration 25 | 26 | In order to test the Red Hat Developer Sandbox workflow, we have developed a fake registration server that has less 27 | limitations than the production one and allow to test the whole workflow easily. 28 | 29 | 1. Start the fake registration server: 30 | ```bash 31 | $ ./gradlew runSandbox 32 | ``` 33 | 34 | 2. In the build.gradle file, uncomment the line: 35 | `//systemProperties['jboss.sandbox.api.endpoint'] = 'http://localhost:3000'` 36 | 37 | then run 38 | ```bash 39 | $ ./gradlew runIde 40 | ``` 41 | 42 | > If you have any questions or run into any problems, please post an issue - we'll be very happy to help. 43 | ### Certificate of Origin 44 | 45 | By contributing to this project you agree to the Developer Certificate of 46 | Origin (DCO). This document was created by the Linux Kernel community and is a 47 | simple statement that you, as a contributor, have the legal right to make the 48 | contribution. See the [DCO](DCO) file for details. 49 | -------------------------------------------------------------------------------- /DCO: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md 2 | 3 | approvers: 4 | - adietish 5 | - sbouchet 6 | 7 | reviewers: 8 | - sbouchet 9 | -------------------------------------------------------------------------------- /USAGE_DATA.md: -------------------------------------------------------------------------------- 1 | ## [OpenShift Toolkit by Red Hat](https://github.com/redhat-developer/intellij-openshift-connector) 2 | 3 | ### Usage Data 4 | 5 | * when plugin is started 6 | * when an action is executed 7 | * action name 8 | * action duration time 9 | * action error message (in case of exception) 10 | * action specific data if applicable (see details below) 11 | * when connecting to a cluster 12 | * Kubernetes version 13 | * flag for Kubernetes/OpenShift cluster 14 | * OpenShift version 15 | * when plugin is shut down 16 | 17 | ### Specific data collected 18 | * on create: 19 | * component source type 20 | * component kind (s2i or devfile) 21 | * component version (if present) 22 | * component starter used ( if using devfile ) 23 | * if component used an already present local devfile 24 | * if component pushed right after creation 25 | 26 | * on debug: 27 | * component language ( java, nodejs, ...) -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | projectVersion=1.11.1-SNAPSHOT 2 | jetBrainsToken=invalid 3 | jetBrainsChannel=stable 4 | 5 | # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension 6 | platformVersion=2024.1 7 | 8 | # Gradle Releases -> https://github.com/gradle/gradle/releases 9 | gradleVersion=8.5 10 | 11 | # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html 12 | platformBundledPlugins=com.intellij.java, org.jetbrains.plugins.yaml, org.jetbrains.plugins.terminal 13 | platformPlugins=com.redhat.devtools.intellij.telemetry:1.2.1.62 14 | 15 | # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html 16 | pluginSinceBuild=231 17 | 18 | # Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib 19 | kotlin.stdlib.default.dependency=false 20 | 21 | # Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html 22 | org.gradle.configuration-cache=true 23 | 24 | # Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html 25 | org.gradle.caching=true 26 | 27 | org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx4g -Xms1g 28 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 4 | distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /images/0.4.0/openshift1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.4.0/openshift1.gif -------------------------------------------------------------------------------- /images/0.5.0/openshift1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.5.0/openshift1.gif -------------------------------------------------------------------------------- /images/0.5.0/openshift2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.5.0/openshift2.gif -------------------------------------------------------------------------------- /images/0.6.0/openshift1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.6.0/openshift1.png -------------------------------------------------------------------------------- /images/0.7.0/openshift1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.7.0/openshift1.png -------------------------------------------------------------------------------- /images/0.7.0/openshift2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.7.0/openshift2.png -------------------------------------------------------------------------------- /images/0.7.0/openshift3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.7.0/openshift3.gif -------------------------------------------------------------------------------- /images/0.8.0/openshift1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.8.0/openshift1.gif -------------------------------------------------------------------------------- /images/0.8.0/openshift2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.8.0/openshift2.gif -------------------------------------------------------------------------------- /images/0.9.0/openshift1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift1.png -------------------------------------------------------------------------------- /images/0.9.0/openshift10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift10.png -------------------------------------------------------------------------------- /images/0.9.0/openshift11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift11.gif -------------------------------------------------------------------------------- /images/0.9.0/openshift12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift12.png -------------------------------------------------------------------------------- /images/0.9.0/openshift2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift2.png -------------------------------------------------------------------------------- /images/0.9.0/openshift3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift3.png -------------------------------------------------------------------------------- /images/0.9.0/openshift4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift4.png -------------------------------------------------------------------------------- /images/0.9.0/openshift5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift5.png -------------------------------------------------------------------------------- /images/0.9.0/openshift6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift6.png -------------------------------------------------------------------------------- /images/0.9.0/openshift7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift7.png -------------------------------------------------------------------------------- /images/0.9.0/openshift8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift8.png -------------------------------------------------------------------------------- /images/0.9.0/openshift9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/0.9.0/openshift9.png -------------------------------------------------------------------------------- /images/1.10.0/helm-add-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.10.0/helm-add-dialog.png -------------------------------------------------------------------------------- /images/1.10.0/helm-chart-install-validation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.10.0/helm-chart-install-validation.png -------------------------------------------------------------------------------- /images/1.10.0/helm-chart-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.10.0/helm-chart-install.png -------------------------------------------------------------------------------- /images/1.10.0/helm-edit-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.10.0/helm-edit-dialog.png -------------------------------------------------------------------------------- /images/1.10.0/helm-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.10.0/helm-edit.png -------------------------------------------------------------------------------- /images/1.10.0/helm-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.10.0/helm-refresh.png -------------------------------------------------------------------------------- /images/1.5.0/feedback.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.5.0/feedback.gif -------------------------------------------------------------------------------- /images/1.7.0/helm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.7.0/helm.gif -------------------------------------------------------------------------------- /images/1.8.0/debug_on_podman.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.8.0/debug_on_podman.gif -------------------------------------------------------------------------------- /images/1.8.0/project_or_namespace.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/images/1.8.0/project_or_namespace.gif -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "intellij-openshift-connector" 2 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/test/ui/PublicTestsSuite.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.test.ui; 12 | 13 | import org.jboss.tools.intellij.openshift.test.ui.tests_public.AboutPublicTest; 14 | import org.jboss.tools.intellij.openshift.test.ui.tests_public.ClusterLoginDialogPublicTest; 15 | import org.jboss.tools.intellij.openshift.test.ui.tests_public.GettingStartedTest; 16 | import org.jboss.tools.intellij.openshift.test.ui.tests_public.OpenshiftExtensionTest; 17 | import org.jboss.tools.intellij.openshift.test.ui.utils.KubeConfigUtility; 18 | import org.junit.jupiter.api.AfterAll; 19 | import org.junit.jupiter.api.BeforeAll; 20 | import org.junit.platform.suite.api.IncludeClassNamePatterns; 21 | import org.junit.platform.suite.api.SelectClasses; 22 | import org.junit.platform.suite.api.Suite; 23 | 24 | @Suite 25 | @SelectClasses({ 26 | GettingStartedTest.class, 27 | OpenshiftExtensionTest.class, 28 | AboutPublicTest.class, 29 | ClusterLoginDialogPublicTest.class 30 | }) 31 | @IncludeClassNamePatterns({"^.*Test$"}) 32 | public class PublicTestsSuite { 33 | @BeforeAll 34 | static void setUp() { 35 | KubeConfigUtility.backupKubeConfig(); 36 | KubeConfigUtility.removeKubeConfig(); 37 | } 38 | 39 | @AfterAll 40 | static void tearDown() { 41 | KubeConfigUtility.restoreKubeConfig(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/test/ui/annotations/UITest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.test.ui.annotations; 12 | 13 | import org.junit.jupiter.api.Tag; 14 | 15 | import java.lang.annotation.ElementType; 16 | import java.lang.annotation.Retention; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.Target; 19 | 20 | /** 21 | * @author Ondrej Dockal 22 | * Annotation represent UI Test class, using @Tag annotation 23 | */ 24 | @Target({ ElementType.TYPE }) 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Tag("ui-test") 27 | public @interface UITest { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/test/ui/dialogs/cluster_project/DeleteProjectDialog.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.test.ui.dialogs.cluster_project; 12 | 13 | import com.intellij.remoterobot.RemoteRobot; 14 | import com.intellij.remoterobot.data.RemoteComponent; 15 | import com.intellij.remoterobot.fixtures.CommonContainerFixture; 16 | import com.intellij.remoterobot.fixtures.ComponentFixture; 17 | import com.intellij.remoterobot.fixtures.DefaultXpath; 18 | import com.intellij.remoterobot.fixtures.FixtureName; 19 | import org.jboss.tools.intellij.openshift.test.ui.utils.constants.XPathConstants; 20 | import org.jetbrains.annotations.NotNull; 21 | 22 | import static com.intellij.remoterobot.search.locators.Locators.byXpath; 23 | 24 | /** 25 | * Delete Project dialog fixture 26 | */ 27 | @DefaultXpath(by = "MyDialog type", xpath = XPathConstants.MYDIALOG_CLASS) 28 | @FixtureName(name = "Delete Project Dialog") 29 | public class DeleteProjectDialog extends CommonContainerFixture { 30 | 31 | public DeleteProjectDialog(@NotNull RemoteRobot remoteRobot, @NotNull RemoteComponent remoteComponent) { 32 | super(remoteRobot, remoteComponent); 33 | } 34 | 35 | public void clickYes() { 36 | find(ComponentFixture.class, byXpath(XPathConstants.BUTTON_YES)).click(); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/test/ui/runner/IdeaRunner.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.test.ui.runner; 12 | 13 | import com.intellij.remoterobot.RemoteRobot; 14 | import com.redhat.devtools.intellij.commonuitest.UITestRunner; 15 | import com.redhat.devtools.intellij.commonuitest.utils.runner.IntelliJVersion; 16 | 17 | /** 18 | * Idea Runner singleton to keep track of running IDE 19 | * @author Ondrej Dockal 20 | * 21 | */ 22 | public class IdeaRunner { 23 | 24 | private static IdeaRunner ideaRunner = null; 25 | private static boolean ideaIsStarted = false; 26 | private static int port = 8580; 27 | 28 | private RemoteRobot robot; 29 | 30 | private IdeaRunner() {} 31 | 32 | public static IdeaRunner getInstance() { 33 | if (ideaRunner == null) { 34 | ideaRunner = new IdeaRunner(); 35 | } 36 | return ideaRunner; 37 | } 38 | 39 | public void startIDE(IntelliJVersion ideaVersion, int portNumber) { 40 | if (!ideaIsStarted) { 41 | System.out.println("Starting " + ideaVersion + " IDE, setting ideaIsStarted to true"); 42 | robot = UITestRunner.runIde(ideaVersion, port); 43 | port = portNumber; 44 | System.out.println("IDEA port for remote robot: " + port); 45 | ideaIsStarted = true; 46 | } 47 | } 48 | 49 | public RemoteRobot getRemoteRobot() { 50 | return robot; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/test/ui/tests_cluster/LoginClusterTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: Martin Szuc 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.test.ui.tests_cluster; 12 | 13 | import org.junit.jupiter.api.Test; 14 | import org.junit.jupiter.api.condition.EnabledIfSystemProperty; 15 | import org.slf4j.Logger; 16 | import org.slf4j.LoggerFactory; 17 | 18 | /** 19 | * @author Martin Szuc 20 | * Test class verifying functionality of Log in to Cluster 21 | */ 22 | public class LoginClusterTest extends AbstractClusterTest { 23 | 24 | private static final Logger LOGGER = LoggerFactory.getLogger(LoginClusterTest.class); 25 | 26 | @Test 27 | @EnabledIfSystemProperty(named = "CLUSTER_ALREADY_LOGGED_IN", matches = "false", disabledReason = "Already logged in, skipping login test") 28 | public void usernameLoginTest() { 29 | LOGGER.info("usernameLoginTest: Start"); 30 | logOut(); 31 | loginWithUsername(); 32 | verifyClusterLogin(currentClusterUrl); 33 | LOGGER.info("usernameLoginTest: End"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/test/ui/utils/ProjectUtility.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.test.ui.utils; 12 | 13 | import com.intellij.remoterobot.RemoteRobot; 14 | import com.intellij.remoterobot.fixtures.ComponentFixture; 15 | import com.intellij.remoterobot.utils.WaitForConditionTimeoutException; 16 | 17 | import java.time.Duration; 18 | 19 | import static com.intellij.remoterobot.search.locators.Locators.byXpath; 20 | 21 | /** 22 | * @author Ondrej Dockal, Oleksii Korniienko, Ihor Okhrimenko 23 | */ 24 | public class ProjectUtility { 25 | 26 | public static void closeGotItPopup(RemoteRobot robot) { 27 | try { 28 | robot.find(ComponentFixture.class, byXpath("JBList", "//div[@accessiblename='Got It' and @class='JButton' and @text='Got It']"), Duration.ofSeconds(10)).click(); 29 | } catch (WaitForConditionTimeoutException e) { 30 | // no dialog appeared, no need to exception handling 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/test/ui/utils/constants/LabelConstants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: Martin Szuc 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.test.ui.utils.constants; 12 | 13 | public class LabelConstants { 14 | public static final String ABOUT = "About"; 15 | public static final String CANCEL = "Cancel"; 16 | public static final String CHANGE_PROJECT = "Change Project"; 17 | public static final String CHANGE_NAMESPACE = "Change Namespace"; 18 | public static final String DELETE_PROJECT = "Delete Project"; 19 | public static final String DELETE_NAMESPACE = "Delete Namespace"; 20 | public static final String DEVFILE_REGISTRIES = "Devfile registries"; 21 | public static final String GETTING_STARTED = "Getting Started"; 22 | public static final String KUBERNETES = "Kubernetes"; 23 | public static final String LOG_IN_TO_CLUSTER = "Log in to Cluster"; 24 | public static final String NEW_PROJECT = "New Project"; 25 | public static final String NEW_NAMESPACE = "New Namespace"; 26 | public static final String OK = "OK"; 27 | public static final String OPENSHIFT = "OpenShift"; 28 | public static final String PLEASE_LOG_IN_TO_CLUSTER = "Please log in to the cluster"; 29 | public static final String REFRESH = "Refresh"; 30 | public static final String NEW_COMPONENT = "New Component"; 31 | public static final String NEW_SERVICE = "New Service"; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/utils/OdoCluster.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils; 12 | 13 | import java.io.IOException; 14 | import org.jboss.tools.intellij.openshift.utils.oc.Oc; 15 | 16 | public class OdoCluster { 17 | 18 | public static final OdoCluster INSTANCE = new OdoCluster(); 19 | 20 | public static final String CLUSTER_URL = System.getenv("CLUSTER_URL"); 21 | 22 | public static final String CLUSTER_USER = System.getenv("CLUSTER_USER"); 23 | 24 | public static final String CLUSTER_PASSWORD = System.getenv("CLUSTER_PASSWORD"); 25 | 26 | public void login(Oc oc) throws IOException { 27 | if (CLUSTER_URL != null && !oc.getMasterUrl().toString().startsWith(CLUSTER_URL)) { 28 | oc.login(CLUSTER_URL, CLUSTER_USER, CLUSTER_PASSWORD.toCharArray(), null); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/utils/helm/Charts.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.helm; 12 | 13 | import com.intellij.openapi.util.Pair; 14 | 15 | import java.io.IOException; 16 | import java.util.Optional; 17 | 18 | import static org.fest.assertions.Assertions.assertThat; 19 | 20 | public class Charts { 21 | 22 | public static final String CHART_KUBEROS = "kuberos"; 23 | public static final String CHART_SYSDIG = "sysdig"; 24 | 25 | public static final Pair REPOSITORY_STABLE = new Pair<>("stable", "https://charts.helm.sh/stable"); 26 | 27 | public static Chart get(String name, Helm helm) throws Exception { 28 | Optional found = helm.search(name).stream().findFirst(); 29 | assertThat(found.isPresent()).isTrue(); 30 | return found.get(); 31 | } 32 | 33 | public static void addRepository(Pair pair, Helm helm) throws IOException { 34 | helm.addRepo(pair.first, pair.second, null); 35 | } 36 | 37 | public static void removeRepository(Pair pair, Helm helm) throws IOException { 38 | helm.removeRepos(pair.first); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/utils/helm/HelmCliEnvTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.helm; 12 | 13 | 14 | import org.jboss.tools.intellij.openshift.utils.helm.HelmCli.HelmEnv; 15 | 16 | import static org.fest.assertions.Assertions.assertThat; 17 | 18 | public class HelmCliEnvTest extends HelmCliTest { 19 | 20 | public void testEnv_should_return_current_namespace() throws Exception { 21 | // given 22 | // when 23 | HelmEnv env = helm.env(); 24 | // then 25 | assertThat(env.get(HelmEnv.HELM_NAMESPACE)).isNotEmpty(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/utils/helm/HelmCliListTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.helm; 12 | 13 | 14 | import java.util.List; 15 | import java.util.Random; 16 | 17 | public class HelmCliListTest extends HelmCliTest { 18 | 19 | public void testList_should_list_kuberos() throws Exception { 20 | // given openshift repo was added to helm 21 | String releaseName = Charts.CHART_KUBEROS + new Random().nextInt(); 22 | try { 23 | Chart kuberosChart = Charts.get(Charts.CHART_KUBEROS, helm); 24 | helm.install(releaseName, kuberosChart.getName(), kuberosChart.getVersion(), null); 25 | // when 26 | List releases = helm.list(); 27 | // then 28 | assertTrue(releases.stream().anyMatch(chart -> releaseName.equals(chart.getName()))); 29 | } finally { 30 | safeUninstall(releaseName); 31 | } 32 | } 33 | 34 | public void testUninstall_should_uninstall_vertx() throws Exception { 35 | // given 36 | String releaseName = Charts.CHART_KUBEROS + new Random().nextInt(); 37 | Chart jenkinsChart = Charts.get(Charts.CHART_KUBEROS, helm); 38 | helm.install(releaseName, jenkinsChart.getName(), jenkinsChart.getVersion(), null); 39 | // when 40 | helm.uninstall(releaseName); 41 | // then 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/utils/helm/HelmCliSearchTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.helm; 12 | 13 | 14 | import java.io.IOException; 15 | import java.util.List; 16 | 17 | public class HelmCliSearchTest extends HelmCliTest { 18 | 19 | public void testSearch_should_list_all_charts() throws IOException { 20 | // given openshift a repo was added to helm 21 | // when 22 | List charts = helm.search(); 23 | // then 24 | assertFalse(charts.isEmpty()); 25 | } 26 | 27 | public void testSearch_should_list_kuberos() throws IOException { 28 | // given openshift repo was added to helm 29 | String id = Charts.CHART_KUBEROS; 30 | // when 31 | List charts = helm.search(id); 32 | // then 33 | boolean found = charts.stream().anyMatch((Chart chart) -> chart.getName().contains(id)); 34 | assertTrue(found); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/it/java/org/jboss/tools/intellij/openshift/utils/odo/OdoCliProjectTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import org.junit.Test; 14 | 15 | import java.io.IOException; 16 | import java.util.List; 17 | import java.util.concurrent.ExecutionException; 18 | 19 | public class OdoCliProjectTest extends OdoCliTest { 20 | 21 | @Test 22 | public void testCheckCreateProject() throws IOException, ExecutionException, InterruptedException { 23 | String project = PROJECT_PREFIX + random.nextInt(); 24 | try { 25 | List projects = odo.getNamespaces(); 26 | assertFalse(projects.isEmpty()); 27 | createProject(project); 28 | assertEquals(projects.size()+1, odo.getNamespaces().size()); 29 | } finally { 30 | odo.deleteProject(project); 31 | } 32 | } 33 | 34 | @Test 35 | public void testCheckListProjects() throws IOException, ExecutionException, InterruptedException { 36 | String project = PROJECT_PREFIX + random.nextInt(); 37 | try { 38 | createProject(project); 39 | List projects = odo.getNamespaces(); 40 | assertFalse(projects.isEmpty()); 41 | assertTrue(projects.contains(project)); 42 | } finally { 43 | odo.deleteProject(project); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/it/projects/go.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/it/projects/go.zip -------------------------------------------------------------------------------- /src/it/projects/nodejs.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/it/projects/nodejs.zip -------------------------------------------------------------------------------- /src/it/projects/springboot-rest.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/it/projects/springboot-rest.zip -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/KubernetesLabels.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift; 12 | 13 | public final class KubernetesLabels { 14 | 15 | private KubernetesLabels() { 16 | //prevent instantiation 17 | } 18 | 19 | public static final String COMPONENT_NAME_LABEL = "app.kubernetes.io/instance"; 20 | 21 | public static final String COMPONENT_LABEL = "app.kubernetes.io/component"; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/NotificationUtils.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions; 12 | 13 | import com.intellij.notification.Notification; 14 | import com.intellij.notification.NotificationType; 15 | import com.intellij.notification.Notifications; 16 | import org.jboss.tools.intellij.openshift.Constants; 17 | 18 | public class NotificationUtils { 19 | public static Notification notifyInformation(String title, String content) { 20 | Notification notification = new Notification( 21 | Constants.GROUP_DISPLAY_ID, 22 | title, 23 | content, 24 | NotificationType.INFORMATION); 25 | Notifications.Bus.notify(notification); 26 | return notification; 27 | } 28 | 29 | public static Notification notifyError(String title, String content) { 30 | Notification notification = new Notification( 31 | Constants.GROUP_DISPLAY_ID, 32 | title, 33 | content, 34 | NotificationType.ERROR); 35 | Notifications.Bus.notify(notification); 36 | return notification; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/OcAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions; 12 | 13 | import com.intellij.openapi.actionSystem.AnActionEvent; 14 | import org.jboss.tools.intellij.openshift.telemetry.TelemetrySender; 15 | import org.jboss.tools.intellij.openshift.utils.oc.Oc; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | import javax.swing.tree.TreePath; 19 | 20 | import static org.jboss.tools.intellij.openshift.telemetry.TelemetryService.PREFIX_ACTION; 21 | 22 | public abstract class OcAction extends TelemetryAction { 23 | 24 | protected OcAction(Class... filters) { 25 | super(filters); 26 | } 27 | 28 | @Override 29 | public void actionPerformed(AnActionEvent anActionEvent, TreePath path, Object selected) { 30 | setTelemetrySender(new TelemetrySender(PREFIX_ACTION + getTelemetryActionName())); 31 | ActionUtils.getApplicationRootNode(anActionEvent).getOcTool() 32 | .whenComplete( 33 | (ocTool, throwable) -> { 34 | if (ocTool != null) { 35 | Oc oc = ocTool.get(); 36 | if (oc != null) { 37 | this.actionPerformedOnSelectedObject(anActionEvent, getElement(selected), oc); 38 | } 39 | } 40 | } 41 | ); 42 | } 43 | 44 | public abstract void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object selected, @NotNull Oc oc); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/binding/ShowBindingDetailsAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.binding; 12 | 13 | import com.intellij.openapi.actionSystem.AnActionEvent; 14 | import org.jboss.tools.intellij.openshift.actions.OdoAction; 15 | import org.jboss.tools.intellij.openshift.telemetry.TelemetryService; 16 | import org.jboss.tools.intellij.openshift.tree.application.BindingNode; 17 | import org.jboss.tools.intellij.openshift.ui.binding.BindingDetailDialog; 18 | import org.jboss.tools.intellij.openshift.utils.odo.OdoFacade; 19 | import org.jetbrains.annotations.NotNull; 20 | 21 | public class ShowBindingDetailsAction extends OdoAction { 22 | public ShowBindingDetailsAction() { 23 | super(BindingNode.class); 24 | } 25 | 26 | @Override 27 | public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object selected, @NotNull OdoFacade odo) { 28 | BindingNode node = (BindingNode) selected; 29 | BindingDetailDialog dialog = new BindingDetailDialog(anActionEvent.getProject(), null, node.getBinding()); 30 | dialog.show(); 31 | sendTelemetryResults(TelemetryService.TelemetryResult.SUCCESS); 32 | } 33 | 34 | @Override 35 | public String getTelemetryActionName() { 36 | return "show binding"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/cluster/LoggedInClusterAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.cluster; 12 | 13 | import org.jboss.tools.intellij.openshift.actions.OdoAction; 14 | import org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode; 15 | 16 | public abstract class LoggedInClusterAction extends OdoAction { 17 | 18 | protected LoggedInClusterAction() { 19 | super(ApplicationsRootNode.class); 20 | } 21 | 22 | @Override 23 | public boolean isVisible(Object selected) { 24 | boolean visible = super.isVisible(selected); 25 | if (selected instanceof ApplicationsRootNode) { 26 | visible = ((ApplicationsRootNode) selected).isLogged(); 27 | } 28 | return visible; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/component/ContextAwareComponentAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import org.jboss.tools.intellij.openshift.actions.OdoAction; 14 | import org.jboss.tools.intellij.openshift.tree.application.ComponentNode; 15 | 16 | public abstract class ContextAwareComponentAction extends OdoAction { 17 | protected ContextAwareComponentAction() { 18 | super(ComponentNode.class); 19 | } 20 | 21 | @Override 22 | public boolean isVisible(Object selected) { 23 | boolean visible = super.isVisible(selected); 24 | if (visible && selected instanceof ComponentNode) { 25 | visible = ((ComponentNode)selected).getComponent().hasContext(); 26 | } 27 | return visible; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/component/DeployComponentAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.Component; 14 | import org.jboss.tools.intellij.openshift.utils.odo.ComponentFeature; 15 | 16 | public class DeployComponentAction extends FeatureComponentAction { 17 | public DeployComponentAction() { 18 | super(ComponentFeature.DEPLOY); 19 | } 20 | 21 | @Override 22 | protected String getCustomizedPresentation(Component component) { 23 | return ""; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/component/DevComponentAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.Component; 14 | import org.jboss.tools.intellij.openshift.utils.odo.ComponentFeature; 15 | 16 | public class DevComponentAction extends FeatureComponentAction { 17 | public DevComponentAction() { 18 | super(ComponentFeature.DEV); 19 | } 20 | 21 | @Override 22 | protected boolean needCustomizedPresentation() { 23 | return true; 24 | } 25 | 26 | @Override 27 | protected String getCustomizedPresentation(Component component) { 28 | if (component.getLiveFeatures().is(ComponentFeature.DEV)) { 29 | return "Stop " + getActionName(); 30 | } else { 31 | return "Start " + getActionName(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/component/FollowLogComponentAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import com.intellij.openapi.actionSystem.AnActionEvent; 14 | import org.jboss.tools.intellij.openshift.tree.application.ComponentNode; 15 | import org.jboss.tools.intellij.openshift.utils.odo.OdoFacade; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class FollowLogComponentAction extends ShowLogComponentAction { 19 | 20 | @Override 21 | public String getTelemetryActionName() {return "follow component log";} 22 | 23 | @Override 24 | public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object selected, @NotNull OdoFacade odo) { 25 | doLog((ComponentNode) selected, odo, true); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/actions/url/OpenInBrowserAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.url; 12 | 13 | import com.intellij.ide.BrowserUtil; 14 | import com.intellij.openapi.actionSystem.AnActionEvent; 15 | import org.jboss.tools.intellij.openshift.actions.OdoAction; 16 | import org.jboss.tools.intellij.openshift.tree.application.URLNode; 17 | import org.jboss.tools.intellij.openshift.utils.odo.OdoFacade; 18 | import org.jboss.tools.intellij.openshift.utils.odo.URL; 19 | import org.jetbrains.annotations.NotNull; 20 | 21 | import static org.jboss.tools.intellij.openshift.telemetry.TelemetryService.TelemetryResult; 22 | 23 | public class OpenInBrowserAction extends OdoAction { 24 | public OpenInBrowserAction() { 25 | super(URLNode.class); 26 | } 27 | 28 | @Override 29 | public String getTelemetryActionName() {return "open URL";} 30 | 31 | @Override 32 | public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object selected, @NotNull OdoFacade odo) { 33 | BrowserUtil.open(getURL(((URLNode) selected).getUrl())); 34 | sendTelemetryResults(TelemetryResult.SUCCESS); 35 | } 36 | 37 | protected String getURL(URL url) { 38 | return url.asURL(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/AccountStatus.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth; 12 | 13 | public enum AccountStatus { 14 | VALID, NEEDS_REFRESH, NEEDS_LOGIN 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/DefaultTokenProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth; 12 | 13 | import com.intellij.openapi.components.Service; 14 | import org.jboss.tools.intellij.openshift.oauth.exception.OAuthException; 15 | 16 | /** 17 | * Delegates to the account service as we don't control the lifecycle of a token provider 18 | */ 19 | @Service 20 | public final class DefaultTokenProvider implements TokenProvider { 21 | 22 | @Override 23 | public String getToken(String serverId, int tokenType, Object context) throws OAuthException { 24 | return AccountService.getDefault().getToken(serverId, tokenType, context); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/LoginProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth; 12 | 13 | import com.intellij.openapi.application.ApplicationManager; 14 | import org.jboss.tools.intellij.openshift.oauth.model.IAuthorizationServer; 15 | import org.jboss.tools.intellij.openshift.oauth.ui.DefaultLoginProvider; 16 | 17 | /** 18 | * A login provider responsible for performing login to OAuth authorization server. 19 | * This involves UI. 20 | */ 21 | public interface LoginProvider { 22 | LoginResponse login(IAuthorizationServer server, Object context); 23 | 24 | static LoginProvider get() { 25 | return ApplicationManager.getApplication().getService(DefaultLoginProvider.class); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/OAuthCoreConstants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth; 12 | 13 | public final class OAuthCoreConstants { 14 | 15 | private OAuthCoreConstants() { 16 | } 17 | 18 | public static final long DURATION_24_HOURS = 24 * 3600 * 1000L; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/TokenProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth; 12 | 13 | import com.intellij.openapi.application.ApplicationManager; 14 | import org.jboss.tools.intellij.openshift.oauth.exception.OAuthException; 15 | 16 | public interface TokenProvider { 17 | 18 | int ID_TOKEN = 0; 19 | int ACCESS_TOKEN = 1; 20 | int REFRESH_TOKEN = 2; 21 | 22 | String getToken(String serverId, int tokentype, Object context) throws OAuthException; 23 | 24 | static TokenProvider get() { 25 | return ApplicationManager.getApplication().getService(DefaultTokenProvider.class); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/exception/OAuthConfigurationException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth.exception; 12 | 13 | public class OAuthConfigurationException extends OAuthException { 14 | 15 | public OAuthConfigurationException(String message) { 16 | super(message); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/exception/OAuthException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth.exception; 12 | 13 | import java.io.Serial; 14 | 15 | public abstract class OAuthException extends RuntimeException { 16 | 17 | @Serial 18 | private static final long serialVersionUID = -66495414279364584L; 19 | 20 | protected OAuthException(String message) { 21 | super(message); 22 | } 23 | 24 | protected OAuthException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/exception/OAuthLoginException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth.exception; 12 | 13 | import org.jboss.tools.intellij.openshift.oauth.model.IAccount; 14 | import org.jboss.tools.intellij.openshift.oauth.model.IAuthorizationServer; 15 | 16 | public class OAuthLoginException extends OAuthException { 17 | 18 | private final IAccount account; 19 | 20 | public OAuthLoginException(IAuthorizationServer server, IAccount account) { 21 | super("Error login to authorization server " + server.getDisplayName()); 22 | this.account = account; 23 | } 24 | 25 | /** 26 | * @return the account 27 | */ 28 | public IAccount getAccount() { 29 | return account; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/exception/OAuthRefreshException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth.exception; 12 | 13 | import org.jboss.tools.intellij.openshift.oauth.model.IAccount; 14 | 15 | public class OAuthRefreshException extends OAuthException { 16 | 17 | private final IAccount account; 18 | private final int status; 19 | 20 | public static final int NO_STATUS = -1; 21 | 22 | public OAuthRefreshException(IAccount account, Throwable t) { 23 | super("Error refreshing token for " + account.getId() + " on autorization server " + account.getAuthorizationServer().getId(), t); 24 | this.account = account; 25 | this.status = NO_STATUS; 26 | } 27 | 28 | /** 29 | * @return the account 30 | */ 31 | public IAccount getAccount() { 32 | return account; 33 | } 34 | 35 | /** 36 | * @return the status 37 | */ 38 | public int getStatus() { 39 | return status; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/model/IAccountModel.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth.model; 12 | 13 | import java.util.List; 14 | 15 | public interface IAccountModel { 16 | 17 | List getAuthorizationServers(); 18 | 19 | IAuthorizationServer createAuthorizationServer(String id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/oauth/model/IAuthorizationServer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.oauth.model; 12 | 13 | import com.intellij.util.xmlb.annotations.Attribute; 14 | 15 | import java.util.List; 16 | 17 | public interface IAuthorizationServer { 18 | String getId(); 19 | 20 | String getRealm(); 21 | 22 | void setRealm(String reaml); 23 | 24 | String getURL(); 25 | 26 | void setURL(String url); 27 | 28 | String getClientId(); 29 | 30 | void setClientId(String clientId); 31 | 32 | String getDisplayName(); 33 | 34 | void addAccount(IAccount account); 35 | 36 | @Attribute 37 | List getAccounts(); 38 | 39 | IAccount createAccount(String id); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/settings/SettingsState.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.settings; 12 | 13 | import com.intellij.openapi.application.ApplicationManager; 14 | import com.intellij.openapi.components.PersistentStateComponent; 15 | import com.intellij.openapi.components.State; 16 | import com.intellij.openapi.components.Storage; 17 | import com.intellij.util.xmlb.XmlSerializerUtil; 18 | import org.jetbrains.annotations.NotNull; 19 | import org.jetbrains.annotations.Nullable; 20 | 21 | @State( 22 | name = "com.redhat.devtools.intellij.openshift.settings.SettingsState", 23 | storages = {@Storage("OpenShiftSettingsPlugin.xml")} 24 | ) 25 | public class SettingsState implements PersistentStateComponent { 26 | 27 | public String courseVersion = "0.0"; 28 | 29 | public static SettingsState getInstance() { 30 | return ApplicationManager.getApplication().getService(SettingsState.class); 31 | } 32 | 33 | @Nullable 34 | @Override 35 | public SettingsState getState() { 36 | return this; 37 | } 38 | 39 | @Override 40 | public void loadState(@NotNull SettingsState state) { 41 | XmlSerializerUtil.copyBean(state, this); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/telemetry/TelemetryHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.telemetry; 12 | 13 | import static org.jboss.tools.intellij.openshift.telemetry.TelemetryService.TelemetryResult; 14 | 15 | public interface TelemetryHandler { 16 | 17 | void sendTelemetryResults(TelemetryResult result); 18 | 19 | void sendTelemetryError(String message); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/telemetry/TelemetrySenderAware.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.telemetry; 12 | 13 | public interface TelemetrySenderAware { 14 | void setTelemetrySender(TelemetrySender telemetrySender); 15 | 16 | String getTelemetryActionName(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/BindingNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.Binding; 14 | 15 | public class BindingNode extends BaseNode { 16 | private final Binding binding; 17 | 18 | public BindingNode(ComponentNode parent, Binding binding) { 19 | super(parent.getRoot(), parent, binding.getName()); 20 | this.binding = binding; 21 | } 22 | 23 | public Binding getBinding() { 24 | return binding; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/ChangeActiveProjectLinkNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import com.redhat.devtools.intellij.common.tree.LinkElement; 14 | import org.jboss.tools.intellij.openshift.actions.project.ChangeActiveProjectAction; 15 | import org.jboss.tools.intellij.openshift.utils.odo.Odo; 16 | 17 | public class ChangeActiveProjectLinkNode extends MessageNode implements LinkElement { 18 | 19 | protected ChangeActiveProjectLinkNode(ApplicationsRootNode root, NamespaceNode parent) { 20 | super(root, parent, getLabel(root)); 21 | } 22 | 23 | @Override 24 | public void execute() { 25 | ChangeActiveProjectAction.execute(getParent()); 26 | } 27 | 28 | private static String getLabel(ApplicationsRootNode root) { 29 | Odo odo = root.getOdo().getNow(null); 30 | String label = "Missing %s, choose or create a different one"; 31 | if (odo == null) { 32 | return String.format(label, "project/namespace"); 33 | } else { 34 | return String.format(label, odo.getNamespaceKind().toLowerCase()); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/ChartReleaseNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.helm.ChartRelease; 14 | 15 | public class ChartReleaseNode extends BaseNode { 16 | 17 | private final ChartRelease release; 18 | 19 | public ChartReleaseNode(NamespaceNode parent, ChartRelease release) { 20 | super(parent.getRoot(), parent, release.getName()); 21 | this.release = release; 22 | } 23 | 24 | public ChartRelease getRelease() { 25 | return release; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/ComponentNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.Component; 14 | 15 | public class ComponentNode extends BaseNode { 16 | private final Component component; 17 | 18 | public ComponentNode(NamespaceNode parent, Component component) { 19 | super(parent.getRoot(), parent, component.getName()); 20 | this.component = component; 21 | } 22 | 23 | public Component getComponent() { 24 | return component; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/CreateComponentLinkNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import com.redhat.devtools.intellij.common.tree.LinkElement; 14 | import org.jboss.tools.intellij.openshift.actions.component.CreateComponentAction; 15 | 16 | public class CreateComponentLinkNode extends MessageNode implements LinkElement { 17 | protected CreateComponentLinkNode(ApplicationsRootNode root, NamespaceNode parent) { 18 | super(root, parent, "No deployments, click here to create one."); 19 | } 20 | 21 | @Override 22 | public void execute() { 23 | CreateComponentAction.execute(getParent()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/CreateNamespaceLinkNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import com.redhat.devtools.intellij.common.tree.LinkElement; 14 | import org.jboss.tools.intellij.openshift.actions.project.CreateProjectAction; 15 | 16 | public class CreateNamespaceLinkNode extends MessageNode implements LinkElement { 17 | protected CreateNamespaceLinkNode(ApplicationsRootNode root) { 18 | super(root, root, "No namespaces/projects, click here to create one."); 19 | } 20 | 21 | @Override 22 | public void execute() { 23 | CreateProjectAction.execute(getParent()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/DevfileRegistriesNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | public class DevfileRegistriesNode extends BaseNode { 14 | 15 | public DevfileRegistriesNode(ApplicationsRootNode root) { 16 | super(root, null, ""); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/DevfileRegistryComponentTypeNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.DevfileComponentType; 14 | 15 | public class DevfileRegistryComponentTypeNode extends BaseNode { 16 | private final DevfileComponentType componentType; 17 | 18 | public DevfileRegistryComponentTypeNode(ApplicationsRootNode root, DevfileRegistryNode parent, DevfileComponentType componentType) { 19 | super(root, parent, componentType.getName()); 20 | this.componentType = componentType; 21 | } 22 | 23 | public DevfileComponentType getComponentType() { 24 | return componentType; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/DevfileRegistryComponentTypeStarterNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.Starter; 14 | 15 | public class DevfileRegistryComponentTypeStarterNode extends BaseNode { 16 | private final Starter starter; 17 | 18 | public DevfileRegistryComponentTypeStarterNode(ApplicationsRootNode root, DevfileRegistryComponentTypeNode parent, Starter starter) { 19 | super(root, parent, starter.getName()); 20 | this.starter = starter; 21 | } 22 | 23 | public Starter getStarter() { 24 | return starter; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/DevfileRegistryNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.DevfileRegistry; 14 | 15 | public class DevfileRegistryNode extends BaseNode { 16 | private final DevfileRegistry registry; 17 | 18 | public DevfileRegistryNode(ApplicationsRootNode root, DevfileRegistriesNode parent, DevfileRegistry registry) { 19 | super(root, parent, registry.getName()); 20 | this.registry = registry; 21 | } 22 | 23 | public DevfileRegistry getRegistry() { 24 | return registry; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/HelmRepositoriesNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | public class HelmRepositoriesNode extends BaseNode { 14 | public HelmRepositoriesNode(ApplicationsRootNode parent) { 15 | super(parent, parent, "Helm"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/HelmRepositoryNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.helm.HelmRepository; 14 | 15 | public class HelmRepositoryNode extends BaseNode { 16 | 17 | private final HelmRepository repository; 18 | 19 | public HelmRepositoryNode(ApplicationsRootNode root, HelmRepositoriesNode parent, HelmRepository repository) { 20 | super(root, parent, repository.getName()); 21 | this.repository = repository; 22 | } 23 | 24 | public HelmRepository getRepository() { 25 | return repository; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/MessageNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | public class MessageNode extends BaseNode { 14 | protected MessageNode(ApplicationsRootNode root, T parent, String name) { 15 | super(root, parent, name); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/NamespaceNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | public class NamespaceNode extends BaseNode { 14 | public NamespaceNode(ApplicationsRootNode parent, String name) { 15 | super(parent, parent, name); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/ParentableNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | public interface ParentableNode { 14 | 15 | T getParent(); 16 | 17 | ApplicationsRootNode getRoot(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/ServiceNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.Service; 14 | 15 | public class ServiceNode extends BaseNode { 16 | 17 | private final Service service; 18 | 19 | public ServiceNode(NamespaceNode parent, Service service) { 20 | super(parent.getRoot(), parent, service.getName()); 21 | this.service = service; 22 | } 23 | 24 | public Service getService() { 25 | return service; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/StructureAwareNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | public interface StructureAwareNode { 14 | 15 | ApplicationsTreeStructure getStructure(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/tree/application/URLNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.tree.application; 12 | 13 | import org.jboss.tools.intellij.openshift.utils.odo.URL; 14 | 15 | public class URLNode extends BaseNode { 16 | private final URL url; 17 | 18 | public URLNode(ComponentNode parent, URL url) { 19 | super(parent.getRoot(), parent, url.getName()); 20 | this.url = url; 21 | } 22 | 23 | public URL getUrl() { 24 | return url; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/Icons.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui; 12 | 13 | import com.intellij.ui.IconManager; 14 | 15 | import javax.swing.Icon; 16 | 17 | public class Icons { 18 | 19 | public static final Icon SUCCESS_ICON = IconManager.getInstance().getIcon("/images/success.png", Icons.class); 20 | public static final Icon ERROR_ICON = IconManager.getInstance().getIcon("/images/error.png", Icons.class); 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/StatusIcon.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui; 12 | 13 | import com.intellij.ui.AnimatedIcon; 14 | import com.intellij.ui.components.JBLabel; 15 | import com.intellij.util.ui.EmptyIcon; 16 | 17 | import javax.swing.Icon; 18 | import javax.swing.JLabel; 19 | 20 | public class StatusIcon { 21 | 22 | private JLabel label; 23 | 24 | public void setEmpty() { 25 | set(EmptyIcon.ICON_16, null); 26 | } 27 | 28 | public void setLoading() { 29 | set(AnimatedIcon.Default.INSTANCE, null); 30 | } 31 | 32 | public void setSuccess(String message) { 33 | set(Icons.SUCCESS_ICON, message); 34 | } 35 | 36 | public void setError(String message) { 37 | set(Icons.ERROR_ICON, message); 38 | } 39 | 40 | public JLabel get() { 41 | if (label == null) { 42 | this.label = create(); 43 | } 44 | return label; 45 | } 46 | 47 | private void set(Icon icon, String message) { 48 | JLabel label = get(); 49 | label.setIcon(icon); 50 | label.setText(message); 51 | } 52 | 53 | private JLabel create() { 54 | JLabel label = new JBLabel(); 55 | label.setIcon(EmptyIcon.ICON_16); 56 | return label; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/cluster/TokenExtractor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui.cluster; 12 | 13 | import org.jsoup.Jsoup; 14 | import org.jsoup.nodes.Document; 15 | 16 | /** 17 | * Helper class to handle Openshift token authentication response 18 | */ 19 | public class TokenExtractor { 20 | 21 | private final Document doc; 22 | 23 | public TokenExtractor(String content) { 24 | doc = Jsoup.parse(content); 25 | } 26 | 27 | public boolean isTokenPage() { 28 | return doc.select("h2").text().contains("Your API token is"); 29 | } 30 | 31 | public String getToken() { 32 | return doc.select("h2").next().select("code").text(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/component/CreateComponentDialog.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui.component; 12 | 13 | import com.intellij.openapi.project.Project; 14 | import com.intellij.ui.wizard.WizardDialog; 15 | 16 | public class CreateComponentDialog extends WizardDialog { 17 | public CreateComponentDialog(Project project, boolean canBeParent, CreateComponentModel model) { 18 | super(project, canBeParent, model); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/component/ModuleSelectionDialog.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/helm/ChartPanel.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui.helm; 12 | 13 | public interface ChartPanel { 14 | void setChart(ChartVersions chart); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/helm/install/LoadingPanel.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui.helm.install; 12 | 13 | import com.intellij.ui.AnimatedIcon; 14 | import com.intellij.ui.components.JBLabel; 15 | import javax.swing.JPanel; 16 | import net.miginfocom.swing.MigLayout; 17 | 18 | class LoadingPanel extends JPanel { 19 | 20 | LoadingPanel() { 21 | super(new MigLayout("fill, hidemode 3")); 22 | createComponents(); 23 | } 24 | 25 | private void createComponents() { 26 | add(new JBLabel(AnimatedIcon.Default.INSTANCE), "pushx, pushy, growx, growy, align 50% 50%, height 200:200:200"); 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/sandbox/CountryCodeValidator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui.sandbox; 12 | 13 | import com.intellij.openapi.ui.ValidationInfo; 14 | 15 | import javax.swing.text.JTextComponent; 16 | import java.util.function.Supplier; 17 | import java.util.regex.Pattern; 18 | 19 | public class CountryCodeValidator implements Supplier { 20 | private final JTextComponent component; 21 | 22 | private static final Pattern pattern = Pattern 23 | .compile("^[+]?\\d{1,3}$"); 24 | 25 | public CountryCodeValidator(JTextComponent component) { 26 | this.component = component; 27 | } 28 | 29 | @Override 30 | public ValidationInfo get() { 31 | String text = component.getText(); 32 | if (text.isEmpty()) { 33 | return new ValidationInfo("Please provide a country code", component); 34 | } 35 | if (pattern.matcher(text).matches()) { 36 | return null; 37 | } 38 | return new ValidationInfo("Country code must be a number", component); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/sandbox/PhoneNumberValidator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui.sandbox; 12 | 13 | import com.intellij.openapi.ui.ValidationInfo; 14 | 15 | import javax.swing.text.JTextComponent; 16 | import java.util.function.Supplier; 17 | import java.util.regex.Pattern; 18 | 19 | public class PhoneNumberValidator implements Supplier { 20 | private final JTextComponent component; 21 | 22 | private static final Pattern pattern = Pattern 23 | .compile("^[(]?\\d{2,3}[)]?[ \\-./]?\\d{2,3}[ \\-./]?\\d{2,4}[ \\-./]?\\d{0,4}[ \\-./]?\\d{0,4}$", Pattern.CASE_INSENSITIVE); 24 | 25 | public PhoneNumberValidator(JTextComponent component) { 26 | this.component = component; 27 | } 28 | 29 | @Override 30 | public ValidationInfo get() { 31 | String text = component.getText(); 32 | if (text.isEmpty()) { 33 | return new ValidationInfo("Please provide a phone number", component); 34 | } 35 | if (pattern.matcher(text).matches()) { 36 | if (text.chars().allMatch(Character::isDigit) && text.length() < 7) { 37 | return new ValidationInfo("Phone number should be at least 7 digits", component); 38 | } 39 | return null; 40 | } 41 | return new ValidationInfo("Phone number should be digits optionally separated by space or '-' or '.' or '/'", component); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/sandbox/SandboxAPI.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui.sandbox; 12 | 13 | import com.fasterxml.jackson.databind.node.ObjectNode; 14 | import okhttp3.ResponseBody; 15 | import retrofit2.Call; 16 | import retrofit2.http.GET; 17 | import retrofit2.http.Header; 18 | import retrofit2.http.Body; 19 | import retrofit2.http.POST; 20 | import retrofit2.http.PUT; 21 | import retrofit2.http.Path; 22 | 23 | /** 24 | * @author Red Hat Developers 25 | * 26 | */ 27 | 28 | public interface SandboxAPI { 29 | 30 | @GET("api/v1/signup") 31 | Call signupState(@Header("Authorization") String token); 32 | 33 | @POST("api/v1/signup") 34 | Call signup(@Header("Authorization") String token); 35 | 36 | @PUT("api/v1/signup/verification") 37 | Call verify(@Header("Authorization") String token, @Body ObjectNode body); 38 | 39 | @GET("api/v1/signup/verification/{code}") 40 | Call completeVerify(@Header("Authorization") String token, @Path("code") String code); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/sandbox/SandboxDialog.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.ui.sandbox; 12 | 13 | import com.intellij.openapi.project.Project; 14 | import com.intellij.openapi.wm.WindowManager; 15 | import com.intellij.ui.wizard.WizardDialog; 16 | 17 | import java.awt.Dimension; 18 | import java.awt.Frame; 19 | 20 | public class SandboxDialog extends WizardDialog { 21 | private final Project project; 22 | 23 | public SandboxDialog(Project project, boolean canBeParent, SandboxModel model) { 24 | super(project, canBeParent, model); 25 | this.project = project; 26 | } 27 | 28 | @Override 29 | protected Dimension getWindowPreferredSize() { 30 | Frame f = WindowManager.getInstance().getFrame(project); 31 | return new Dimension(f.getWidth() * 3 / 4, f.getHeight() * 3 / 4); 32 | } 33 | 34 | @Override 35 | public void onStepChanged() { 36 | super.onStepChanged(); 37 | if (myModel.getCurrentStep() instanceof SandboxLoginPage) { 38 | getRootPane().setDefaultButton(null); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/ui/sandbox/SandboxLoginPage.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/ClientAwareCli.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils; 12 | 13 | import io.fabric8.kubernetes.client.KubernetesClient; 14 | 15 | public class ClientAwareCli extends Cli{ 16 | 17 | protected final KubernetesClient client; 18 | 19 | protected ClientAwareCli(String command, KubernetesClient client) { 20 | super(command); 21 | this.client = client; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/Serialization.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils; 12 | 13 | import com.fasterxml.jackson.core.JsonFactory; 14 | import com.fasterxml.jackson.databind.ObjectMapper; 15 | import com.fasterxml.jackson.databind.deser.std.StdNodeBasedDeserializer; 16 | import com.fasterxml.jackson.databind.module.SimpleModule; 17 | 18 | import java.util.List; 19 | 20 | public class Serialization { 21 | 22 | private static final ObjectMapper defaultMapper = new ObjectMapper(new JsonFactory()); 23 | 24 | public static ObjectMapper json() { 25 | return defaultMapper; 26 | } 27 | 28 | private Serialization() {} 29 | 30 | public static ObjectMapper configure(final StdNodeBasedDeserializer> deserializer) { 31 | final SimpleModule module = new SimpleModule(); 32 | module.addDeserializer(List.class, deserializer); 33 | return new ObjectMapper(new JsonFactory()).registerModule(module); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/helm/Chart.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.helm; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 14 | 15 | import java.util.Objects; 16 | 17 | @JsonIgnoreProperties(ignoreUnknown = true) 18 | public class Chart { 19 | private String name; 20 | private String version; 21 | private String description; 22 | 23 | public Chart() { 24 | } 25 | 26 | public Chart(String name, String version, String description) { 27 | this.name = name; 28 | this.version = version; 29 | this.description = description; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public String getVersion() { 37 | return version; 38 | } 39 | 40 | public String getDescription() { 41 | return description; 42 | } 43 | 44 | @Override 45 | public boolean equals(Object o) { 46 | if (this == o) return true; 47 | if (!(o instanceof Chart)) return false; 48 | Chart chart = (Chart) o; 49 | return Objects.equals(name, chart.name) 50 | && Objects.equals(version, chart.version) 51 | && Objects.equals(description, chart.description); 52 | } 53 | 54 | @Override 55 | public int hashCode() { 56 | return Objects.hash(name, version, description); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/helm/Helm.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.helm; 12 | 13 | import java.io.File; 14 | import java.io.IOException; 15 | import java.util.List; 16 | 17 | public interface Helm { 18 | 19 | String addRepo(String name, String url, String flags) throws IOException; 20 | 21 | void removeRepos(String... name) throws IOException; 22 | 23 | List listRepos() throws IOException; 24 | 25 | List search() throws IOException; 26 | 27 | List search(String regex) throws IOException; 28 | 29 | List list() throws IOException; 30 | 31 | String install(String name, String chart, String version, File valuesFile) throws IOException; 32 | 33 | String uninstall(String... names) throws IOException; 34 | 35 | HelmCli.HelmEnv env() throws IOException; 36 | 37 | String showValues(String chart) throws IOException; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/helm/HelmRepository.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.helm; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 14 | 15 | @JsonIgnoreProperties(ignoreUnknown = true) 16 | public class HelmRepository { 17 | 18 | private String name; 19 | private String url; 20 | 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | 29 | public String getUrl() { 30 | return url; 31 | } 32 | 33 | public void setUrl(String url) { 34 | this.url = url; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/oc/Oc.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.oc; 12 | 13 | import java.io.IOException; 14 | import java.net.URL; 15 | 16 | public interface Oc { 17 | 18 | void login(String url, String userName, char[] password, char[] token) throws IOException; 19 | 20 | URL getMasterUrl(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/AbstractComponentType.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | public abstract class AbstractComponentType implements ComponentType { 14 | private final String name; 15 | 16 | protected AbstractComponentType(String name) { 17 | this.name = name; 18 | } 19 | 20 | @Override 21 | public String getName() { 22 | return this.name; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return getName(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/Binding.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import java.util.List; 14 | 15 | public interface Binding { 16 | String getName(); 17 | Service getService(); 18 | List getEnvironmentVariables(); 19 | 20 | static Binding of(String name, Service service, List bindingEnvVars) { 21 | return new Binding() { 22 | @Override 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | @Override 28 | public Service getService() { 29 | return service; 30 | } 31 | 32 | @Override 33 | public List getEnvironmentVariables() { 34 | return bindingEnvVars; 35 | } 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/ComponentDescriptor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | public class ComponentDescriptor { 14 | private final String managedByVersion; 15 | private final String path; 16 | private final String name; 17 | 18 | private final String managedBy; 19 | 20 | public ComponentDescriptor(String name, String path, String managedBy, String managedByVersion) { 21 | this.name = name; 22 | this.path = path; 23 | this.managedBy = managedBy; 24 | this.managedByVersion = managedByVersion; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | public String getManagedBy() { 31 | return managedBy; 32 | } 33 | public String getPath() { 34 | return path; 35 | } 36 | 37 | public boolean isPreOdo3() { 38 | return "odo".equals(managedBy) && managedByVersion != null && managedByVersion.length() > 1 39 | && managedByVersion.charAt(1) - '0' < 3; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/ComponentKind.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | public enum ComponentKind { 14 | DEVFILE("devfile"), 15 | OTHER("other"); 16 | 17 | private final String label; 18 | 19 | ComponentKind(String label) { 20 | this.label = label; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return label; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/ComponentMetadata.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | public interface ComponentMetadata { 14 | String getRegistry(); 15 | String getComponentType(); 16 | 17 | static ComponentMetadata of(String registry, String componentType) { 18 | return new ComponentMetadata() { 19 | @Override 20 | public String getRegistry() { 21 | return registry; 22 | } 23 | 24 | @Override 25 | public String getComponentType() { 26 | return componentType; 27 | } 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/ComponentType.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | public interface ComponentType { 14 | String getName(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/ComponentTypeInfo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | /** 17 | * @author Red Hat Developers 18 | * 19 | */ 20 | public interface ComponentTypeInfo { 21 | List getStarters(); 22 | 23 | class Builder { 24 | 25 | private final List starters = new ArrayList<>(); 26 | 27 | 28 | public Builder withStarter(Starter starter) { 29 | starters.add(starter); 30 | return this; 31 | } 32 | 33 | public ComponentTypeInfo build() { 34 | return () -> starters; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/DebugComponentFeature.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import java.util.Collections; 14 | import java.util.List; 15 | 16 | public class DebugComponentFeature extends ComponentFeature { 17 | 18 | public DebugComponentFeature(ComponentFeature parent) { 19 | super(Mode.DEBUG_MODE, "debug", ComponentFeature.Constants.WATCHING_FOR_CHANGES_IN_THE_CURRENT_DIRECTORY, parent.getStartArgs()); 20 | } 21 | 22 | @Override 23 | public List getExtraArgs() { 24 | return Collections.singletonList("--debug"); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/DevfileComponentType.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | public final class DevfileComponentType extends AbstractComponentType { 14 | 15 | private final String displayName; 16 | private final String description; 17 | private final DevfileRegistry devfileRegistry; 18 | 19 | 20 | public DevfileComponentType(String name, String displayName, String description, DevfileRegistry devfileRegistry) { 21 | super(name); 22 | this.displayName = displayName; 23 | this.description = description; 24 | this.devfileRegistry = devfileRegistry; 25 | } 26 | 27 | public String getDisplayName() { 28 | return displayName; 29 | } 30 | 31 | public String getDescription() { 32 | return description; 33 | } 34 | 35 | public DevfileRegistry getDevfileRegistry() { 36 | return devfileRegistry; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return getDisplayName() + " (from " + devfileRegistry.getName() + ")"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/DevfileRegistry.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | public interface DevfileRegistry { 14 | String getName(); 15 | String getURL(); 16 | boolean isSecure(); 17 | 18 | static DevfileRegistry of(String name, String url, boolean secure) { 19 | return new DevfileRegistry() { 20 | @Override 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | @Override 26 | public String getURL() { 27 | return url; 28 | } 29 | 30 | @Override 31 | public boolean isSecure() { 32 | return secure; 33 | } 34 | }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/OdoDelegate.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import com.intellij.execution.process.ProcessAdapter; 14 | import com.intellij.execution.process.ProcessHandler; 15 | 16 | import java.io.IOException; 17 | import java.util.List; 18 | 19 | public interface OdoDelegate extends Odo { 20 | 21 | void start(String context, ComponentFeature feature, ProcessHandler handler, ProcessAdapter processAdapter) throws IOException; 22 | 23 | void stop(String context, ComponentFeature feature, ProcessHandler handler) throws IOException; 24 | 25 | void follow(String context, boolean deploy, String platform, List handlers) throws IOException; 26 | 27 | void log(String context, boolean deploy, String platform, List handlers) throws IOException; 28 | 29 | List getComponentsOnCluster(String project) throws IOException; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/OdoFacade.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import java.io.IOException; 14 | import java.util.List; 15 | import java.util.function.Consumer; 16 | 17 | public interface OdoFacade extends Odo { 18 | 19 | void start(String context, String component, ComponentFeature feature, 20 | Consumer callback, Consumer processTerminatedCallback) throws IOException; 21 | 22 | void stop(String context, String component, ComponentFeature feature) throws IOException; 23 | 24 | void follow(String context, String component, boolean deploy, String platform) throws IOException; 25 | 26 | void log(String context, String component, boolean deploy, String platform) throws IOException; 27 | 28 | boolean isStarted(String component, ComponentFeature feature); 29 | 30 | List getComponents(String project) throws IOException; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/OdoProcessHelper.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import com.intellij.execution.process.ProcessHandler; 14 | 15 | import java.util.HashMap; 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | public class OdoProcessHelper { 20 | 21 | /** 22 | * Map of process launched for feature (dev, debug,...) related. 23 | * Key is component name 24 | * Value is map index by the feature and value is the process handler 25 | */ 26 | private final Map> componentFeatureProcesses = new HashMap<>(); 27 | 28 | /** 29 | * Map of process launched for log activity. 30 | * Key is component name 31 | * Value is list with 2 process handler index 0 is dev; index 1 is deploy 32 | */ 33 | private final Map> componentLogProcesses = new HashMap<>(); 34 | 35 | public Map> getComponentFeatureProcesses() { 36 | return componentFeatureProcesses; 37 | } 38 | 39 | public Map> getComponentLogProcesses() { 40 | return componentLogProcesses; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/OperatorCRD.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import com.fasterxml.jackson.databind.JsonNode; 14 | 15 | import java.util.List; 16 | 17 | public interface OperatorCRD { 18 | String getName(); 19 | String getVersion(); 20 | String getKind(); 21 | String getDisplayName(); 22 | String getDescription(); 23 | JsonNode getSample(); 24 | JsonNode getSchema(); 25 | List getSpecDescriptors(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/OperatorCRDSpecDescriptor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import java.util.List; 14 | 15 | public interface OperatorCRDSpecDescriptor { 16 | String getPath(); 17 | String getDisplayName(); 18 | String getDescription(); 19 | List getDescriptors(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/Service.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | public interface Service { 14 | String getName(); 15 | String getApiVersion(); 16 | String getKind(); 17 | 18 | static Service of(String name, String apiVersion, String kind) { 19 | return new Service() { 20 | 21 | @Override 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | @Override 27 | public String getApiVersion() { 28 | return apiVersion; 29 | } 30 | 31 | @Override 32 | public String getKind() { 33 | return kind; 34 | } 35 | }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/ServiceTemplate.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | import java.util.List; 14 | 15 | public interface ServiceTemplate { 16 | String getName(); 17 | String getDisplayName(); 18 | List getCRDs(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/utils/odo/Starter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.utils.odo; 12 | 13 | /** 14 | * @author Red Hat Developers 15 | * 16 | */ 17 | public interface Starter { 18 | String getName(); 19 | String getDescription(); 20 | 21 | class Builder { 22 | private String name; 23 | private String description; 24 | 25 | public Builder withName(String name) { 26 | this.name = name; 27 | return this; 28 | } 29 | 30 | public Builder withDescription(String description) { 31 | this.description = description; 32 | return this; 33 | } 34 | 35 | public Starter build() { 36 | return new Starter() { 37 | 38 | @Override 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | @Override 44 | public String getDescription() { 45 | return description; 46 | } 47 | }; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/jboss/tools/intellij/openshift/validation/DevfileJsonSchemaProviderFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.validation; 12 | 13 | import com.intellij.openapi.project.Project; 14 | import com.jetbrains.jsonSchema.extension.JsonSchemaFileProvider; 15 | import com.jetbrains.jsonSchema.extension.JsonSchemaProviderFactory; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | import java.util.Collections; 19 | import java.util.List; 20 | 21 | public class DevfileJsonSchemaProviderFactory implements JsonSchemaProviderFactory { 22 | @Override 23 | public @NotNull List getProviders(@NotNull Project project) { 24 | return Collections.singletonList(new DevfileJsonSchemaFileProvider()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/plugin-openshift-validation-json.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/withJava.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/gettingstarted/browse-devfile-registries.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/gettingstarted/browse-devfile-registries.gif -------------------------------------------------------------------------------- /src/main/resources/gettingstarted/create-component.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/gettingstarted/create-component.gif -------------------------------------------------------------------------------- /src/main/resources/gettingstarted/login.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/gettingstarted/login.gif -------------------------------------------------------------------------------- /src/main/resources/gettingstarted/start-debug.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/gettingstarted/start-debug.gif -------------------------------------------------------------------------------- /src/main/resources/gettingstarted/start-deploy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/gettingstarted/start-deploy.gif -------------------------------------------------------------------------------- /src/main/resources/gettingstarted/start-dev.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/gettingstarted/start-dev.gif -------------------------------------------------------------------------------- /src/main/resources/images/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/application.png -------------------------------------------------------------------------------- /src/main/resources/images/chevron-down-solid-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/chevron-down-solid-dark.png -------------------------------------------------------------------------------- /src/main/resources/images/chevron-down-solid-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/chevron-down-solid-light.png -------------------------------------------------------------------------------- /src/main/resources/images/component-type-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/component-type-light.png -------------------------------------------------------------------------------- /src/main/resources/images/component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/component.png -------------------------------------------------------------------------------- /src/main/resources/images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/error.png -------------------------------------------------------------------------------- /src/main/resources/images/github-mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/github-mark.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/a10-thunder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/a10-thunder.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/backstage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/backstage.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/broadpeak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/broadpeak.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/cryostat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/cryostat.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/data-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/data-grid.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/eap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/eap.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/fiware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/fiware.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/flomesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/flomesh.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/ibm-cloud-object-storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/ibm-cloud-object-storage.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/ibm-operator-catalog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/ibm-operator-catalog.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/ibm-order-management.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/ibm-order-management.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/ibm-spectrum-protect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/ibm-spectrum-protect.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/infinispan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/infinispan.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/jenkins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/jenkins.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/kyverno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/kyverno.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/nearby-one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/nearby-one.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/node-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/node-red.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/rafay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/rafay.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/redhat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/redhat.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/repo.svg: -------------------------------------------------------------------------------- 1 | 2 | 15 | 17 | 35 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/resources/images/helm/solace-pubsub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/solace-pubsub.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/vault.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/vault.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/wildfly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/wildfly.png -------------------------------------------------------------------------------- /src/main/resources/images/helm/yugaware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/helm/yugaware.png -------------------------------------------------------------------------------- /src/main/resources/images/openshift_extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/openshift_extension.png -------------------------------------------------------------------------------- /src/main/resources/images/plus-solid-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/plus-solid-dark.png -------------------------------------------------------------------------------- /src/main/resources/images/plus-solid-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/plus-solid-light.png -------------------------------------------------------------------------------- /src/main/resources/images/project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/project.png -------------------------------------------------------------------------------- /src/main/resources/images/readme.txt: -------------------------------------------------------------------------------- 1 | registry.svg: from https://rawgit.com/patternfly/patternfly-design/master/styles/icons/patternfly-svg-icons.zip 2 | 3 | plus-solid.svg: blob:https://fontawesome.com/050091c3-f46f-4695-a80e-9b35bf0d4119 4 | chevron-down.svg: blob:https://fontawesome.com/593f8ba3-c8a6-4bb2-9308-54054f47b59a 5 | 6 | To make dark: sed -e 's/currentColor/#AFB1B3' file.svg >file-dark.svg 7 | To make light: sed -e 's/currentColor/#6E6E6E' file.svg >file.svg 8 | Then open file in GIMP, resize and export as PNG -------------------------------------------------------------------------------- /src/main/resources/images/service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/service.png -------------------------------------------------------------------------------- /src/main/resources/images/start-project-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/start-project-light.png -------------------------------------------------------------------------------- /src/main/resources/images/storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/storage.png -------------------------------------------------------------------------------- /src/main/resources/images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/success.png -------------------------------------------------------------------------------- /src/main/resources/images/url-node-secure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/url-node-secure.png -------------------------------------------------------------------------------- /src/main/resources/images/url-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/intellij-openshift-connector/e1ba88cbe62b79abd0b28c595f5e97d5eca22815/src/main/resources/images/url-node.png -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/OpenGettingStartedActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jetbrains.annotations.NotNull; 16 | 17 | public class OpenGettingStartedActionTest extends ActionTest { 18 | public OpenGettingStartedActionTest(boolean isOpenshift) { 19 | super(isOpenshift); 20 | } 21 | 22 | @Override 23 | public AnAction getAction() { 24 | return new OpenGettingStartedAction(); 25 | } 26 | 27 | @Override 28 | protected void verifyLoggedInCluster(@NotNull Presentation presentation) { 29 | assertTrue(presentation.isVisible()); 30 | } 31 | 32 | @Override 33 | protected void verifyLoggedOutCluster(@NotNull Presentation presentation) { 34 | assertTrue(presentation.isVisible()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/binding/DeleteBindingActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.binding; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class DeleteBindingActionTest extends ActionTest { 19 | public DeleteBindingActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new DeleteBindingAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyBinding(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/binding/ShowBindingDetailsActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.binding; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class ShowBindingDetailsActionTest extends ActionTest { 19 | public ShowBindingDetailsActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new ShowBindingDetailsAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyBinding(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/cluster/AboutActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.cluster; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class AboutActionTest extends ActionTest { 19 | public AboutActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new AboutAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyLoggedInCluster(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | 33 | @Override 34 | protected void verifyLoggedOutCluster(@NotNull Presentation presentation) { 35 | assertTrue(presentation.isVisible()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/cluster/LoginActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.cluster; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class LoginActionTest extends ActionTest { 19 | public LoginActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new LoginAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyLoggedInCluster(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | 33 | @Override 34 | protected void verifyLoggedOutCluster(@NotNull Presentation presentation) { 35 | assertTrue(presentation.isVisible()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/cluster/RefreshActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.cluster; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class RefreshActionTest extends ActionTest { 19 | public RefreshActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new RefreshAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyLoggedInCluster(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | 33 | @Override 34 | protected void verifyLoggedOutCluster(@NotNull Presentation presentation) { 35 | assertTrue(presentation.isVisible()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/component/CreateComponentActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class CreateComponentActionTest extends ActionTest { 19 | public CreateComponentActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new CreateComponentAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyProject(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/component/DebugJavaComponentActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 15 | 16 | public class DebugJavaComponentActionTest extends ActionTest { 17 | public DebugJavaComponentActionTest(boolean isOpenshift) { 18 | super(isOpenshift); 19 | } 20 | 21 | @Override 22 | public AnAction getAction() { 23 | return new DebugJavaComponentAction(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/component/DeployComponentActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 15 | 16 | public class DeployComponentActionTest extends ActionTest { 17 | public DeployComponentActionTest(boolean isOpenshift) { 18 | super(isOpenshift); 19 | } 20 | 21 | @Override 22 | public AnAction getAction() { 23 | return new DeployComponentAction(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/component/DevComponentActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class DevComponentActionTest extends ActionTest { 19 | 20 | public DevComponentActionTest(boolean isOpenshift) { 21 | super(isOpenshift); 22 | } 23 | 24 | @Override 25 | public AnAction getAction() { 26 | return new DevComponentAction(); 27 | } 28 | 29 | @Override 30 | protected void verifyLocalDevOnPodmanComponentWithDevSupportedFeatures(@NotNull Presentation presentation) { 31 | assertTrue(presentation.isVisible()); 32 | assertEquals("Start dev on Cluster", presentation.getText()); 33 | } 34 | 35 | @Override 36 | protected void verifyLocalDevComponentWithDevSupportedFeatures(@NotNull Presentation presentation) { 37 | assertTrue(presentation.isVisible()); 38 | assertEquals("Stop dev on Cluster", presentation.getText()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/component/DevOnPodmanComponentActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class DevOnPodmanComponentActionTest extends ActionTest { 19 | public DevOnPodmanComponentActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new DevOnPodmanComponentAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyLocalDevOnPodmanComponentWithDevSupportedFeatures(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | assertEquals("Stop dev on Podman", presentation.getText()); 32 | } 33 | 34 | @Override 35 | protected void verifyLocalDevComponentWithDevSupportedFeatures(@NotNull Presentation presentation) { 36 | assertTrue(presentation.isVisible()); 37 | assertEquals("Start dev on Podman", presentation.getText()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/component/OpenInBrowserActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.component; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jboss.tools.intellij.openshift.actions.url.OpenInBrowserAction; 17 | import org.jetbrains.annotations.NotNull; 18 | 19 | public class OpenInBrowserActionTest extends ActionTest { 20 | public OpenInBrowserActionTest(boolean isOpenshift) { 21 | super(isOpenshift); 22 | } 23 | 24 | @Override 25 | public AnAction getAction() { 26 | return new OpenInBrowserAction(); 27 | } 28 | 29 | @Override 30 | protected void verifyURL(@NotNull Presentation presentation) { 31 | assertTrue(presentation.isVisible()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/helm/AddHelmRepositoryActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.helm; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class AddHelmRepositoryActionTest extends ActionTest { 19 | public AddHelmRepositoryActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new AddHelmRepoAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyHelmRepositories(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/helm/EditHelmRepositoryActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.helm; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class EditHelmRepositoryActionTest extends ActionTest { 19 | public EditHelmRepositoryActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new EditHelmRepoAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyHelmRepository(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/helm/OpenHelmChartsActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.helm; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class OpenHelmChartsActionTest extends ActionTest { 19 | public OpenHelmChartsActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new OpenHelmChartsAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyProject(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/helm/RefreshActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.helm; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class RefreshActionTest extends ActionTest { 19 | public RefreshActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new RefreshAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyHelmRepositories(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/helm/RemoveHelmRepositoryActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.helm; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class RemoveHelmRepositoryActionTest extends ActionTest { 19 | public RemoveHelmRepositoryActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new RemoveRepositoriesAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyHelmRepository(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/helm/UninstallReleaseActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.helm; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class UninstallReleaseActionTest extends ActionTest { 19 | public UninstallReleaseActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new UninstallReleaseAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyChartRelease(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/project/ChangeActiveProjectActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.project; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class ChangeActiveProjectActionTest extends ActionTest { 19 | public ChangeActiveProjectActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new ChangeActiveProjectAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyProject(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | 33 | @Override 34 | protected void verifyLoggedInCluster(@NotNull Presentation presentation) { 35 | assertTrue(presentation.isVisible()); 36 | assertEquals("Change " + (isOpenshift ? "Project" : "Namespace"), presentation.getText()); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/project/CreateProjectActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.project; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class CreateProjectActionTest extends ActionTest { 19 | public CreateProjectActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new CreateProjectAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyLoggedInCluster(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | assertEquals("New " + (isOpenshift ? "Project" : "Namespace"), presentation.getText()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/project/DeleteProjectActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.project; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | 19 | public class DeleteProjectActionTest extends ActionTest { 20 | public DeleteProjectActionTest(boolean isOpenshift) { 21 | super(isOpenshift); 22 | } 23 | 24 | @Override 25 | public AnAction getAction() { 26 | return new DeleteProjectAction(); 27 | } 28 | 29 | @Override 30 | protected void verifyProject(@NotNull Presentation presentation) { 31 | assertTrue(presentation.isVisible()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/registry/CreateRegistryActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.registry; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class CreateRegistryActionTest extends ActionTest { 19 | public CreateRegistryActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new CreateRegistryAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyRegistries(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/registry/DeleteRegistryActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.registry; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class DeleteRegistryActionTest extends ActionTest { 19 | public DeleteRegistryActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new DeleteRegistryAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyRegistry(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/service/CreateServiceActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.service; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class CreateServiceActionTest extends ActionTest { 19 | public CreateServiceActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new CreateServiceAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyProject(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/service/DeleteServiceActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.service; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class DeleteServiceActionTest extends ActionTest { 19 | public DeleteServiceActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new DeleteServiceAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyService(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/service/LinkComponentActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.service; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class LinkComponentActionTest extends ActionTest { 19 | public LinkComponentActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new LinkComponentAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyService(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/actions/url/OpenInBrowserActionTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019-2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.actions.url; 12 | 13 | import com.intellij.openapi.actionSystem.AnAction; 14 | import com.intellij.openapi.actionSystem.Presentation; 15 | import org.jboss.tools.intellij.openshift.actions.ActionTest; 16 | import org.jetbrains.annotations.NotNull; 17 | 18 | public class OpenInBrowserActionTest extends ActionTest { 19 | public OpenInBrowserActionTest(boolean isOpenshift) { 20 | super(isOpenshift); 21 | } 22 | 23 | @Override 24 | public AnAction getAction() { 25 | return new OpenInBrowserAction(); 26 | } 27 | 28 | @Override 29 | protected void verifyURL(@NotNull Presentation presentation) { 30 | assertTrue(presentation.isVisible()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/telemetry/TelemetrySenderTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.telemetry; 12 | 13 | import org.junit.Test; 14 | 15 | import static org.junit.Assert.assertFalse; 16 | import static org.junit.Assert.assertTrue; 17 | 18 | public class TelemetrySenderTest { 19 | 20 | @Test 21 | public void anonymizeToken_should_replace_token() { 22 | // given 23 | String token = "123456-ABCD/1-2-3-4"; 24 | String msgWithToken = "User token-" + token + ":80 doesn't have permission"; 25 | // when 26 | String anonymized = TelemetrySender.anonymizeToken(msgWithToken); 27 | // then 28 | assertFalse(anonymized.contains(token)); 29 | assertTrue(anonymized.contains(TelemetrySender.ANONYMOUS_TOKEN)); 30 | } 31 | 32 | @Test 33 | public void anonymizeClusterUrl_should_replace_ClusterUrl() { 34 | // given 35 | String clusterUrl = "https://api.engint.openshift.com:6443"; 36 | String msgWithClusterUrl = "GET at: " + clusterUrl + "/apis. Message:"; 37 | // when 38 | String anonymized = TelemetrySender.anonymizeClusterUrl(msgWithClusterUrl); 39 | // then 40 | assertFalse(anonymized.contains(clusterUrl)); 41 | assertTrue(anonymized.contains(TelemetrySender.ANONYMOUS_CLUSTER_URL)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/jboss/tools/intellij/openshift/validation/DevfileSchemasTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2020 Red Hat, Inc. 3 | * Distributed under license by Red Hat, Inc. All rights reserved. 4 | * This program is made available under the terms of the 5 | * Eclipse Public License v2.0 which accompanies this distribution, 6 | * and is available at http://www.eclipse.org/legal/epl-v20.html 7 | * 8 | * Contributors: 9 | * Red Hat, Inc. - initial API and implementation 10 | ******************************************************************************/ 11 | package org.jboss.tools.intellij.openshift.validation; 12 | 13 | import com.intellij.testFramework.fixtures.BasePlatformTestCase; 14 | import org.jetbrains.yaml.schema.YamlJsonSchemaHighlightingInspection; 15 | 16 | import java.util.Collections; 17 | 18 | 19 | public class DevfileSchemasTest extends BasePlatformTestCase { 20 | @Override 21 | public void setUp() throws Exception { 22 | super.setUp(); 23 | System.setProperty("NO_FS_ROOTS_ACCESS_CHECK", "true"); 24 | } 25 | 26 | @Override 27 | public void tearDown() throws Exception { 28 | System.clearProperty("NO_FS_ROOTS_ACCESS_CHECK"); 29 | super.tearDown(); 30 | } 31 | 32 | public void testQuarkusDevfile() { 33 | myFixture.setTestDataPath("src/test/resources"); 34 | myFixture.enableInspections(Collections.singletonList(YamlJsonSchemaHighlightingInspection.class)); 35 | myFixture.configureByFile("devfiles/java-quarkus-v200.yaml"); 36 | myFixture.checkHighlighting(); 37 | } 38 | 39 | public void testPythonDevfile() { 40 | myFixture.setTestDataPath("src/test/resources"); 41 | myFixture.enableInspections(Collections.singletonList(YamlJsonSchemaHighlightingInspection.class)); 42 | myFixture.configureByFile("devfiles/sample-python-v220.yaml"); 43 | myFixture.checkHighlighting(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/test/resources/component-descriptor-test.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentInDevfile": "devcomp", 3 | "components": [ 4 | { 5 | "name": "devcomp", 6 | "managedBy": "odo", 7 | "managedByVersion": "v3.9.0", 8 | "runningIn": { 9 | "deploy": false, 10 | "dev": true 11 | }, 12 | "projectType": "Quarkus", 13 | "runningOn": "cluster", 14 | "platform": "cluster" 15 | } 16 | ] 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/test/resources/components-test.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentInDevfile": "nodejs", 3 | "components": [ 4 | { 5 | "name": "nodejs", 6 | "managedBy": "odo", 7 | "managedByVersion": "v3.9.0", 8 | "runningIn": { 9 | "deploy": false, 10 | "dev": true 11 | }, 12 | "projectType": "nodejs", 13 | "runningOn": "cluster", 14 | "platform": "cluster" 15 | }, 16 | { 17 | "name": "nondevcomp", 18 | "managedBy": "whatever", 19 | "managedByVersion": "", 20 | "runningIn": null, 21 | "projectType": "Unknown", 22 | "runningOn": "cluster", 23 | "platform": "cluster" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /src/test/resources/describe-binding-inDev-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "my-nodejs-app-cluster-sample-k8s", 4 | "spec": { 5 | "application": { 6 | "kind": "Deployment", 7 | "name": "my-nodejs-app-app", 8 | "apiVersion": "apps/v1" 9 | }, 10 | "services": [ 11 | { 12 | "kind": "Cluster", 13 | "name": "cluster-sample", 14 | "apiVersion": "postgresql.k8s.enterprisedb.io/v1" 15 | } 16 | ], 17 | "detectBindingResources": true, 18 | "bindAsFiles": true, 19 | "namingStrategy": "lowercase" 20 | }, 21 | "status": { 22 | "bindingFiles": "${SERVICE_BINDING_ROOT}/my-nodejs-app-cluster-sample-k8s/password", 23 | "bindingEnvVars": [ 24 | "PASSWORD" 25 | ] 26 | } 27 | }, 28 | { 29 | "name": "my-nodejs-app-cluster-sample-ocp" 30 | } 31 | ] -------------------------------------------------------------------------------- /src/test/resources/describe-binding-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "my-nodejs-app-cluster-sample-k8s", 4 | "spec": { 5 | "application": { 6 | "kind": "Deployment", 7 | "name": "my-nodejs-app-app", 8 | "apiVersion": "apps/v1" 9 | }, 10 | "services": [ 11 | { 12 | "kind": "Cluster", 13 | "name": "cluster-sample", 14 | "apiVersion": "postgresql.k8s.enterprisedb.io/v1" 15 | } 16 | ], 17 | "detectBindingResources": true, 18 | "bindAsFiles": false 19 | } 20 | }, 21 | { 22 | "name": "my-nodejs-app-cluster-sample-ocp" 23 | } 24 | ] -------------------------------------------------------------------------------- /src/test/resources/devfile-registry.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "dotnet50", 4 | "displayName": ".NET 5.0", 5 | "description": ".NET 5.0 application", 6 | "registry": { 7 | "name": "Staging", 8 | "url": "https://registry.stage.devfile.io/", 9 | "secure": false 10 | }, 11 | "language": ".NET", 12 | "tags": [ 13 | ".NET", 14 | ".NET 5.0" 15 | ], 16 | "projectType": "dotnet", 17 | "version": "1.0.3", 18 | "versions": [ 19 | { 20 | "version": "1.0.3", 21 | "isDefault": true, 22 | "schemaVersion": "2.1.0", 23 | "starterProjects": [ 24 | "dotnet50-example" 25 | ], 26 | "commandGroups": { 27 | "build": true, 28 | "debug": false, 29 | "deploy": false, 30 | "run": true, 31 | "test": false 32 | } 33 | } 34 | ], 35 | "starterProjects": [ 36 | "dotnet50-example" 37 | ] 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /src/test/resources/devfiles/java-quarkus-v200.yaml: -------------------------------------------------------------------------------- 1 | schemaVersion: 2.0.0 2 | metadata: 3 | name: java-quarkus 4 | version: 1.1.0 5 | website: https://quarkus.io 6 | starterProjects: 7 | - name: quarkus-ex 8 | git: 9 | remotes: 10 | origin: https://github.com/odo-devfiles/quarkus-ex 11 | components: 12 | - name: tools 13 | container: 14 | image: quay.io/eclipse/che-quarkus:nightly 15 | memoryLimit: 1512Mi 16 | mountSources: true 17 | volumeMounts: 18 | - name: m2 19 | path: /home/user/.m2 20 | endpoints: 21 | - name: '8080-http' 22 | targetPort: 8080 23 | - name: m2 24 | volume: 25 | size: 3Gi 26 | commands: 27 | - id: init-compile 28 | exec: 29 | component: tools 30 | commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository compile" 31 | workingDir: $PROJECTS_ROOT 32 | - id: dev-run 33 | exec: 34 | component: tools 35 | commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository quarkus:dev" 36 | hotReloadCapable: true 37 | group: 38 | kind: run 39 | isDefault: true 40 | workingDir: $PROJECTS_ROOT 41 | - id: dev-debug 42 | exec: 43 | component: tools 44 | commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository quarkus:dev -Ddebug=${DEBUG_PORT}" 45 | hotReloadCapable: true 46 | group: 47 | kind: debug 48 | isDefault: true 49 | workingDir: $PROJECTS_ROOT 50 | 51 | events: 52 | postStart: 53 | - init-compile 54 | -------------------------------------------------------------------------------- /src/test/resources/service-test.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindableServices": [ 3 | { 4 | "name": "my-cluster", 5 | "namespace": "jeff", 6 | "kind": "PerconaServerMongoDB", 7 | "apiVersion": "psmdb.percona.com/v1", 8 | "service": "my-cluster/PerconaServerMongoDB.psmdb.percona.com/v1" 9 | } 10 | ] 11 | } --------------------------------------------------------------------------------