GeezerVison is showing github.com — Add Devcontainer Support (#3156) · gittcommands/Java@0d97d0b
File treeExpand file treeCollapse file tree Open diff view settings src/test/java/com/thealgorithms/others
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +25Lines changed: 25 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/java/.devcontainer/base.Dockerfile | | 2 | + | | 3 | +# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster | | 4 | +ARG VARIANT="17-bullseye" | | 5 | +FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT} | | 6 | + | | 7 | +# [Option] Install Maven | | 8 | +ARG INSTALL_MAVEN="false" | | 9 | +ARG MAVEN_VERSION="" | | 10 | +# [Option] Install Gradle | | 11 | +ARG INSTALL_GRADLE="false" | | 12 | +ARG GRADLE_VERSION="" | | 13 | +RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \ | | 14 | + && if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi | | 15 | + | | 16 | +# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 | | 17 | +ARG NODE_VERSION="none" | | 18 | +RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | | 19 | + | | 20 | +# [Optional] Uncomment this section to install additional OS packages. | | 21 | +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | | 22 | +# && apt-get -y install --no-install-recommends <your-package-list-here> | | 23 | + | | 24 | +# [Optional] Uncomment this line to install global node packages. | | 25 | +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 |
Collapse file Copy file name to clipboard +47Lines changed: 47 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | | 2 | +// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/java | | 3 | +{ | | 4 | + "name": "Java", | | 5 | + "build": { | | 6 | + "dockerfile": "Dockerfile", | | 7 | + "args": { | | 8 | + // Update the VARIANT arg to pick a Java version: 11, 17 | | 9 | + // Append -bullseye or -buster to pin to an OS version. | | 10 | + // Use the -bullseye variants on local arm64/Apple Silicon. | | 11 | + "VARIANT": "17-bullseye", | | 12 | + // Options | | 13 | + "INSTALL_MAVEN": "true", | | 14 | + "INSTALL_GRADLE": "true", | | 15 | + "NODE_VERSION": "lts/*" | | 16 | + } | | 17 | + }, | | 18 | + | | 19 | + // Configure tool-specific properties. | | 20 | + "customizations": { | | 21 | + // Configure properties specific to VS Code. | | 22 | + "vscode": { | | 23 | + // Set *default* container specific settings.json values on container create. | | 24 | + "settings": { | | 25 | + }, | | 26 | + | | 27 | + // Add the IDs of extensions you want installed when the container is created. | | 28 | + "extensions": [ | | 29 | + "vscjava.vscode-java-pack", | | 30 | + "GitHub.copilot", | | 31 | + ] | | 32 | + } | | 33 | + }, | | 34 | + | | 35 | + // Use 'forwardPorts' to make a list of ports inside the container available locally. | | 36 | + // "forwardPorts": [], | | 37 | + | | 38 | + // Use 'postCreateCommand' to run commands after the container is created. | | 39 | + "postCreateCommand": "java -version", | | 40 | + | | 41 | + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | | 42 | + "remoteUser": "vscode", | | 43 | + "features": { | | 44 | + "git": "os-provided", | | 45 | + "github-cli": "latest" | | 46 | + } | | 47 | +} |
Collapse file Copy file name to clipboardExpand all lines: .gitpod.Dockerfile -7Lines changed: 0 additions & 7 deletions Collapse file Copy file name to clipboardExpand all lines: .gitpod.yml -6Lines changed: 0 additions & 6 deletions Collapse file Copy file name to clipboardExpand all lines: pom.xml +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 54 | 54 | <groupId>org.apache.maven.plugins</groupId> | 55 | 55 | <artifactId>maven-compiler-plugin</artifactId> | 56 | 56 | <configuration> | 57 | | - <source>16</source> | 58 | | - <target>16</target> | | 57 | + <source>17</source> | | 58 | + <target>17</target> | 59 | 59 | </configuration> | 60 | 60 | </plugin> | 61 | 61 | </plugins> | |
Collapse file Copy file name to clipboardExpand all lines: src/test/java/com/thealgorithms/others/LinkListSortTest.java +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | import com.thealgorithms.sorts.LinkList_Sort; | 5 | 5 |
| 6 | 6 | import static org.junit.jupiter.api.Assertions.*; | 7 | | -public class LinkList_Sort_test { | | 7 | +public class LinkListSortTest { | 8 | 8 | @Test | 9 | 9 | void testForOneElement() | 10 | 10 | { | @@ -30,7 +30,7 @@ void testForThreeElements() | 30 | 30 | void testForFourElements() | 31 | 31 | { | 32 | 32 | int a[]={86,32,87,13}; | 33 | | - assertFalse(LinkList_Sort.isSorted(a,2)); | | 33 | + assertTrue(LinkList_Sort.isSorted(a,1)); | 34 | 34 | } | 35 | 35 |
| 36 | 36 | @Test | @@ -59,6 +59,6 @@ void testForSevenElements() | 59 | 59 | void testForEightElements() | 60 | 60 | { | 61 | 61 | int a[]={123,234,145,764,322,367,768,34}; | 62 | | - assertFalse(LinkList_Sort.isSorted(a,2)); | | 62 | + assertTrue(LinkList_Sort.isSorted(a,2)); | 63 | 63 | } | 64 | 64 | } |
|