Skip to content

Bring all package names into line with naming requirements #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clion-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IntelliJ Platform Artifacts Repositories
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

pluginGroup = com.huawei.utbot
pluginGroup = org.utbot.cpp.clion.plugin
pluginName = UTBotCppClion
pluginVersion = 0.0.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class UTBotCoverageEngine : CoverageEngine() {
* Checks whether coverage should be shown for file based on [CoverageSuitesBundle].
* It is used in [CoverageDataManager.applyInformationToEditor].
*
* For example, see JavaCoverageEngine: We may not want to show com.huawei.utbot.cpp.clion.coverage for files in test
* For example, see JavaCoverageEngine: We may not want to show coverage for files in test
* folders, if suite.isTrackTestFolders == false, we may check it here and return false.
*
* For now all files are accepted.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.utbot.cpp.clion.plugin.grpc

import org.utbot.cpp.clion.plugin.utils.ourPluginVersion
import testsgen.Testgen

//TODO: when plugin is ready for release, take version from publish github action.
fun getVersionGrpcRequest(): Testgen.VersionInfo = Testgen.VersionInfo.newBuilder().setVersion("0.0.1").build()
fun getVersionGrpcRequest(): Testgen.VersionInfo = Testgen.VersionInfo.newBuilder().setVersion(ourPluginVersion).build()
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class UTBotAllProjectSettings(val project: Project) {
}

companion object {
const val clientVersion = "0.0.1"
const val DEFAULT_HOST = "localhost"
const val DEFAULT_PORT = 2121
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import javax.swing.event.DocumentEvent
import org.utbot.cpp.clion.plugin.settings.UTBotProjectStoredSettings
import org.utbot.cpp.clion.plugin.ui.ObservableValue
import org.utbot.cpp.clion.plugin.utils.isWindows
import org.utbot.cpp.clion.plugin.utils.ourPluginVersion

enum class ConnectionStatus {
Connected,
Expand Down Expand Up @@ -145,7 +146,7 @@ class ConnectionStep(

val warningMessage: () -> String = {
"⚠️ Warning! Versions are different or not defined:" +
"Client: ${UTBotAllProjectSettings.clientVersion} Server: ${serverVersion ?: "not defined"}"
"Client: ${ourPluginVersion} Server: ${serverVersion ?: "not defined"}"
}
label(warningMessage()).visibleIf(
object : ComponentPredicate() {
Expand Down Expand Up @@ -188,7 +189,7 @@ class ConnectionStep(
GrpcClient(port, host, "DummyId").use { client ->
serverVersion = client.stub.handshake(getVersionGrpcRequest()).version

if (serverVersion != UTBotAllProjectSettings.clientVersion)
if (serverVersion != ourPluginVersion)
return ConnectionStatus.Suspicious
return ConnectionStatus.Connected
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
package org.utbot.cpp.clion.plugin.utils

import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.openapi.extensions.PluginId

val isWindows
get() = System.getProperty("os.name").contains("win", ignoreCase = true)
get() = System.getProperty("os.name").contains("win", ignoreCase = true)

val ourPluginVersion: String
get() = PluginManagerCore.getPlugin(PluginId.findId("org.utbot.cpp.clion.plugin"))?.version ?: "dev-version"
49 changes: 25 additions & 24 deletions clion-plugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!-- Plugin Configuration File. Read more: https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html -->
<idea-plugin>
<id>com.github.vol0n.utbotcppclion</id>
<id>org.utbot.cpp.clion.plugin</id>
<name>UTBotCppClion</name>
<vendor>vol0n</vendor>
<version>0.0.1</version>

<depends>com.intellij.modules.platform</depends>
<depends>com.intellij.modules.clion.ide</depends>
Expand All @@ -20,7 +21,7 @@
<coverageEngine implementation="org.utbot.cpp.clion.plugin.coverage.UTBotCoverageEngine"/>
<postStartupActivity implementation="org.utbot.cpp.clion.plugin.UTBotStartupActivity"/>
<projectConfigurable parentId="tools" instance="org.utbot.cpp.clion.plugin.settings.UTBotConfigurable"
id="com.huawei.utbot.cpp.ui.UTBotConfigurable"
id="org.utbot.cpp.clion.plugin.ui.UTBotConfigurable"
displayName="UTBot Settings"
nonDefaultProject="true"/>
<notificationGroup id="Custom Notification Group" displayType="BALLOON"/>
Expand Down Expand Up @@ -53,38 +54,38 @@
<add-to-group group-id="ProjectViewPopupMenuModifyGroup" anchor="first"/>
</group>

<action id="com.huawei.utbot.cpp.actions.MarkSourceFolderAction"
<action id="org.utbot.cpp.clion.plugin.actions.MarkSourceFolderAction"
class="org.utbot.cpp.clion.plugin.actions.mark.MarkSourceFolderAction" text="UTBot: Mark As UTBot Folders"
description="Marks selected folders as UTBot folders">
<add-to-group group-id="actions.UTBot.projectTree" anchor="first"/>
</action>

<action id="com.huawei.utbot.cpp.actions.UnmarkSourceFolderAction"
<action id="org.utbot.cpp.clion.plugin.actions.UnmarkSourceFolderAction"
class="org.utbot.cpp.clion.plugin.actions.mark.UnmarkSourceFolderAction" text="UTBot: Unmark UTBot Folders"
description="Unmarks selected folders as UTBot folders">
<add-to-group group-id="actions.UTBot.projectTree" relative-to-action="com.huawei.utbot.cpp.actions.MarkSourceFolderAction"
<add-to-group group-id="actions.UTBot.projectTree" relative-to-action="org.utbot.cpp.clion.plugin.actions.MarkSourceFolderAction"
anchor="after"/>
</action>

<action id="com.huawei.utbot.cpp.actions.AskServerToGenerateBuildDir"
<action id="org.utbot.cpp.clion.plugin.actions.AskServerToGenerateBuildDir"
class="org.utbot.cpp.clion.plugin.actions.AskServerToGenerateBuildDir"
text="Generate Build Directory" description="Ask server to generate build dir"/>
<action id="com.huawei.utbot.cpp.actions.ConfigureProjectAction"
<action id="org.utbot.cpp.clion.plugin.actions.ConfigureProjectAction"
class="org.utbot.cpp.clion.plugin.actions.configure.ConfigureProjectAction" text="Configure Project"
description="Configure project so that server can generate tests"/>
<action id="com.huawei.utbot.cpp.actions.AskServerToGenerateJsonForProjectConfiguration"
<action id="org.utbot.cpp.clion.plugin.actions.AskServerToGenerateJsonForProjectConfiguration"
class="org.utbot.cpp.clion.plugin.actions.AskServerToGenerateJsonForProjectConfiguration"
text="Generate Missing Json Files"
description="Ask server to generate missing json files"/>
<action id="com.huawei.utbot.cpp.actions.ShowWizardAction"
<action id="org.utbot.cpp.clion.plugin.actions.ShowWizardAction"
class="org.utbot.cpp.clion.plugin.actions.ShowWizardAction" text="Quickstart Wizard"
description="Show quickstart wizard"/>
<action id="com.huawei.utbot.cpp.actions.ReconfigureProjectAction"
<action id="org.utbot.cpp.clion.plugin.actions.ReconfigureProjectAction"
class="org.utbot.cpp.clion.plugin.actions.configure.ReconfigureProjectAction" text="Reset Cache and Configure Project"
description="UTBot: Reset cache and configure project"/>


<action id="com.huawei.utbot.cpp.actions.GenerateForFileAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForFileAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForFileAction"
text="UTBot: Generate Tests For Current File"
>
Expand All @@ -98,62 +99,62 @@
anchor="first"/>
</action>

<action id="com.huawei.utbot.cpp.actions.GenerateForLineAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForLineAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForLineAction"
text="UTBot: Generate Tests For Current Line">
<override-text place="EditorPopup" text="for Current Line"/>
<synonym text="UL"/>
<add-to-group
group-id="actions.UTBot.editor"
anchor="after"
relative-to-action="com.huawei.utbot.cpp.actions.GenerateForFileAction"/>
relative-to-action="org.utbot.cpp.clion.plugin.actions.GenerateForFileAction"/>
</action>

<action id="com.huawei.utbot.cpp.actions.GenerateForFunctionAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForFunctionAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForFunctionAction"
text="UTBot: Generate Tests For Current Function">
<override-text place="EditorPopup" text="for Current Function"/>
<synonym text="UF"/>
<add-to-group
group-id="actions.UTBot.editor"
anchor="after"
relative-to-action="com.huawei.utbot.cpp.actions.GenerateForLineAction"/>
relative-to-action="org.utbot.cpp.clion.plugin.actions.GenerateForLineAction"/>
</action>

<action id="com.huawei.utbot.cpp.actions.GenerateForClassAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForClassAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForClassAction"
text="UTBot: Generate Tests For Current Class">
<override-text place="EditorPopup" text="for Current Class"/>
<synonym text="UC"/>
<add-to-group
group-id="actions.UTBot.editor"
anchor="after"
relative-to-action="com.huawei.utbot.cpp.actions.GenerateForFunctionAction"/>
relative-to-action="org.utbot.cpp.clion.plugin.actions.GenerateForFunctionAction"/>
</action>

<action id="com.huawei.utbot.cpp.actions.GenerateForPredicateAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForPredicateAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForPredicateAction"
text="UTBot: Generate Tests With Prompted Result">
<override-text place="EditorPopup" text="with Prompted Result"/>
<synonym text="UR"/>
<add-to-group
group-id="actions.UTBot.editor"
anchor="after"
relative-to-action="com.huawei.utbot.cpp.actions.GenerateForClassAction"/>
relative-to-action="org.utbot.cpp.clion.plugin.actions.GenerateForClassAction"/>
</action>

<action id="com.huawei.utbot.cpp.actions.GenerateForAssertionAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForAssertionAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForAssertionAction"
text="UTBot: Generate Tests That Fail Current Assertion">
<override-text place="EditorPopup" text="That Fail Current Assertion"/>
<synonym text="UA"/>
<add-to-group
group-id="actions.UTBot.editor"
anchor="after"
relative-to-action="com.huawei.utbot.cpp.actions.GenerateForClassAction"/>
relative-to-action="org.utbot.cpp.clion.plugin.actions.GenerateForClassAction"/>
</action>

<action id="com.huawei.utbot.cpp.actions.GenerateForProjectAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForProjectAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForProjectAction"
text="UTBot: Generate Tests For Project" description="Generate tests for whole project">
<override-text place="EditorPopup" text="For Project"/>
Expand All @@ -163,7 +164,7 @@
anchor="last"/>
</action>

<action id="com.huawei.utbot.cpp.actions.GenerateForFolderAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForFolderAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForFolderAction"
text="UTBot: Generate Tests For Folder">
<synonym text="UF"/>
Expand All @@ -172,7 +173,7 @@
anchor="last"/>
</action>

<action id="com.huawei.utbot.cpp.actions.GenerateForSnippetAction"
<action id="org.utbot.cpp.clion.plugin.actions.GenerateForSnippetAction"
class="org.utbot.cpp.clion.plugin.actions.generate.GenerateForSnippetAction"
text="UTBot: Generate Tests For Code Snippet"
description="Generates tests for file without context of a project">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GenerateForFileTest : BaseGenerationTestCase() {
project.settings.storedSettings.verbose = isVerboseMode

fixture.configureFromTempProjectFile(relativeFilePath)
fixture.performEditorAction("com.huawei.utbot.cpp.actions.GenerateForFileAction")
fixture.performEditorAction("org.utbot.cpp.clion.plugin.actions.GenerateForFileAction")
waitForRequestsToFinish()

testsDirectoryPath.assertFileOrDirExists()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GenerateForIsolatedFileTest : BaseGenerationTestCase() {
"Testing generate for snippet using target: auto, compiler: ${compiler.name}, verbose mode = ${project.settings.storedSettings.verbose}")
compiler.buildProject(projectPath, buildDirName)
fixture.configureFromTempProjectFile("snippet.c")
fixture.performEditorAction("com.huawei.utbot.cpp.actions.GenerateForSnippetAction")
fixture.performEditorAction("org.utbot.cpp.clion.plugin.actions.GenerateForSnippetAction")
waitForRequestsToFinish()
testsDirectoryPath.assertFileOrDirExists()
testsDirectoryPath.assertTestFilesExist(listOf("snippet"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class GenerateForLineTest: BaseGenerationTestCase() {
fixture.configureFromTempProjectFile("/lib/basic_functions.c")
fixture.editor.moveCursorToLine(lineNumber)

fixture.performEditorAction("com.huawei.utbot.cpp.actions.GenerateForLineAction")
fixture.performEditorAction("org.utbot.cpp.clion.plugin.actions.GenerateForLineAction")
waitForRequestsToFinish()

testsDirectoryPath.assertFileOrDirExists()
Expand Down