Skip to content

Commit

Permalink
Updated test framework version
Browse files Browse the repository at this point in the history
  • Loading branch information
anchouls committed Dec 18, 2023
1 parent b12e369 commit 50894b3
Show file tree
Hide file tree
Showing 134 changed files with 70 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.jetbrains.academy.test.system.ij.formatting.checkIfFormattingRulesWereApplied
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type: framework
custom_name: Code schemas and EditorConfig
content:
- Theory
- ConfigureCodeStyleSettingsInIDE
- ReformatTheCodeAccordingToStyleSettings
- Theory
- ConfigureCodeStyleSettingsInIDE
- ReformatTheCodeAccordingToStyleSettingsPractice
is_template_based: false
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.jetbrains.academy.test.system.ij.formatting.checkIfFormattingRulesWereApplied
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.jetbrains.academy.test.system.ij.formatting.checkIfFormattingRulesWereApplied
import org.jetbrains.academy.test.system.ij.formatting.checkIfOptimizeImportsWereApplied
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.ij.formatting.checkIfOptimizeImportsWereApplied
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import java.io.File
Expand Down
8 changes: 4 additions & 4 deletions CodeStyleAndFormatting/WhatIsFormatting/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
custom_name: What is formatting?
content:
- Theory
- Quiz
- ReformatTheCode
- ReformatTheCodeUsingIDE
- Theory
- Quiz
- ReformatTheCodePractice
- ReformatTheCodeUsingIDEPractice
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.intellij.openapi.command.WriteCommandAction
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
custom_name: What is Extract Method refactoring?
content:
- Theory
- ExtractDuplicatedCode
- Theory
- ExtractDuplicatedCodePractice
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
custom_name: What is Extract Variable refactoring?
content:
- Theory
- ExtractMagicConstants
- Theory
- ExtractMagicConstantsPractice
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
4 changes: 2 additions & 2 deletions InliningCode/InlineMethodRefactoring/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
custom_name: What is Inline Method refactoring?
content:
- Theory
- InlineMethodAndVariables
- Theory
- InlineMethodAndVariablesPractice
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import com.intellij.openapi.application.ApplicationManager
import org.jetbrains.academy.test.system.ij.analyzer.extractElementsOfTypes
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.kotlin.psi.KtClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
Expand Down Expand Up @@ -41,8 +38,4 @@ class MiddleManTest : BaseIjTestClass() {
"Please, invoke \"dataProvider.fetchData()\" inside \"Client::processData\" method."
}
}

private fun hasClass(className: String) = ApplicationManager.getApplication().runReadAction<Boolean> {
myFixture.file.extractElementsOfTypes(KtClass::class.java).any { it.name == className }
}
}
2 changes: 1 addition & 1 deletion InliningCode/MiddleManCodeSmell/lesson-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ type: framework
custom_name: Middle Man code smell
content:
- Theory
- Practice
- PracticePractice
is_template_based: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
custom_name: What is Inline Variable refactoring?
content:
- Theory
- InlineVariables
- InlineVariablesPractice
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: theory
custom_name: GettingToKnowYou
custom_name: Getting to know you
files:
- name: src/main/kotlin/jetbrains/refactoring/course/introduction/Main.kt
visible: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type: framework
custom_name: What are Pull Up and Push Down refactorings?
content:
- WhatArePullUpAndPushDownRefactorings
- ApplyPullUpRefactoring
- ApplyPushDownRefactoring
- WhatArePullUpAndPushDownRefactorings
- ApplyPullUpRefactoringPractice
- ApplyPushDownRefactoringPractice
is_template_based: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test

Expand Down
6 changes: 3 additions & 3 deletions MovingCode/WhatIsMoveMethodRefactoring/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type: framework
custom_name: What is Move refactoring?
content:
- WhatIsMoveMethodRefactoring
- FindMoreAppropriateFilesForClasses
- FindMoreAppropriateClassesForMethods
- WhatIsMoveMethodRefactoring
- FindMoreAppropriateFilesForClassesPractice
- FindMoreAppropriateClassesForMethodsPractice
is_template_based: false
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import com.intellij.openapi.application.ApplicationManager
import org.jetbrains.academy.test.system.ij.analyzer.extractElementsOfTypes
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
Expand Down Expand Up @@ -55,8 +52,4 @@ class IdentifyIssuesInCodeSnippetTest : BaseIjTestClass() {
"Please, rename \"w\" parameter to \"width\""
}
}

private fun hasParameter(parameterName: String) = ApplicationManager.getApplication().runReadAction<Boolean> {
myFixture.file.extractElementsOfTypes(KtParameter::class.java).any { it.name == parameterName }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ type: framework
custom_name: Facade Pattern - Practice
content:
- FacadePattern
- Task
- Practice
is_template_based: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ type: framework
custom_name: Factory Method Pattern - Practice
content:
- FactoryMethodPattern
- Task
- Practice
is_template_based: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ type: framework
custom_name: Strategy Pattern - Practice
content:
- StrategyPattern
- Task
- Practice
is_template_based: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.academy.test.system.test.BaseIjTestClass
import org.jetbrains.academy.test.system.kotlin.test.BaseIjTestClass
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
Expand Down
6 changes: 3 additions & 3 deletions RenamingCode/RenameRefactoringInIDE/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
custom_name: Rename refactoring in IDE
content:
- RenameRefactoringInIDE
- Quiz
- FixTypos
- RenameRefactoringInIDE
- Quiz
- FixTyposPractice
36 changes: 24 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ plugins {
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
}

intellij {
version.set("2022.1.1")
plugins.set(listOf("java", "Kotlin"))
type.set("IC")
}

buildscript {
extra["kotlin_version"] = "1.8.20"

Expand All @@ -32,18 +38,11 @@ fun printOutput(output: Any): Task {

allprojects {
apply {
plugin("org.jetbrains.intellij")
plugin("application")
plugin("java")
plugin("kotlin")
}

intellij {
version.set("2022.1.1")
plugins.set(listOf("java", "Kotlin"))
type.set("IC")
}

repositories {
mavenCentral()
mavenLocal()
Expand All @@ -56,10 +55,6 @@ allprojects {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20")
testImplementation("junit:junit:4.13.1")

val testSystemVersion = "2.1.0"
implementation("org.jetbrains.academy.test.system:core:$testSystemVersion")
implementation("org.jetbrains.academy.test.system:ij:$testSystemVersion")

val junitJupiterVersion = "5.9.0"
implementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
runtimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
Expand Down Expand Up @@ -124,7 +119,24 @@ configure(subprojects.filter { it.name != "util" }) {
}
}

configure(subprojects.filter { it.name == "CodeStyleAndFormatting-CodeSchemasAndEditorConfig-ReformatTheCodeAccordingToStyleSettings" }) {
configure(subprojects.filter { it.name.endsWith("Practice") }) {
plugins.apply("org.jetbrains.intellij")

intellij {
version.set("2022.1.1")
plugins.set(listOf("java", "Kotlin"))
type.set("IC")
}

dependencies {
val testSystemVersion = "2.1.1"
testImplementation("org.jetbrains.academy.test.system:core:$testSystemVersion")
testImplementation("org.jetbrains.academy.test.system:kotlin-psi:$testSystemVersion")
testImplementation("org.jetbrains.academy.test.system:common:$testSystemVersion")
}
}

configure(subprojects.filter { it.name == "CodeStyleAndFormatting-CodeSchemasAndEditorConfig-ReformatTheCodeAccordingToStyleSettingsPractice" }) {
apply {
plugin("org.jlleitschuh.gradle.ktlint")
}
Expand Down
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pluginManagement {
gradlePluginPortal()
google()
mavenCentral()
mavenLocal()
maven(url = "https://packages.jetbrains.team/maven/p/kotlin-test-framework/kotlin-test-framework")
}
}
Expand Down

0 comments on commit 50894b3

Please sign in to comment.