Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
cf02611b
Commit
cf02611b
authored
7 years ago
by
Sergey Karashevich
Browse files
Options
Download
Email Patches
Plain Diff
[gui-test] comeback to teamcity
parent
aee239e5
Branches unavailable
Tags unavailable
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
build/scripts/gui_tests_in_community.gant
+54
-0
build/scripts/gui_tests_in_community.gant
platform/build-scripts/groovy/org/jetbrains/intellij/build/TestingOptions.groovy
+7
-0
...groovy/org/jetbrains/intellij/build/TestingOptions.groovy
platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/TestingTasksImpl.groovy
+10
-2
...org/jetbrains/intellij/build/impl/TestingTasksImpl.groovy
platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/community/CommandLineProjectTest.kt
+76
-0
...estGuiFramework/tests/community/CommandLineProjectTest.kt
platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/community/CommunityTestSuite.kt
+1
-1
...ij/testGuiFramework/tests/community/CommunityTestSuite.kt
with
148 additions
and
3 deletions
+148
-3
build/scripts/gui_tests_in_community.gant
0 → 100644
+
54
-
0
View file @
cf02611b
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.codehaus.gant.GantBinding
import org.jetbrains.intellij.build.BuildMessages
import org.jetbrains.intellij.build.BuildOptions
import org.jetbrains.intellij.build.TestingOptions
import org.jetbrains.intellij.build.TestingTasks
import org.jetbrains.intellij.build.impl.CompilationContextImpl
import org.jetbrains.jps.gant.JpsGantTool
import org.jetbrains.jps.idea.IdeaProjectLoader
import org.jetbrains.jps.model.JpsProject
import java.util.function.BiFunction
/**
* Compiles the sources and runs tests from 'community' project. Look at org.jetbrains.intellij.build.TestingOptions to see which options are
* supported.
*/
target("default": "Run tests") {
String home = IdeaProjectLoader.guessHome(this)
String outputDir = "$home/out/tests"
def compilationOptions = new BuildOptions()
// compilationOptions.useCompiledClassesFromProjectOutput = true
// compilationOptions.incrementalCompilation = true
// def context = CompilationContextImpl.create(home, home, outputDir, this)
GantBinding binding = (GantBinding) this.binding
binding.includeTool << JpsGantTool
def context = CompilationContextImpl.create(binding.ant as AntBuilder, binding.projectBuilder, binding.project, binding.global, home, home,
{ p, m -> outputDir } as BiFunction<JpsProject, BuildMessages, String>, compilationOptions)
def testingOptions = new TestingOptions()
// testingOptions.setTestGroups("GUI_TESTS")
// testingOptions.setTestPatterns("com.intellij.testGuiFramework.tests.community.*")
TestingTasks.create(context, testingOptions).runTests([], "testGuiFramework", null)
}
This diff is collapsed.
Click to expand it.
platform/build-scripts/groovy/org/jetbrains/intellij/build/TestingOptions.groovy
+
7
-
0
View file @
cf02611b
...
...
@@ -60,6 +60,11 @@ class TestingOptions {
*/
String
mainModule
=
System
.
getProperty
(
"intellij.build.test.main.module"
,
OLD_MAIN_MODULE
)
/**
* Specifies a custom Test Suite.
*/
String
bootstrapSuite
=
System
.
getProperty
(
"intellij.build.test.bootstrap.suite"
,
BOOTSTRAP_SUITE_DEFAULT
)
private
static
final
String
OLD_TEST_GROUP
=
System
.
getProperty
(
"idea.test.group"
,
"ALL_EXCLUDE_DEFINED"
)
private
static
final
String
OLD_TEST_PATTERNS
=
System
.
getProperty
(
"idea.test.patterns"
)
private
static
final
String
OLD_PLATFORM_PREFIX
=
System
.
getProperty
(
"idea.platform.prefix"
)
...
...
@@ -67,4 +72,6 @@ class TestingOptions {
private
static
final
boolean
OLD_SUSPEND_DEBUG_PROCESS
=
System
.
getProperty
(
"debug.suspend"
,
"n"
)
==
"y"
private
static
final
String
OLD_JVM_MEMORY_OPTIONS
=
System
.
getProperty
(
"test.jvm.memory"
)
private
static
final
String
OLD_MAIN_MODULE
=
System
.
getProperty
(
"module.to.make"
)
public
static
final
String
BOOTSTRAP_SUITE_DEFAULT
=
"com.intellij.tests.BootstrapTests"
}
This diff is collapsed.
Click to expand it.
platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/TestingTasksImpl.groovy
+
10
-
2
View file @
cf02611b
...
...
@@ -147,7 +147,11 @@ class TestingTasksImpl extends TestingTasks {
---------------------------------------^------^------^------^------^------^------^----------------------------------------
"""
)
}
runJUnitTask
(
jvmArgs
,
systemProperties
,
bootstrapClasspath
)
if
(
isBootstrapSuiteDefault
())
runJUnitTask
(
jvmArgs
,
systemProperties
,
bootstrapClasspath
)
else
//run other suites instead of BootstrapTests
runJUnitTask
(
jvmArgs
,
systemProperties
,
testsClasspath
)
}
@CompileDynamic
...
...
@@ -170,7 +174,7 @@ class TestingTasksImpl extends TestingTasks {
}
}
test
(
name:
'com.intellij.test
s.
B
ootstrap
Tests'
)
test
(
name:
option
s
.
b
ootstrap
Suite
)
}
}
...
...
@@ -199,4 +203,8 @@ class TestingTasksImpl extends TestingTasks {
ant
.
project
.
addReference
(
junitTaskLoaderRef
,
new
AntClassLoader
(
ant
.
project
.
getClass
().
getClassLoader
(),
ant
.
project
,
pathJUnit
))
ant
.
taskdef
(
name:
"junit"
,
classname:
"org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
,
loaderRef:
junitTaskLoaderRef
)
}
private
boolean
isBootstrapSuiteDefault
()
{
return
options
.
bootstrapSuite
==
TestingOptions
.
BOOTSTRAP_SUITE_DEFAULT
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/community/CommandLineProjectTest.kt
0 → 100644
+
76
-
0
View file @
cf02611b
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.intellij.testGuiFramework.tests.community
import
com.intellij.testGuiFramework.framework.RunWithIde
import
com.intellij.testGuiFramework.impl.GuiTestCase
import
com.intellij.testGuiFramework.launcher.ide.IdeType
import
org.junit.Assert.assertTrue
import
org.junit.Test
import
java.util.regex.Pattern
@RunWithIde
(
IdeType
.
IDEA_COMMUNITY
)
class
CommandLineProjectTest
:
GuiTestCase
()
{
val
testProjectName
=
"test-cmd-template"
val
codeText
:
String
=
"""package com.company;
public class Main {
public static void main(String[] args) {
// write your code here
}
}"""
@Test
fun
testProjectCreate
()
{
welcomeFrame
{
actionLink
(
"Create New Project"
).
click
()
dialog
(
"New Project"
)
{
jList
(
"Java"
).
clickItem
(
"Java"
)
button
(
"Next"
).
click
()
checkbox
(
"Create project from template"
).
click
()
jList
(
"Command Line App"
).
clickItem
(
"Command Line App"
)
button
(
"Next"
).
click
()
typeText
(
testProjectName
)
button
(
"Finish"
).
click
()
}
}
ideFrame
{
toolwindow
(
id
=
"Project"
)
{
projectView
{
path
(
project
.
name
,
"src"
,
"com.company"
,
"Main"
).
doubleClick
()
}
}
editor
{
moveTo
(
118
)
moveTo
(
121
)
}
val
editorCode
=
editor
.
getCurrentFileContents
(
false
)
assertTrue
(
codeText
.
lowerCaseNoSpace
()
==
editorCode
!!
.
lowerCaseNoSpace
())
closeProject
()
}
}
fun
String
.
lowerCaseNoSpace
()
=
this
.
toLowerCase
().
removeSpaces
()
fun
String
.
removeSpaces
():
String
{
val
WHITE_SPACE_PATTERN
=
Pattern
.
compile
(
"\\s"
)
return
WHITE_SPACE_PATTERN
.
matcher
(
this
).
replaceAll
(
""
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/community/CommunityTestSuite.kt
+
1
-
1
View file @
cf02611b
...
...
@@ -23,5 +23,5 @@ import org.junit.runners.Suite
@RunWith
(
GuiTestSuite
::
class
)
@RunWithIde
(
IdeType
.
IDEA_COMMUNITY
)
@Suite
.
SuiteClasses
()
@Suite
.
SuiteClasses
(
CommandLineProjectTest
::
class
)
class
CommunityTestSuite
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help