Skip to content

Commit

Permalink
#6
Browse files Browse the repository at this point in the history
  • Loading branch information
kazurayam committed Feb 21, 2024
1 parent 1522ada commit d64d11b
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import org.junit.runner.notification.Failure
import org.junit.runner.notification.RunListener

/**
* learned from https://memorynotfound.com/add-junit-listener-example/
* A mimic of https://memorynotfound.com/add-junit-listener-example/ which is able to
* compile a test result report in XML.
*
* Still TODO.
*
* Reporting requires significant development efforts.
* On the other hand, I personally do not require the report file.
* So, I am not going to finish this.
*
* @author kazurayam
*/
Expand Down
15 changes: 0 additions & 15 deletions Scripts/main/CalculatorDemo/Script1547192090735.groovy
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable

def result1 = CustomKeywords.'junittutorial.Calculator.multiply'(2, 3)
println("2 * 3 makes " + result1)

Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion Test Suites/main/example.ts → Test Suites/main/All.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSuiteEntity>
<description></description>
<name>example</name>
<name>All</name>
<tag></tag>
<isRerun>false</isRerun>
<mailRecipient></mailRecipient>
<numberOfRerun>0</numberOfRerun>
<pageLoadTimeout>30</pageLoadTimeout>
<pageLoadTimeoutDefault>true</pageLoadTimeoutDefault>
<rerunFailedTestCasesOnly>false</rerunFailedTestCasesOnly>
<rerunImmediately>false</rerunImmediately>
<testSuiteGuid>cec4d7d4-d467-42e3-8bc5-3bc4e9644901</testSuiteGuid>
<testCaseLink>
<guid>8a90fe3b-abf7-4377-84d7-9fb6f7911bc1</guid>
<isReuseDriver>false</isReuseDriver>
<isRun>true</isRun>
<testCaseId>Test Cases/main/CalculatorDemo</testCaseId>
<usingDataBindingAtTestSuiteLevel>true</usingDataBindingAtTestSuiteLevel>
</testCaseLink>
</TestSuiteEntity>
20 changes: 10 additions & 10 deletions Test Suites/test/All.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
<rerunImmediately>false</rerunImmediately>
<testSuiteGuid>dac816c8-2db1-4dc6-842e-b402cca0bc73</testSuiteGuid>
<testCaseLink>
<guid>0736147d-16f1-4116-8bf8-83933c0c5874</guid>
<guid>6137d5f8-c1b7-4b1e-bba2-423e81bcde68</guid>
<isReuseDriver>false</isReuseDriver>
<isRun>true</isRun>
<testCaseId>Test Cases/test/junittutorial/CalculatorTestRunner</testCaseId>
<testCaseId>Test Cases/test/com.kazurayam.junit4ks/JUnitCustomKeywordsTestRuuner</testCaseId>
<usingDataBindingAtTestSuiteLevel>true</usingDataBindingAtTestSuiteLevel>
</testCaseLink>
<testCaseLink>
<guid>d355e10d-e7b6-4f5b-8b0a-5ffef4a78aad</guid>
<guid>0529caf6-d317-4deb-9eae-45f524b29202</guid>
<isReuseDriver>false</isReuseDriver>
<isRun>true</isRun>
<testCaseId>Test Cases/test/junittutorial/StarImportProblemDemo</testCaseId>
<testCaseId>Test Cases/test/junittutorial/ASuiteRunner</testCaseId>
<usingDataBindingAtTestSuiteLevel>true</usingDataBindingAtTestSuiteLevel>
</testCaseLink>
<testCaseLink>
<guid>98d13583-d2f1-4d9c-8b74-fdcc98994962</guid>
<guid>0736147d-16f1-4116-8bf8-83933c0c5874</guid>
<isReuseDriver>false</isReuseDriver>
<isRun>true</isRun>
<testCaseId>Test Cases/test/junittutorial/GreeterTestRunner</testCaseId>
<testCaseId>Test Cases/test/junittutorial/CalculatorTestRunner</testCaseId>
<usingDataBindingAtTestSuiteLevel>true</usingDataBindingAtTestSuiteLevel>
</testCaseLink>
<testCaseLink>
Expand All @@ -40,17 +40,17 @@
<usingDataBindingAtTestSuiteLevel>true</usingDataBindingAtTestSuiteLevel>
</testCaseLink>
<testCaseLink>
<guid>0529caf6-d317-4deb-9eae-45f524b29202</guid>
<guid>98d13583-d2f1-4d9c-8b74-fdcc98994962</guid>
<isReuseDriver>false</isReuseDriver>
<isRun>true</isRun>
<testCaseId>Test Cases/test/junittutorial/ASuiteRunner</testCaseId>
<testCaseId>Test Cases/test/junittutorial/GreeterTestRunner</testCaseId>
<usingDataBindingAtTestSuiteLevel>true</usingDataBindingAtTestSuiteLevel>
</testCaseLink>
<testCaseLink>
<guid>6137d5f8-c1b7-4b1e-bba2-423e81bcde68</guid>
<guid>d355e10d-e7b6-4f5b-8b0a-5ffef4a78aad</guid>
<isReuseDriver>false</isReuseDriver>
<isRun>true</isRun>
<testCaseId>Test Cases/test/com.kazurayam.junit4ks/JUnitCustomKeywordsTestRuuner</testCaseId>
<testCaseId>Test Cases/test/junittutorial/StarImportProblemDemo</testCaseId>
<usingDataBindingAtTestSuiteLevel>true</usingDataBindingAtTestSuiteLevel>
</testCaseLink>
</TestSuiteEntity>
73 changes: 72 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
plugins {
id 'groovy'
id 'maven-publish'
id 'signing'
}

group = "com.kazurayam"
version = "1.6.2"

def defaultEncoding = 'UTF-8'
tasks.withType(AbstractCompile).each {it.options.encoding = defaultEncoding }
tasks.withType(GroovyCompile).each {it.groovyOptions.encoding = defaultEncoding}

ext {
isReleaseVersion = ! version.endsWith("SNAPSHOT")
groovyVersion = '3.0.17'
}

Expand All @@ -30,7 +37,8 @@ dependencies {
sourceSets {
main {
groovy {
srcDirs = ['Keywords', 'Lib']
srcDirs = ['Keywords', 'Libs']
excludes = ['CustomKeywords.groovy', "Temp*.groovy"]
}
}
test {
Expand All @@ -53,3 +61,66 @@ task publishGroovydoc(type: Copy) {
into 'docs/api'
}
groovydoc.finalizedBy publishGroovydoc

task groovydocJar(type: Jar) {
archiveClassifier = 'javadoc'
from groovydoc
}

task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

publishing {
publications {
junit4ks(MavenPublication) {
artifact sourcesJar
artifact groovydocJar
pom {
groupId = project.group
name = project.rootProject.name
description = 'A Katalon Studio plugin that enables running JUnit4 tests for Custom Keyword classes'
url = 'https://kazurayam.github.io/junit4ks/'
from components.java
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org.licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'kazurayam'
name = 'URAYAMA,kazuaki'
email = 'kazuaki.urayama@gmail.com'
}
}
scm {
connection = "scm:git:https://github.com/kazurayam/${project.rootProject.name}.git"
developerConnection = "scm:git:git@github.com:kazurayam/${project.rootProject.name}.git"
url = "https://github.com/kazurayam/${project.rootProject.name}"
}
}
}
}
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo: snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
}
}
}
}

signing {
sign publishing.publications.junit4ks
}
// I do not want to sign the SNAPSHOT
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu Apr 15 14:13:24 JST 2021
#Wed Feb 21 15:22:11 JST 2024
<<<<<<<=HEAD
=\=\=\=\=\=\=
>>>>>>>=develop
Expand Down

0 comments on commit d64d11b

Please sign in to comment.