-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(java17): generate groovy api extension compliant with Java 17
- Loading branch information
Showing
33 changed files
with
900 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"name": "bonita-rest-api-extension-archetype", | ||
"version": "1.6.2" | ||
"version": "1.7.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/test/resources-filtered/testGroovySubModuleProjectPost10/IT.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import java.nio.file.Files | ||
import java.nio.file.Paths | ||
import java.nio.file.StandardCopyOption | ||
|
||
// Run 'mvn install' fisrt and then 'mvn groovy:execute -Dsource=target/test-classes/testGroovySubModuleProject/IT.groovy -Dscope=test' from project root | ||
|
||
// Given | ||
def sourcePath = '${project.basedir}/src/test/resources/testGroovySubModuleProjectPost10/' | ||
def testPath = '${project.build.testOutputDirectory}/testGroovySubModuleProjectPost10/' | ||
def sourceParentFolder = "${sourcePath}/module-parent" | ||
def parentFolder = "${testPath}/module-parent" | ||
def moduleArtifactId = "my-rest-api" | ||
|
||
|
||
println "[Integration Test] Test generation of sub module ${moduleArtifactId} in folder ${parentFolder}" | ||
|
||
// Delete previous run if any | ||
def moduleFolder = new File("${parentFolder}/${moduleArtifactId}") | ||
if (moduleFolder.exists()) { | ||
Files.deleteIfExists(Paths.get("${parentFolder}/${moduleArtifactId}/pom.xml")) | ||
moduleFolder.deleteDir() | ||
// Reset the parent pom (whitout sub-module declaration) | ||
Files.copy(Paths.get("${sourceParentFolder}/pom.xml"), Paths.get("${parentFolder}/pom.xml"), StandardCopyOption.REPLACE_EXISTING); | ||
} | ||
|
||
// When | ||
println "Generate sub module ..." | ||
def sout = new StringBuilder(), serr = new StringBuilder() | ||
def proc = """mvn archetype:generate -B \ | ||
-DarchetypeGroupId=org.bonitasoft.archetypes \ | ||
-DarchetypeArtifactId=bonita-rest-api-extension-archetype \ | ||
-DarchetypeVersion=${project.version} \ | ||
-DgroupId=org.company.api \ | ||
-DartifactId=${moduleArtifactId} \ | ||
-Dversion=0.0.1-SNAPSHOT \ | ||
-Dlanguage=groovy \ | ||
-DbonitaVersion=10.0-SNAPSHOT \ | ||
-DapiName=myRestApi \ | ||
-DapiDisplayName=My-REST-API \ | ||
-DpathTemplate=my-rest-api \ | ||
-DurlParameters=p,c \ | ||
-DhttpVerb=GET | ||
""".execute(null, new File(parentFolder)) | ||
proc.consumeProcessOutput(sout, serr) | ||
proc.waitForOrKill(10 * 60 * 1000) | ||
println "out> $sout\nerr> $serr" | ||
|
||
// Then | ||
println "Verifying generation result ..." | ||
|
||
assert proc.exitValue() == 0: "Maven archetype execution exit code should be 0" | ||
|
||
def parentPomFile = new File("${parentFolder}/pom.xml") | ||
assert parentPomFile.text.contains("<module>${moduleArtifactId}</module>"): 'Parent pom should declare project as sub module' | ||
|
||
def modulePomFile = new File("${parentFolder}/${moduleArtifactId}/pom.xml") | ||
def referencePomFile = new File("${testPath}/reference/pom.xml") | ||
assert referencePomFile.text == modulePomFile.text: 'Reference pom and project pom should have the same content' | ||
|
||
println "SUCCESS" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/test/resources/projects/testDatasourceProject10/archetype.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
groupId=com.company.bonitasoft | ||
artifactId=ds-rest-api | ||
version=1.0.0-SNAPSHOT | ||
package=com.company.bonitasoft | ||
language=groovy | ||
wrapper=false | ||
sp=false | ||
bonitaVersion=10.0.0 | ||
apiName=datasource | ||
apiDisplayName=Datasource Rest API extension | ||
apiDesc=A Rest API extension reading a datasource | ||
httpVerb=GET | ||
pathTemplate=datasource | ||
permissionNames=customPermission1,customPermission2 | ||
urlParameters=userId,startDate |
Empty file.
Oops, something went wrong.