Skip to content

Commit

Permalink
#404: refactored urls into url-updater
Browse files Browse the repository at this point in the history
updated WireMock dependency from 2.35.2 to 3.11.0
added jackson-core dependency to ide-cli
added url namespace to tools
added LogbackServiceProvider to service
  • Loading branch information
jan-vcapgemini committed Feb 4, 2025
1 parent 8769dcc commit 98a0f2e
Show file tree
Hide file tree
Showing 81 changed files with 191 additions and 120 deletions.
11 changes: 8 additions & 3 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
<artifactId>parsson</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down Expand Up @@ -87,9 +92,9 @@
</dependency>
<!-- Needed for WireMock test support -->
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<version>2.35.2</version>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.Instant;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

import com.devonfw.tools.ide.url.model.AbstractUrlModelTest;
Expand Down Expand Up @@ -33,16 +34,16 @@ public void testReadJson() {
UrlStatusFile status = version.getOrCreateStatus();
StatusJson statusJson = status.getStatusJson();
// then
assertThat(statusJson.getUrls()).hasSize(1);
Assertions.assertThat(statusJson.getUrls()).hasSize(1);
UrlStatus urlStatus = statusJson.getUrls().values().iterator().next();
UrlStatusState success = urlStatus.getSuccess();
assertThat(success.getTimestamp()).isEqualTo(Instant.parse("2023-02-21T15:03:09.387386Z"));
assertThat(success.getCode()).isNull();
assertThat(success.getMessage()).isNull();
Assertions.assertThat(success.getTimestamp()).isEqualTo(Instant.parse("2023-02-21T15:03:09.387386Z"));
Assertions.assertThat(success.getCode()).isNull();
Assertions.assertThat(success.getMessage()).isNull();
UrlStatusState error = urlStatus.getError();
assertThat(error.getTimestamp()).isEqualTo(Instant.parse("2023-01-01T23:59:59.999999Z"));
assertThat(error.getCode()).isEqualTo(500);
assertThat(error.getMessage()).isEqualTo("core dumped");
Assertions.assertThat(error.getTimestamp()).isEqualTo(Instant.parse("2023-01-01T23:59:59.999999Z"));
Assertions.assertThat(error.getCode()).isEqualTo(500);
Assertions.assertThat(error.getMessage()).isEqualTo("core dumped");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.junit.jupiter.api.Test;

/**
* Test of {@link StatusJson}.
* Test of {@link com.devonfw.tools.ide.url.model.file.json.StatusJson}.
*/
public class StatusJsonTest extends Assertions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ public void testEditionSpecific() {
IdeContext context = newContext();

// act
Collection<ToolDependency> dependencies = context.getDefaultToolRepository().findDependencies("tomcat", "tomcat", VersionIdentifier.of("11.0.0"));
Collection<com.devonfw.tools.ide.url.model.file.json.ToolDependency> dependencies = context.getDefaultToolRepository()
.findDependencies("tomcat", "tomcat", VersionIdentifier.of("11.0.0"));

// assert
assertThat(dependencies).containsExactly(new ToolDependency("java", VersionRange.of("[17,)")));
assertThat(dependencies).containsExactly(new com.devonfw.tools.ide.url.model.file.json.ToolDependency("java", VersionRange.of("[17,)")));
}

@Test
Expand All @@ -36,10 +37,12 @@ public void testEditionFallback() {
IdeContext context = newContext();

// act
Collection<ToolDependency> dependencies = context.getDefaultToolRepository().findDependencies("tomcat", "undefined", VersionIdentifier.of("11.0.0"));
Collection<com.devonfw.tools.ide.url.model.file.json.ToolDependency> dependencies = context.getDefaultToolRepository()
.findDependencies("tomcat", "undefined", VersionIdentifier.of("11.0.0"));

// assert
assertThat(dependencies).containsExactly(new ToolDependency("this-is-the-wrong-file-only-for-testing", VersionRange.of("[1.0,2.0]")));
assertThat(dependencies).containsExactly(
new com.devonfw.tools.ide.url.model.file.json.ToolDependency("this-is-the-wrong-file-only-for-testing", VersionRange.of("[1.0,2.0]")));
}

@Test
Expand All @@ -49,7 +52,8 @@ public void testEditionUnspecific() {
IdeContext context = newContext();

// act
Collection<ToolDependency> dependencies = context.getDefaultToolRepository().findDependencies("mvn", "undefined", VersionIdentifier.of("3.9.0"));
Collection<com.devonfw.tools.ide.url.model.file.json.ToolDependency> dependencies = context.getDefaultToolRepository()
.findDependencies("mvn", "undefined", VersionIdentifier.of("3.9.0"));

// assert
assertThat(dependencies).containsExactly(new ToolDependency("java", VersionRange.of("[8,)")));
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<module>documentation</module>
<module>cli</module>
<module>gui</module>
<module>url-updater</module>
</modules>

<build>
Expand Down
43 changes: 43 additions & 0 deletions url-updater/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.devonfw.tools.IDEasy.dev</groupId>
<artifactId>ide</artifactId>
<version>dev-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>com.devonfw.tools.IDEasy</groupId>
<artifactId>url-updater</artifactId>
<version>${revision}</version>
<name>${project.artifactId}</name>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson.version>2.18.2</jackson.version>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ide-cli</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.16</version>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.11.0</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.devonfw.tools.ide.tool.androidstudio;
package com.devonfw.tools.ide.url.tool.androidstudio;

import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.devonfw.tools.ide.tool.androidstudio.AndroidJsonDownload;
import com.devonfw.tools.ide.tool.androidstudio.AndroidJsonItem;
import com.devonfw.tools.ide.tool.androidstudio.AndroidJsonObject;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.JsonUrlUpdater;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.aws;
package com.devonfw.tools.ide.url.tool.aws;

import com.devonfw.tools.ide.os.OperatingSystem;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.az;
package com.devonfw.tools.ide.url.tool.az;

import com.devonfw.tools.ide.os.OperatingSystem;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.docker;
package com.devonfw.tools.ide.url.tool.docker;

import java.util.Set;
import java.util.regex.Matcher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.docker;
package com.devonfw.tools.ide.url.tool.docker;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.dotnet;
package com.devonfw.tools.ide.url.tool.dotnet;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.eclipse;
package com.devonfw.tools.ide.url.tool.eclipse;

/**
* {@link EclipseUrlUpdater} for "cpp" (C++) edition of Eclipse.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.eclipse;
package com.devonfw.tools.ide.url.tool.eclipse;

/**
* {@link EclipseUrlUpdater} for "java" edition of Eclipse.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.eclipse;
package com.devonfw.tools.ide.url.tool.eclipse;

/**
* {@link EclipseUrlUpdater} for "jee" (C++) edition of Eclipse.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.eclipse;
package com.devonfw.tools.ide.url.tool.eclipse;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.gcloud;
package com.devonfw.tools.ide.url.tool.gcloud;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.gcviewer;
package com.devonfw.tools.ide.url.tool.gcviewer;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.gh;
package com.devonfw.tools.ide.url.tool.gh;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.graalvm;
package com.devonfw.tools.ide.url.tool.graalvm;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.graalvm;
package com.devonfw.tools.ide.url.tool.graalvm;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.graalvm;
package com.devonfw.tools.ide.url.tool.graalvm;

import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.gradle;
package com.devonfw.tools.ide.url.tool.gradle;

import java.util.HashSet;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.helm;
package com.devonfw.tools.ide.url.tool.helm;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.intellij;
package com.devonfw.tools.ide.url.tool.intellij;

import java.util.Collection;
import java.util.List;
Expand All @@ -7,6 +7,9 @@
import com.devonfw.tools.ide.json.JsonVersionItem;
import com.devonfw.tools.ide.os.OperatingSystem;
import com.devonfw.tools.ide.os.SystemArchitecture;
import com.devonfw.tools.ide.tool.intellij.IntellijJsonDownloadsItem;
import com.devonfw.tools.ide.tool.intellij.IntellijJsonObject;
import com.devonfw.tools.ide.tool.intellij.IntellijJsonRelease;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.JsonUrlUpdater;
import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.jasypt;
package com.devonfw.tools.ide.url.tool.jasypt;

import com.devonfw.tools.ide.url.updater.MavenBasedUrlUpdater;
import com.devonfw.tools.ide.version.VersionIdentifier;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.devonfw.tools.ide.tool.java;
package com.devonfw.tools.ide.url.tool.java;

import java.util.Collection;

import com.devonfw.tools.ide.tool.java.JavaJsonObject;
import com.devonfw.tools.ide.tool.java.JavaJsonVersion;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.JsonUrlUpdater;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.jenkins;
package com.devonfw.tools.ide.url.tool.jenkins;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.jmc;
package com.devonfw.tools.ide.url.tool.jmc;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.kotlinc;
package com.devonfw.tools.ide.url.tool.kotlinc;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.kotlinc;
package com.devonfw.tools.ide.url.tool.kotlinc;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.lazydocker;
package com.devonfw.tools.ide.url.tool.lazydocker;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.mvn;
package com.devonfw.tools.ide.url.tool.mvn;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.mvn;
package com.devonfw.tools.ide.url.tool.mvn;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.node;
package com.devonfw.tools.ide.url.tool.node;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.npm;
package com.devonfw.tools.ide.url.tool.npm;

import com.devonfw.tools.ide.url.updater.NpmBasedUrlUpdater;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.oc;
package com.devonfw.tools.ide.url.tool.oc;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.pgadmin;
package com.devonfw.tools.ide.url.tool.pgadmin;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.pip;
package com.devonfw.tools.ide.url.tool.pip;

import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devonfw.tools.ide.tool.python;
package com.devonfw.tools.ide.url.tool.python;

import java.util.Collection;
import java.util.List;
Expand All @@ -7,6 +7,9 @@
import org.slf4j.LoggerFactory;

import com.devonfw.tools.ide.json.JsonMapping;
import com.devonfw.tools.ide.tool.python.PythonFile;
import com.devonfw.tools.ide.tool.python.PythonJsonObject;
import com.devonfw.tools.ide.tool.python.PythonRelease;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.JsonUrlUpdater;
import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down
Loading

0 comments on commit 98a0f2e

Please sign in to comment.