aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/java/install_gradle_and_maven.sh8
-rw-r--r--test/java/install_gradle_and_maven_for_user.sh21
-rw-r--r--test/java/scenarios.json16
3 files changed, 44 insertions, 1 deletions
diff --git a/test/java/install_gradle_and_maven.sh b/test/java/install_gradle_and_maven.sh
index a81dd9e..c6aa3e5 100644
--- a/test/java/install_gradle_and_maven.sh
+++ b/test/java/install_gradle_and_maven.sh
@@ -5,9 +5,17 @@ set -e
# Optional: Import test library
source dev-container-features-test-lib
+check "user is root" whoami | grep root
+
check "java" java --version
check "gradle" gradle --version
+
+cd /tmp && gradle init --type basic --dsl groovy --incubating --project-name test
+check "GRADLE_USER_HOME exists" ls -la /root | grep ".gradle"
+
check "maven" mvn --version
+cd /tmp && mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
+check "m2 exists" ls -la /root | grep ".m2"
# Report result
reportResults
diff --git a/test/java/install_gradle_and_maven_for_user.sh b/test/java/install_gradle_and_maven_for_user.sh
new file mode 100644
index 0000000..c724092
--- /dev/null
+++ b/test/java/install_gradle_and_maven_for_user.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+# Optional: Import test library
+source dev-container-features-test-lib
+
+check "user is vscode" whoami | grep vscode
+
+check "java" java --version
+check "gradle" gradle --version
+
+cd /tmp && gradle init --type basic --dsl groovy --incubating --project-name test
+check "GRADLE_USER_HOME exists" ls -la /home/vscode | grep ".gradle"
+
+check "maven" mvn --version
+cd /tmp && mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
+check "m2 exists" ls -la /home/vscode | grep ".m2"
+
+# Report result
+reportResults
diff --git a/test/java/scenarios.json b/test/java/scenarios.json
index 659a857..82e0795 100644
--- a/test/java/scenarios.json
+++ b/test/java/scenarios.json
@@ -8,6 +8,20 @@
}
}
},
+ "install_gradle_and_maven_for_user": {
+ "image": "ubuntu:focal",
+ "remoteUser": "vscode",
+ "features": {
+ "common-utils": {
+ "username": "vscode"
+ },
+ "java": {
+ "version": "latest",
+ "installGradle": true,
+ "installMaven": true
+ }
+ }
+ },
"install_gradle_and_maven": {
"image": "ubuntu:focal",
"features": {
@@ -18,4 +32,4 @@
}
}
}
-} \ No newline at end of file
+}