Skip to content
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

#1509 Adapt template sets in Eclipse #1654

Open
wants to merge 240 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
6f5e2ce
#1452 changed dynamic groupId in master-pom.xml to fixed (#1498)
jan-vcapgemini Mar 10, 2022
e258c4b
1452 Prepare for new ConfigurationReader and Adapt Templates process …
jan-vcapgemini Mar 21, 2022
ad233ff
1452 Implemented new configuration reader to read the template sets (…
GuentherJulian Apr 6, 2022
54e3436
1501 Separation of Java Utils across template sets (#1514)
GuentherJulian Apr 8, 2022
36ab7ce
Template set deployables test optimizations (#1515)
jan-vcapgemini Apr 11, 2022
a39ec1c
Add tags, detailed description and tutorial links to config files (#1…
MikeSchumacherCapgemini Apr 27, 2022
4e4b6d3
1455 adaption of template sets (#1520)
GuentherJulian Apr 27, 2022
a1ca29a
1511 enable custom template set group ids for lookup (#1525)
mdukhan May 11, 2022
6c61401
1511 enable custom template set group ids for lookup (#1535)
mdukhan May 13, 2022
882013e
#1509 Ignore extractTemplatesWithOldCinfiguration (#1536)
mdukhan Jun 7, 2022
103ed1c
#1519 added possible Log warning places for CLI (#1538)
mdukhan Jun 14, 2022
28cb652
Merged master into template-set-deployables feature branch (#1543)
jan-vcapgemini Jun 21, 2022
54f0bca
1465 template set documentation (#1546)
jan-vcapgemini Jun 24, 2022
51af790
1502 config upgrade (#1528)
EduardKrieger Jul 4, 2022
b5a2577
#1531 Handle CLI Exception (#1544)
mdukhan Jul 5, 2022
7b6bf79
1551 merge master into template_set_deployables (#1552)
jan-vcapgemini Jul 5, 2022
3dcfcb1
1516 document new configuration structure (#1565)
Zylesto Aug 29, 2022
f95f041
# 1521 Attached Template-set plugin for deployment (#1562)
Ali7223 Sep 4, 2022
2ee15d3
1510 allow template sets to be installed (#1554)
EduardKrieger Sep 7, 2022
f20d731
#1529 added first implementation of extensible artifact search REST A…
jan-vcapgemini Sep 14, 2022
9b96780
Merge branch 'master' into template-set-deployables
maybeec Sep 20, 2022
9bd84b8
fixed merge errors
maybeec Sep 20, 2022
7a3b6e4
fix merge error (#1581)
EduardKrieger Sep 21, 2022
5f79726
1518 automatically ask for upgrade on reading monolithic templates fr…
mdukhan Oct 27, 2022
7daa568
1580 rework test application using entity class (#1603)
leonie19s Nov 18, 2022
c95a9df
1517 discovery of template sets (#1585)
Zylesto Dec 16, 2022
0176c1a
#1619 cleanup docs
maybeec Jan 2, 2023
edaed0e
#1619 upgrade all sources to jdk 11
maybeec Jan 2, 2023
0ddc3bc
#1619 fix plugins build to run on jdk 11
maybeec Jan 2, 2023
f4794fd
Merge branch 'master' into template-set-deployables
maybeec Jan 2, 2023
f1ad8d7
Merge branch 'master' into template-set-deployables
maybeec Jan 3, 2023
0d61fda
spelling corrections
maybeec Jan 3, 2023
1d8997a
Merge branch 'master' into template-set-deployables
maybeec Jan 3, 2023
efd512e
Added correct settings URL for cobigen setup
maybeec Jan 3, 2023
5e1a7e3
Merge branch 'master' into template-set-deployables
maybeec Jan 3, 2023
f73d720
Fix merge error
maybeec Jan 3, 2023
4f9da87
Removed xvfb-action
maybeec Jan 4, 2023
fbb5331
trying to fix strange execution problem in GHA
maybeec Jan 4, 2023
1ded60f
Also resolve and cache dependencies for tycho
maybeec Jan 4, 2023
dc72408
fix build on windows
maybeec Jan 4, 2023
b597945
fixed 2018-12 target + fixed eclipse test + fixed M2E compatibility
maybeec Jan 4, 2023
e4f9a00
removed unnecessary junit headless dependency failing on sonar run
maybeec Jan 5, 2023
efdc183
upgraded openapi parser to latest version of networknt
maybeec Jan 5, 2023
b76c231
upgraded openapi parser to latest version of networknt
maybeec Jan 5, 2023
9dbe233
Revert "upgraded openapi parser to latest version of networknt"
maybeec Jan 5, 2023
9aed99a
Revert "upgraded openapi parser to latest version of networknt"
maybeec Jan 5, 2023
eb8c1c1
Merge branch 'master' into template-set-deployables
maybeec Jan 5, 2023
03d219b
removed stupid non-used testdata
maybeec Jan 6, 2023
49ae604
store workflow status for sonar analysis
maybeec Jan 6, 2023
556cff8
store workflow status for sonar analysis
maybeec Jan 6, 2023
199c84d
fix workflow
maybeec Jan 6, 2023
4e097f8
added maven repository cache for faster execution (#1625)
EduardKrieger Jan 6, 2023
e7ad216
trying to flatten CI/CD to speed up
maybeec Jan 7, 2023
8ab4a8d
fixing dependency caching + fixing build component script + fixing ma…
maybeec Jan 7, 2023
f4a9ebc
fix dependency caching
maybeec Jan 7, 2023
f339117
fix build script
maybeec Jan 7, 2023
81e95c3
automatically enable debug mode + better matrix parameter view on git…
maybeec Jan 8, 2023
2c1db7f
fixing detection of GHA debug mode
maybeec Jan 8, 2023
72d89a8
debug test execution
maybeec Jan 9, 2023
86122c8
enabled new enableCrossOsArchive of github cache
maybeec Jan 9, 2023
357a938
Workaround for actions/cache#1059
maybeec Jan 9, 2023
d939f03
fix workflow
maybeec Jan 9, 2023
81c4d15
fix workflow
maybeec Jan 9, 2023
e6a2a72
fix workflow
maybeec Jan 9, 2023
e8e0ce4
set java 17 for windows build
maybeec Jan 9, 2023
fc6fc18
actions/cache#1059 workaround - trying to locate m2 repo in working d…
maybeec Jan 11, 2023
35ac03e
add logging out env to understand temporary debug mode detection
maybeec Jan 11, 2023
f854bf1
fixed automated maven debug log on runner debug + trying to fix maven…
maybeec Jan 11, 2023
fbda14e
try to fix maven cache location consolidation accross OS
maybeec Jan 11, 2023
67fdce9
trying different local repository setting
maybeec Jan 12, 2023
dd94bab
fixing cache mismatches
maybeec Jan 12, 2023
e28e03b
fixing checkout on windows
maybeec Jan 12, 2023
8918a9f
more cache debugging!
maybeec Jan 12, 2023
3e655e1
more cache debugging!
maybeec Jan 12, 2023
67de615
more cache debugging
maybeec Jan 12, 2023
0fbb14c
fixing odd cache path
maybeec Jan 12, 2023
c10ccce
new try for cross-os build-config
maybeec Jan 12, 2023
a6949e0
new try for cross-os build-config
maybeec Jan 12, 2023
715a962
new try for cross-os build-config
maybeec Jan 12, 2023
ed9670c
new try for cross-os build-config
maybeec Jan 12, 2023
be0cd10
new try for cross-os build-config
maybeec Jan 12, 2023
f9e8152
trying to fix maven repo cache
maybeec Jan 12, 2023
d9758cb
splitting dependency resolution and plugin resolution
maybeec Jan 12, 2023
033d462
enabling batch processing and fixing maven settings
maybeec Jan 12, 2023
e4843bd
built just once on linux + restore also p2 for tests + removed debugging
maybeec Jan 12, 2023
65891b7
trying to fix tests by providing test settings.xml in home folder
maybeec Jan 12, 2023
b498c23
Fix settings overwriting
maybeec Jan 12, 2023
b971f77
enable xvfb run for linux for eclipse tests + fixing settings.xml ove…
maybeec Jan 13, 2023
c8c7898
fix settings.xml overwriting
maybeec Jan 13, 2023
9ff3ba5
try fixing settings.xml rewrite
maybeec Jan 13, 2023
10ffe53
Merge branch 'master' into template-set-deployables
maybeec Jan 23, 2023
1140415
Merge branch 'template-set-deployables' into flattened-cicd
maybeec Jan 23, 2023
8e435a4
changing path to be static on cache declaration
maybeec Jan 23, 2023
2208391
removed coverage report to be executed everytime
maybeec Jan 23, 2023
c66cdab
fixing m-m-m NlsBundle Exception on CLI tests
maybeec Jan 24, 2023
3e65ddf
fixing -h option for right color coding
maybeec Jan 24, 2023
40bd436
fixing p2 compiler issues
maybeec Jan 24, 2023
62eb061
debugging + cleanup
maybeec Jan 25, 2023
85e44ba
workaround for https://github.com/m-m-m/code/issues/43
maybeec Jan 26, 2023
94cd277
disabled debug logging + readme update
maybeec Jan 27, 2023
2260ee6
fixed a bug in findTemplates (#1630)
EduardKrieger Jan 27, 2023
5f0588b
try fixing unnecessary timeout on windows
maybeec Jan 27, 2023
b2b328e
Merge branch 'master' into template-set-deployables
maybeec Mar 13, 2023
514b1e6
#1495 Combine template and configuration files into template set file…
KHucklenbroich Mar 13, 2023
340b569
added TODO
jan-vcapgemini Mar 16, 2023
a53b75d
added TODO
jan-vcapgemini Mar 16, 2023
485d5a4
fixed eclipse tests freezes
jan-vcapgemini Mar 17, 2023
9148d62
1622 Restore and fixed adaptTemplatesTest on eclipse (#1641)
cedricarnauld123 Mar 17, 2023
2e794bd
#1622 fixed eclipse adapt monolithic templates test
jan-vcapgemini Mar 17, 2023
a01765e
added TODO
jan-vcapgemini Mar 17, 2023
faee4f1
added TODO
jan-vcapgemini Mar 17, 2023
a32120b
temporarily disabled upgrader test in eclipse
jan-vcapgemini Mar 17, 2023
cd38c95
added TODO
jan-vcapgemini Mar 17, 2023
2b1360d
applied proper reformat
jan-vcapgemini Mar 17, 2023
ead77d6
applied proper reformat
jan-vcapgemini Mar 17, 2023
3b92e6f
applied proper reformat
jan-vcapgemini Mar 17, 2023
8318b2a
applied proper reformat
jan-vcapgemini Mar 17, 2023
e15f077
applied proper reformat
jan-vcapgemini Mar 17, 2023
587f983
added method to change CobiGen home
jan-vcapgemini Mar 17, 2023
5ca8f21
added TODO
jan-vcapgemini Mar 17, 2023
177f9d3
adjusted javadoc
jan-vcapgemini Mar 17, 2023
f41220b
added TODO
jan-vcapgemini Mar 17, 2023
694b0c9
applied proper reformat
jan-vcapgemini Mar 17, 2023
bfb5536
refactored AbstractContextConfigurationReader
jan-vcapgemini Mar 17, 2023
f75dfe7
made fields private
jan-vcapgemini Mar 17, 2023
91edfcc
made fields private
jan-vcapgemini Mar 17, 2023
2c440e2
added TODO
jan-vcapgemini Mar 17, 2023
9d7ca6d
cleanup
jan-vcapgemini Mar 17, 2023
21b3f71
removed unused interfaces
jan-vcapgemini Mar 17, 2023
167a978
adjusted template set documentation
jan-vcapgemini Mar 17, 2023
35f5d1a
updated google guava to 31.1-jre
jan-vcapgemini Mar 17, 2023
472ea6e
made CobiGenFactory tests functional
jan-vcapgemini Mar 17, 2023
b3dc966
moved template-set.xml into correct folder
jan-vcapgemini Mar 17, 2023
9112b26
applied proper reformat
jan-vcapgemini Mar 17, 2023
65b988e
added test path check to CobiGenPaths
jan-vcapgemini Mar 20, 2023
9625a53
added TODO
jan-vcapgemini Mar 21, 2023
f251ea3
applied proper reformat
jan-vcapgemini Mar 21, 2023
edc17c7
removed unused test resource files
jan-vcapgemini Mar 21, 2023
7c1c6af
cleanup of ConfigurationFinder
jan-vcapgemini Mar 21, 2023
0f8b48b
moved method beneath constructor
jan-vcapgemini Mar 21, 2023
654499f
adjusted javadocs
jan-vcapgemini Mar 21, 2023
b264377
removed unused files
jan-vcapgemini Mar 21, 2023
d522e05
fixed PostPoneUtil tests
jan-vcapgemini Mar 22, 2023
abbac3e
removed extra isZipFile check
jan-vcapgemini Mar 22, 2023
28d91bc
cleanup
jan-vcapgemini Mar 22, 2023
0b79b14
adjusted template set upgrade documentation
jan-vcapgemini Mar 22, 2023
af182c4
1495 fixed working branch adapt templates feature (#1645)
quantumfate Mar 22, 2023
ef61c78
added missing test resource file
jan-vcapgemini Mar 24, 2023
8e5cf73
#1509 implement and fix adaptTemplate and adaptTemplateSets
cedricarnauld123 Mar 28, 2023
cd5a294
#1638 implemented download jar process (from properties) (#1653)
jan-vcapgemini Mar 28, 2023
bf97608
#1509 using the processCobiGenAndPostponeUpgrade method in testBasicO…
cedricarnauld123 Mar 28, 2023
0ecb4e4
#1509 clean up
cedricarnauld123 Mar 28, 2023
9f31845
fixed template installation tests
jan-vcapgemini Mar 29, 2023
fcfc0e8
adjusted javadoc of test
jan-vcapgemini Mar 29, 2023
3314e71
removed unnecessary test and resources
jan-vcapgemini Mar 29, 2023
151698e
renamed method and adjusted javadoc
jan-vcapgemini Mar 29, 2023
0c07125
adjusted javadoc
jan-vcapgemini Mar 29, 2023
fb9ba81
adjusted javadoc
jan-vcapgemini Mar 29, 2023
540abee
removed empty newline
jan-vcapgemini Mar 29, 2023
39aa279
applied rest of refactoring
jan-vcapgemini Mar 29, 2023
0c28780
added fallback if no repositories were found
jan-vcapgemini Mar 30, 2023
da1f980
added issue links to TODOs
jan-vcapgemini Mar 31, 2023
52f4f85
fixed template set file tree
jan-vcapgemini Mar 31, 2023
bc64317
adjusted javadoc of ConfigurationFinder
jan-vcapgemini Mar 31, 2023
d68fc46
adjusted javadocs
jan-vcapgemini Mar 31, 2023
4bf5ca9
added issue to TODO
jan-vcapgemini Mar 31, 2023
217c8a4
added issue to TODO
jan-vcapgemini Mar 31, 2023
beb7248
removed unused fields
jan-vcapgemini Mar 31, 2023
1a081e2
added javadoc descriptions for constants
jan-vcapgemini Mar 31, 2023
f163973
added issue to TODO
jan-vcapgemini Mar 31, 2023
64683ab
adjusted javadocs
jan-vcapgemini Mar 31, 2023
27dced6
added issue to TODO
jan-vcapgemini Mar 31, 2023
07e7ad8
fixed download by properties
jan-vcapgemini Mar 31, 2023
b045ea2
removed unused class variable
jan-vcapgemini Mar 31, 2023
b34d7e6
prepared template set version conflict test
jan-vcapgemini Mar 31, 2023
82d0ad4
cleanup of unnecessary condition
jan-vcapgemini Mar 31, 2023
ac2efa9
Simple fixes
NelsonNew Apr 1, 2023
e79d214
applied requested changes
jan-vcapgemini Apr 3, 2023
a5757ff
added TODO and link to issue
jan-vcapgemini Apr 3, 2023
75adfe4
implemented requested changes
jan-vcapgemini Apr 3, 2023
a51ee91
implemented requested changes
jan-vcapgemini Apr 3, 2023
b5574a1
added issue to TODO
jan-vcapgemini Apr 3, 2023
c5e9d33
removed unused field
jan-vcapgemini Apr 3, 2023
b98e202
moved getters under constructor
jan-vcapgemini Apr 3, 2023
ae0c108
Typo fix
NelsonNew Apr 3, 2023
0611e0f
Finished sentence
NelsonNew Apr 3, 2023
5113482
#1667 Made template set root directories accessible for the reader
jan-vcapgemini Apr 3, 2023
b421049
added TODOs with linked issues
jan-vcapgemini Apr 3, 2023
a25b371
implemented requested changes
jan-vcapgemini Apr 3, 2023
01ef924
implemented requested changes
jan-vcapgemini Apr 3, 2023
950aaa7
implemented requested changes
jan-vcapgemini Apr 3, 2023
28f53b0
#1670 hotfix
jan-vcapgemini Apr 4, 2023
6a1e6f9
added TODO with link to issue
jan-vcapgemini Apr 4, 2023
ad76aea
#1668 added issue to TODO
jan-vcapgemini Apr 4, 2023
980e893
#1671 added link to issue to TODO
jan-vcapgemini Apr 4, 2023
02bdb62
adjusted javadoc
jan-vcapgemini Apr 4, 2023
26b6c2c
added issue to TODOs
jan-vcapgemini Apr 5, 2023
2012d11
sonatype-lift fixes
jan-vcapgemini Apr 5, 2023
28ce188
removed commented code
jan-vcapgemini Apr 5, 2023
f54e6c3
added TODO with link to issue
jan-vcapgemini Apr 5, 2023
e3469e8
added TODO with link to issue
jan-vcapgemini Apr 5, 2023
f3de717
added TODO with link to issue
jan-vcapgemini Apr 5, 2023
f7f16ec
added TODO with link to issue
jan-vcapgemini Apr 5, 2023
677ea7c
sonatype-lift changes
jan-vcapgemini Apr 6, 2023
4d728ba
sonatype-lift changes
jan-vcapgemini Apr 6, 2023
f3a4399
sonatype-lift changes
jan-vcapgemini Apr 6, 2023
ed156b2
added comment
jan-vcapgemini Apr 6, 2023
79f94e8
added TODO and link to issue
jan-vcapgemini Apr 6, 2023
587b2e9
fixed typo
jan-vcapgemini Apr 6, 2023
08e7892
sonatype-lift changes, hotfix
jan-vcapgemini Apr 6, 2023
5af0844
fixed openapi-parser version
jan-vcapgemini Apr 6, 2023
1b49fb0
added TODO and link to issue
jan-vcapgemini Apr 6, 2023
c4ce99d
adjusted javadoc
jan-vcapgemini Apr 6, 2023
6ae0954
added missing javadocs
jan-vcapgemini Apr 6, 2023
3ef6f64
added TODO and link to issue
jan-vcapgemini Apr 6, 2023
deb68b6
removed unused files
jan-vcapgemini Apr 6, 2023
ee90c8b
adjusted javadoc
jan-vcapgemini Apr 6, 2023
5983e65
added TODO and link to issue
jan-vcapgemini Apr 6, 2023
c0c39c4
added TODO and link to issue
jan-vcapgemini Apr 6, 2023
e82340a
cleanup
jan-vcapgemini Apr 6, 2023
2a96c00
adjusted javadoc of test
jan-vcapgemini Apr 6, 2023
52ba0fb
added javadoc description
jan-vcapgemini Apr 6, 2023
a2a4137
adjusted javadoc
jan-vcapgemini Apr 6, 2023
676ac3e
cleanup
jan-vcapgemini Apr 6, 2023
d57a660
fix deploy script to allow local updatesite builds
maybeec Apr 9, 2023
5c64a1e
fix eclipse e2e test classpath
maybeec Apr 9, 2023
ba8f1b9
adjusted javadocs
jan-vcapgemini Apr 11, 2023
d091ce0
added TODO and link to issue
jan-vcapgemini Apr 11, 2023
ebd5dec
generating platform definition based on local plugins build.
maybeec Apr 11, 2023
bb245f1
removed 2nd initialization of CobiGen
jan-vcapgemini Apr 13, 2023
682538e
Merge branch 'master' into template-set-deployables
jan-vcapgemini Apr 13, 2023
7c4d31b
spellcheck fixes
jan-vcapgemini Apr 13, 2023
35ca10a
fixed last spellcheck issues
jan-vcapgemini Apr 13, 2023
603c105
cleanup and fixing eclipse import issues with m2e
maybeec Apr 14, 2023
de4177b
Revert "cleanup and fixing eclipse import issues with m2e"
jan-vcapgemini Apr 17, 2023
58cf2c9
Revert "generating platform definition based on local plugins build."
jan-vcapgemini Apr 17, 2023
5821c9d
Revert "fix eclipse e2e test classpath"
jan-vcapgemini Apr 17, 2023
8d68916
Fixed elif syntax
maybeec Apr 17, 2023
2219f4a
Merge branch 'template-set-deployables' into 1509-adaptTemplateSet-an…
jan-vcapgemini Apr 17, 2023
0eeb9d2
Merge branch 'master' into 1509-adaptTemplateSet-and-adaptTemplate
jan-vcapgemini Apr 17, 2023
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ cobigen/cobigen-core-systemtest/src/test/resources/testdata/systemtest/TemplateP
cobigen/cobigen-core-systemtest/src/test/resources/testdata/systemtest/TemplateProcessingTest/template-sets/downloaded/crud-java-server-app-1.0.0-sources.jar
cobigen/cobigen-core-systemtest/src/test/resources/testdata/systemtest/TemplateProcessingTest/template-sets/downloaded/crud-java-server-app-complex-1.0.0.jar
cobigen/cobigen-core-systemtest/src/test/resources/testdata/systemtest/TemplateProcessingTest/template-sets/downloaded/crud-java-server-app-complex-1.0.0-sources.jar
cobigen-eclipse/cobigen-eclipse-test/src/main/resources/AdaptTemplatesTest/template-sets/downloaded/crud-java-server-app-1.0.0.jar
cobigen-eclipse/cobigen-eclipse-test/src/main/resources/AdaptTemplatesTest/template-sets/downloaded/crud-java-server-app-1.0.0-sources.jar
30 changes: 30 additions & 0 deletions cobigen-eclipse/cobigen-eclipse-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<properties>
<tycho.testArgLine.enriched>${surefireArgLineIntegration} -Xms512m -Xmx2048m -XX:+DisableExplicitGC</tycho.testArgLine.enriched>
<enforcer.skip>true</enforcer.skip>
<maven.test.AdaptTemplatesTest1>src\main\resources\AdaptTemplatesTest\template-sets\adapted\crud-openapi-java-server-app</maven.test.AdaptTemplatesTest1>

</properties>

<dependencies>
Expand Down Expand Up @@ -58,6 +60,34 @@
</execution>
</executions>
</plugin>

<!-- Building a Maven project that is used on the tests -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>Install test adaptTemplatesTests1</id>
<phase>test-compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<workingDirectory>${maven.test.AdaptTemplatesTest1}</workingDirectory>
<arguments>
<argument>install</argument>
<!-- https://stackoverflow.com/a/66801171 -->
<argument>-Djansi.force=true</argument>
<argument>-Djansi.passthrough=true</argument>
<argument>-B</argument>
<argument>-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.apache.commons.io.FileUtils;
import org.eclipse.core.resources.IFile;
Expand All @@ -16,6 +19,7 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -44,6 +48,9 @@ public class AdaptTemplatesTest extends SystemTest {
/** Line separator, e.g. for windows '\r\n' */
public static final String LINE_SEPARATOR = java.lang.System.getProperty("line.separator");

/* Root path for templateSets jar */
private static final String testResource = "src/main/resources/AdaptTemplatesTest/template-sets/downloaded";

/**
* Setup workbench appropriately for tests
*
Expand All @@ -60,7 +67,92 @@ public static void setupClass() throws Exception {
*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test description does not fit.

* @throws Exception test fails
*/
public void testBasicOpenAPIGenerationWithAdaptTemplates() throws Exception {
public void testBasicOpenAPIGenerationWithAdaptTemplateSets() throws Exception {

// copy sample project to external location and import it into the workspace
String testProjName = "ExtTestProj";
IJavaProject project = this.tmpMavenProjectRule.createProject(testProjName);
FileUtils.copyFile(new File(resourcesRootPath + "input/adapt-templates.yml"),
project.getUnderlyingResource().getLocation().append("adapt-templates.yml").toFile());
project.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
this.tmpMavenProjectRule.updateProject();

/**
* TODO Before the templates are made available online, the update (download) command cannot be tested.
*/
// EclipseCobiGenUtils.runAndCaptureUpdateTemplates(bot);
Comment on lines +80 to +83
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed as there will be no update functionality in Eclipse anymore.

EclipseCobiGenUtils.runAndCaptureAdaptTemplatesSets(bot);
EclipseUtils.openErrorsTreeInProblemsView(bot);
// expand the new file in the package explorer
SWTBotView view = bot.viewById(JavaUI.ID_PACKAGES);
SWTBotTreeItem javaClassItem = view.bot().tree().expandNode(testProjName, "adapt-templates.yml");
javaClassItem.select();

// execute CobiGen
EclipseCobiGenUtils.processCobiGen(bot, javaClassItem, 25000, "CRUD devon4j Server>CRUD REST services");
bot.waitUntil(new AllJobsAreFinished(), 10000);
// increase timeout as the openAPI parser is slow on initialization
EclipseCobiGenUtils.confirmSuccessfullGeneration(bot, 40000);

bot.waitUntil(new AllJobsAreFinished(), 10000);
IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(testProjName);
IFile generationResult = proj.getFile(
"src/main/java/com/devonfw/test/sampledatamanagement/service/impl/rest/SampledatamanagementRestServiceImpl.java");

assertThat(generationResult.exists()).isTrue();
}

/**
* Test for external projects (not in workspace) taken as input for generation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description does not fit.

*
* @throws Exception test fails
*/
public void testAdaptTemplatesAndImportIntoEclipse() throws Exception {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template-sets?


// copy sample project to external location and import it into the workspace
String testProjName = "ExtTestProj";
IJavaProject project = this.tmpMavenProjectRule.createProject(testProjName);
FileUtils.copyFile(new File(resourcesRootPath + "input/adapt-templates.yml"),
project.getUnderlyingResource().getLocation().append("adapt-templates.yml").toFile());
project.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
this.tmpMavenProjectRule.updateProject();

EclipseCobiGenUtils.runAndCaptureAdaptTemplatesSets(bot);

// EclipseUtils.updateMavenProject(bot, ResourceConstants.TEMPLATE_SETS_CONFIG_PROJECT_NAME);
Copy link
Collaborator

@jan-vcapgemini jan-vcapgemini Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove or re-enable.


// expand the new file in the package explorer
SWTBotView view = bot.viewById(JavaUI.ID_PACKAGES);
SWTBotTreeItem javaClassItem = view.bot().tree().expandNode(testProjName, "adapt-templates.yml");
javaClassItem.select();

// execute CobiGen
EclipseCobiGenUtils.processCobiGen(bot, javaClassItem, 25000, "CRUD devon4j Server>CRUD REST services");
bot.waitUntil(new AllJobsAreFinished(), 10000);
// increase timeout as the openAPI parser is slow on initialization
EclipseCobiGenUtils.confirmSuccessfullGeneration(bot, 40000);
bot.waitUntil(new AllJobsAreFinished(), 10000);

// EclipseUtils.openErrorsTreeInProblemsView(bot);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove or re-enable.


IProject generatorProjOfTempltesSets = ResourcesPlugin.getWorkspace().getRoot()
.getProject(ResourceConstants.TEMPLATE_SETS_CONFIG_PROJECT_NAME);
bot.waitUntil(new AllJobsAreFinished(), 10000);

Path adaptedFolder = Paths.get(generatorProjOfTempltesSets.getLocationURI())
.resolve(ResourceConstants.TEMPLATE_SETS_ADAPTED);

assertThat(generatorProjOfTempltesSets.exists()).isTrue();
assertThat(Files.exists(adaptedFolder)).isTrue();

}

/**
* Test for external projects (not in workspace) taken as input for generation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description does not fit.

*
* @throws Exception test fails
*/
public void testBasicOpenAPIGenerationWithAdaptMonolithicTemplates() throws Exception {

// copy sample project to external location and import it into the workspace
String testProjName = "ExtTestProj";
Expand All @@ -72,15 +164,9 @@ public void testBasicOpenAPIGenerationWithAdaptTemplates() throws Exception {

// retrieve CobiGen home directory (overwritten through environment variables)
File templatesDirectory = CobiGenPaths.getTemplatesFolderPath().toFile();

// create templates directory as this should be present in this scenario
this.tempFolder.newFolder("playground", "project", "templates");

// download latest monolithic templates to simulate existing template jars
TemplatesJarUtil.downloadLatestDevon4jTemplates(true, templatesDirectory);
TemplatesJarUtil.downloadLatestDevon4jTemplates(false, templatesDirectory);

// adapt template jars into CobiGen_Templates project
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

EclipseCobiGenUtils.runAndCaptureAdaptTemplates(bot);
EclipseUtils.updateMavenProject(bot, ResourceConstants.CONFIG_PROJECT_NAME);

Expand All @@ -93,7 +179,6 @@ public void testBasicOpenAPIGenerationWithAdaptTemplates() throws Exception {

// execute CobiGen
EclipseCobiGenUtils.processCobiGenAndPostponeUpgrade(bot, javaClassItem, "CRUD devon4j Server>CRUD REST services");

bot.waitUntil(new AllJobsAreFinished(), 10000);
// increase timeout as the openAPI parser is slow on initialization
EclipseCobiGenUtils.confirmSuccessfullGeneration(bot, 40000);
Expand All @@ -104,19 +189,57 @@ public void testBasicOpenAPIGenerationWithAdaptTemplates() throws Exception {
"src/main/java/com/devonfw/test/sampledatamanagement/service/impl/rest/SampledatamanagementRestServiceImpl.java");

assertThat(generationResult.exists()).isTrue();
}

/*
*
* Test of testBasicOpenAPIGenerationWithAdaptTemplates with custom COBIGEN_HOME environment variable
*
*/
@Test
public void testAdaptMonolithicTemplatesAndGenerate() throws Exception {

File tmpProject = this.tempFolder.newFolder("playground", "project");
withEnvironmentVariable("COBIGEN_HOME", tmpProject.toPath().toString())
.execute(() -> testBasicOpenAPIGenerationWithAdaptMonolithicTemplates());
}

/**
* Test of testBasicOpenAPIGenerationWithAdaptTemplates with custom COBIGEN_HOME environment variable
* TODO Test of testBasicOpenAPIGenerationWithAdaptTemplates with custom template-sets after adapt the jar files
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check this description.

*
* @throws Exception test fails
*/
@Test
public void testAdaptTemplatesAndGenerate() throws Exception {
@Ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignored?

public void testAdaptTemplateSetsAndGenerate() throws Exception {

Path devTemplatesPath = new File(
AdaptTemplatesTest.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile()
.getParentFile().toPath().resolve("cobigen-templates").resolve("crud-openapi-java-server-app")
.resolve("target").resolve("crud-openapi-java-server-app-2021.12.007-SNAPSHOT.jar");

File tmpProject = this.tempFolder.newFolder("playground", "project");
File downloaded = this.tempFolder.newFolder("playground", "project", "template-sets", "downloaded");
FileUtils.copyFileToDirectory(devTemplatesPath.toFile(), downloaded);
withEnvironmentVariable("COBIGEN_HOME", tmpProject.toPath().toString())
.execute(() -> testBasicOpenAPIGenerationWithAdaptTemplates());
.execute(() -> testBasicOpenAPIGenerationWithAdaptTemplateSets());
}

/**
* Test adaption of template-sets/downloaded/.jar files and importing the project into Eclipse
*
* @throws Exception
*/
@Test
public void testAdaptTemplateSetsAndImport() throws Exception {

File tmpProject = this.tempFolder.newFolder("playground", "project");
File downloaded = this.tempFolder.newFolder("playground", "project", "template-sets", "downloaded");

FileUtils.copyDirectory(new File(testResource), downloaded);

withEnvironmentVariable("COBIGEN_HOME", tmpProject.toPath().toString())
.execute(() -> testAdaptTemplatesAndImportIntoEclipse());

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellIsActive;
import static org.eclipse.swtbot.swt.finder.waits.Conditions.widgetIsEnabled;

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
Expand Down Expand Up @@ -361,7 +362,8 @@ private static void captureAdvancedHealthCheck(SWTWorkbenchBot bot) {
*/
public static void runAndCaptureUpdateTemplates(SWTWorkbenchBot bot) throws Exception {

ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
IWorkspace workspace = ResourcesPlugin.getWorkspace();
workspace.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
Comment on lines +365 to +366
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed?

bot.waitUntil(new AllJobsAreFinished(), DEFAULT_TIMEOUT); // build might take some time

SWTBotView view = bot.viewById(JavaUI.ID_PACKAGES);
Expand Down Expand Up @@ -402,6 +404,26 @@ public static void runAndCaptureAdaptTemplates(SWTWorkbenchBot bot) throws Excep
informationDialog.bot().button("Ok").click();
}

/**
* Checks the CobiGen Adapt TemplateSets and takes screenshots of it.
*
* @param bot to process the Adapt Templates command
* @throws Exception test fails
*/
public static void runAndCaptureAdaptTemplatesSets(SWTWorkbenchBot bot) throws Exception {

ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
bot.waitUntil(new AllJobsAreFinished(), DEFAULT_TIMEOUT); // build might take some time

SWTBotView view = bot.viewById(JavaUI.ID_PACKAGES);
view.bot().tree().contextMenu("CobiGen").menu("Adapt Templates...").click();

SWTBotShell informationDialog = bot.shell("Information");
bot.waitUntil(new AnyShellIsActive("Information"), DEFAULT_TIMEOUT);
takeScreenshot(bot, "Adapt Templates Information");
informationDialog.bot().button("Ok").click();
}

/**
* Takes a screenshot (*.jpeg) of the current screen encoding test method and class and appends the given identifier
* to the file name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.devonfw.test</groupId>
<artifactId>crud-java-server-app</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>../../downloaded</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<skipSource>${skip.deployment}</skipSource>
<outputDirectory>../../downloaded</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- Inject Maven Properties in java-templates source folder -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>generate-maven-properties-class</id>
<goals>
<goal>filter-sources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Integrate POM manually</echo>
<copy file="pom.xml" tofile="${project.build.outputDirectory}/pom.xml"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading