-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-92 Rename reposilite-backend to reposilite
- Loading branch information
Showing
46 changed files
with
590 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
reposilite-backend/src/test/java/org/panda_lang/reposilite/metadata/MetadataUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* Copyright (c) 2020 Dzikoysk | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.panda_lang.reposilite.metadata; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.io.TempDir; | ||
import org.panda_lang.reposilite.utils.FilesUtils; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.stream.Stream; | ||
|
||
class MetadataUtilsTest { | ||
|
||
@TempDir | ||
static File temp; | ||
static File builds; | ||
static File versions; | ||
|
||
private static final String[] BUILDS = { | ||
"abc-version-timestamp.jar", | ||
"abc-version-timestamp-classifier.jar", | ||
"abc-version-timestamp-2-classifier.jar", | ||
"abc-version-timestamp-1.jar", | ||
"abc-version-timestamp-1-classifier.jar", | ||
}; | ||
|
||
private static final String[] VERSIONS = { "2", "1" }; | ||
|
||
@BeforeAll | ||
static void prepare() throws IOException { | ||
builds = new File(temp, "builds"); | ||
builds.mkdir(); | ||
|
||
for (String file : BUILDS) { | ||
new File(builds, file).createNewFile(); | ||
} | ||
|
||
versions = new File(temp, "versions"); | ||
versions.mkdir(); | ||
|
||
for (String version : VERSIONS) { | ||
new File(versions, version).mkdir(); | ||
} | ||
} | ||
|
||
@Test | ||
void toSortedBuilds() { | ||
Assertions.assertArrayEquals(BUILDS, Stream.of(MetadataUtils.toSortedBuilds(builds)) | ||
.map(File::getName) | ||
.toArray(String[]::new) | ||
); | ||
} | ||
|
||
@Test | ||
void toSortedVersions() { | ||
Assertions.assertArrayEquals(VERSIONS, Stream.of(MetadataUtils.toSortedVersions(versions)) | ||
.map(File::getName) | ||
.toArray(String[]::new) | ||
); | ||
} | ||
|
||
@Test | ||
void toSortedIdentifiers() { | ||
Assertions.assertArrayEquals(new String[] { | ||
"timestamp-2", | ||
"timestamp-1", | ||
"timestamp" | ||
}, MetadataUtils.toSortedIdentifiers("abc", "version", FilesUtils.listFiles(builds))); | ||
} | ||
|
||
@Test | ||
void toBuildFiles() { | ||
Assertions.assertArrayEquals(BUILDS, Stream.of(MetadataUtils.toBuildFiles(builds, "timestamp")) | ||
.map(File::getName) | ||
.toArray(String[]::new) | ||
); | ||
} | ||
|
||
@Test | ||
void getLatest() { | ||
Assertions.assertEquals("2", MetadataUtils.getLatest(VERSIONS)); | ||
} | ||
|
||
@Test | ||
void getLast() { | ||
Assertions.assertEquals("1", MetadataUtils.getLast(VERSIONS)); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...silite-backend/src/test/workspace/repositories/releases/org/panda-lang/maven-metadata.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<metadata><groupId>org</groupId><artifactId>panda-lang</artifactId><versioning><release>reposilite-test</release><latest>reposilite-test</latest><lastUpdated>20200526104801</lastUpdated><versions><version>reposilite-test</version><version>reposilite</version></versions></versioning></metadata> |
1 change: 1 addition & 0 deletions
1
...te-backend/src/test/workspace/repositories/releases/org/panda-lang/maven-metadata.xml.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5a8dccb220de5c6775c873ead6ff2e43 |
1 change: 1 addition & 0 deletions
1
...e-backend/src/test/workspace/repositories/releases/org/panda-lang/maven-metadata.xml.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3c7435cfd4e31b9be3991041c9a4f8292b752e5b |
Binary file added
BIN
+2.35 KB
...pace/repositories/releases/org/panda-lang/reposilite-test/1.0.0/reposilite-test-1.0.0.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
.../repositories/releases/org/panda-lang/reposilite-test/1.0.0/reposilite-test-1.0.0.jar.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7a900f53c20c38d1119a86cc72f352e4 |
1 change: 1 addition & 0 deletions
1
...repositories/releases/org/panda-lang/reposilite-test/1.0.0/reposilite-test-1.0.0.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2cb07e420d982b9445e8d3530f8304eef0b0b4a9 |
25 changes: 25 additions & 0 deletions
25
...pace/repositories/releases/org/panda-lang/reposilite-test/1.0.0/reposilite-test-1.0.0.pom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2020 Dzikoysk | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<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>org.panda-lang</groupId> | ||
<artifactId>reposilite-test</artifactId> | ||
<version>1.0.0</version> | ||
<description>POM was created from install:install-file</description> | ||
</project> |
1 change: 1 addition & 0 deletions
1
.../repositories/releases/org/panda-lang/reposilite-test/1.0.0/reposilite-test-1.0.0.pom.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
50f79edd59ffaf8dd66b42be0867da5c |
1 change: 1 addition & 0 deletions
1
...repositories/releases/org/panda-lang/reposilite-test/1.0.0/reposilite-test-1.0.0.pom.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9333c3866f26da9a8213bda5d0c47733348a11cb |
1 change: 1 addition & 0 deletions
1
...rc/test/workspace/repositories/releases/org/panda-lang/reposilite-test/maven-metadata.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<metadata><groupId>org.panda-lang</groupId><artifactId>reposilite-test</artifactId><versioning><release>1.0.1</release><latest>1.0.1</latest><lastUpdated>20200509124828</lastUpdated><versions><version>1.0.1</version><version>1.0.0</version></versions></versioning></metadata> |
1 change: 1 addition & 0 deletions
1
...est/workspace/repositories/releases/org/panda-lang/reposilite-test/maven-metadata.xml.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d4f6f4e928303d5361d83531beb5260f |
1 change: 1 addition & 0 deletions
1
...st/workspace/repositories/releases/org/panda-lang/reposilite-test/maven-metadata.xml.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
11255f8e4b2473037698c0e90936b2dbbfc27173 |
Binary file added
BIN
+53.2 KB
...kspace/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4-sources.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ce/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4-sources.jar.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
04f953dbf697968e3c1a1dc17ff99ecc |
1 change: 1 addition & 0 deletions
1
...e/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4-sources.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bf2049dfcd525a12603f1a34a0bfad1d7c05b645 |
Binary file added
BIN
+6.85 MB
...test/workspace/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
.../workspace/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4.jar.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ca2abcc166c9df19a5997d384ed25f5b |
1 change: 1 addition & 0 deletions
1
...workspace/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7a82879a3f4584cf1d3b181628864885d2c20094 |
164 changes: 164 additions & 0 deletions
164
...test/workspace/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4.pom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2020 Dzikoysk | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.panda-lang</groupId> | ||
<artifactId>reposilite</artifactId> | ||
<version>2.5.0</version> | ||
<licenses> | ||
<license> | ||
<name>Apache License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<build> | ||
<defaultGoal>clean install</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.2.3</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<minimizeJar>true</minimizeJar> | ||
<filters> | ||
<filter> | ||
<artifact>com.fasterxml.woodstox:woodstox-core</artifact> | ||
<includes> | ||
<include>**</include> | ||
</includes> | ||
</filter> | ||
<filter> | ||
<artifact>commons-logging:commons-logging</artifact> | ||
<includes> | ||
<include>**</include> | ||
</includes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.plexus</groupId> | ||
<artifactId>plexus-compiler-eclipse</artifactId> | ||
<version>2.8.6</version> | ||
</dependency> | ||
</dependencies> | ||
<configuration> | ||
<source>${reposilite.javaLanguageLevel}</source> | ||
<target>${reposilite.javaVersion}</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>3.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>jar-no-fork</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.2.0</version> | ||
<configuration> | ||
<archive> | ||
<manifestEntries> | ||
<Implementation-Title>Reposilite</Implementation-Title> | ||
<Implementation-Version>${reposilite.version}</Implementation-Version> | ||
<Main-Class>org.panda_lang.reposilite.Reposilite</Main-Class> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<repositories> | ||
<repository> | ||
<id>panda-repository</id> | ||
<name>Panda Repository</name> | ||
<url>https://repo.panda-lang.org/</url> | ||
</repository> | ||
</repositories> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<version>5.6.2</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>apiguardian-api</artifactId> | ||
<groupId>org.apiguardian</groupId> | ||
</exclusion> | ||
<exclusion> | ||
<artifactId>opentest4j</artifactId> | ||
<groupId>org.opentest4j</groupId> | ||
</exclusion> | ||
<exclusion> | ||
<artifactId>junit-platform-commons</artifactId> | ||
<groupId>org.junit.platform</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<version>5.6.2</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>junit-platform-engine</artifactId> | ||
<groupId>org.junit.platform</groupId> | ||
</exclusion> | ||
<exclusion> | ||
<artifactId>apiguardian-api</artifactId> | ||
<groupId>org.apiguardian</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
<distributionManagement> | ||
<repository> | ||
<id>local-repository</id> | ||
<url>http://localhost/releases</url> | ||
</repository> | ||
</distributionManagement> | ||
<properties> | ||
<reposilite.javaVersion>1.8</reposilite.javaVersion> | ||
<maven.compiler.target>${reposilite.javaVersion}</maven.compiler.target> | ||
<maven.compiler.source>${reposilite.javaLanguageLevel}</maven.compiler.source> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<reposilite.javaLanguageLevel>1.8</reposilite.javaLanguageLevel> | ||
<reposilite.version>${project.version}</reposilite.version> | ||
</properties> | ||
</project> |
1 change: 1 addition & 0 deletions
1
.../workspace/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4.pom.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5f81766868fddb13127a323fbf57d741 |
1 change: 1 addition & 0 deletions
1
...workspace/repositories/releases/org/panda-lang/reposilite/2.3.4/reposilite-2.3.4.pom.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
f07fa28afaa08ba09418ec5a7bb7652da70afc9c |
Binary file added
BIN
+47.4 KB
...kspace/repositories/releases/org/panda-lang/reposilite/2.4.0/reposilite-2.4.0-sources.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ce/repositories/releases/org/panda-lang/reposilite/2.4.0/reposilite-2.4.0-sources.jar.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0eb380ab2ccc6c86c4406ed6d72ce2a2 |
1 change: 1 addition & 0 deletions
1
...e/repositories/releases/org/panda-lang/reposilite/2.4.0/reposilite-2.4.0-sources.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6bb0edcb7b45fbd66f3da1cf970b2ed3226b8338 |
Binary file added
BIN
+8.31 MB
...test/workspace/repositories/releases/org/panda-lang/reposilite/2.4.0/reposilite-2.4.0.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
.../workspace/repositories/releases/org/panda-lang/reposilite/2.4.0/reposilite-2.4.0.jar.md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
89c8b3568e4ed0a762b60467540df3f1 |
1 change: 1 addition & 0 deletions
1
...workspace/repositories/releases/org/panda-lang/reposilite/2.4.0/reposilite-2.4.0.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5dced3f520d6012df13a4783b9449ec637ad459f |
Oops, something went wrong.