Skip to content

Commit 3de9eb9

Browse files
committed
add source to tested project to check workflow
1 parent d5df5b7 commit 3de9eb9

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

package-lock.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"yo-java-helper": "2.1.0"
3939
},
4040
"devDependencies": {
41+
"fs-extra": "8.1.0",
4142
"fs-readdir-recursive": "1.1.0",
4243
"mocha": "*",
4344
"mocha-jshint": "2.3.1",

test/sources/sample/Sample.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package sample;
2+
3+
/**
4+
* Sample source.
5+
*/
6+
public class Sample {
7+
8+
private final Integer x;
9+
10+
public Sample() {
11+
x = 12 + 3;
12+
}
13+
14+
public int getX() {
15+
return x;
16+
}
17+
}

test/test-app.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ let path = require('path'),
55
helpers = require('yeoman-test'),
66
read = require('fs-readdir-recursive'),
77
execFile = require('child_process').execFile,
8+
fs = require('fs-extra'),
89

910
appPath = path.join(__dirname, '../app'),
1011
targetPath = path.join(__dirname, 'temp');
@@ -70,6 +71,7 @@ describe('check simple app generation', function () {
7071
});
7172

7273
it('creates valid project', function (done) {
74+
fs.copySync(path.join(__dirname, 'sources'), targetPath + '/testlib/src/main/java');
7375
this.timeout(300000); //5 min should be enough to download everything
7476
runGradle(targetPath + '/testlib', done);
7577
});
@@ -107,12 +109,13 @@ describe('check multi-module app generation', function () {
107109
assert.file(read(appPath + '/templates/gradle-base'));
108110
assert.file(read(appPath + '/templates/project-base').map(dotfile));
109111
assert.file(read(appPath + '/templates/project-multi').map(dotfile));
110-
assert.file(read(appPath + '/templates/project-multi/bom').map(subdir('foo-bom')));
111-
assert.file(read(appPath + '/templates/project-multi/module').map(subdir('foo-sample')));
112+
assert.file(read(appPath + '/templates/project-multi-modules/bom').map(subdir('foo-bom')));
113+
assert.file(read(appPath + '/templates/project-multi-modules/module').map(subdir('foo-sample')));
112114
assert.file(read(appPath + '/templates/sources').map(dotfile).map(repackage).map(subdir('foo-sample')));
113115
});
114116

115117
it('creates valid project', function (done) {
118+
fs.copySync(path.join(__dirname, 'sources'), targetPath + '/testlib/foo-sample/src/main/java');
116119
this.timeout(300000); //5 min should be enough to download everything
117120
runGradle(targetPath + '/testlib', done);
118121
});

0 commit comments

Comments
 (0)