-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for Xml2MetaData snapshot
- Loading branch information
Showing
3 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/test/java/rife/bld/dependencies/TestXml2MavenMetadata.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,41 @@ | ||
/* | ||
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com) | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
*/ | ||
package rife.bld.dependencies; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import rife.resources.ResourceFinderClasspath; | ||
import rife.resources.exceptions.ResourceFinderErrorException; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class TestXml2MavenMetadata { | ||
@Test | ||
void testInstantiation() { | ||
var metadata = new Xml2MavenMetadata(); | ||
assertNotNull(metadata); | ||
} | ||
|
||
@Test | ||
void testParse1() | ||
throws ResourceFinderErrorException { | ||
var resource_finder = ResourceFinderClasspath.instance(); | ||
var metadata = new Xml2MavenMetadata(); | ||
assertTrue(metadata.processXml(resource_finder.getContent("maven-metadata1.txt"))); | ||
assertEquals(metadata.getLatest(), new VersionNumber(1, 1, 1, "SNAPSHOT")); | ||
assertEquals(metadata.getRelease(), VersionNumber.UNKNOWN); | ||
assertEquals(metadata.getSnapshot(), new VersionNumber(1, 1, 1, "SNAPSHOT")); | ||
} | ||
|
||
@Test | ||
void testParse2() | ||
throws ResourceFinderErrorException { | ||
var resource_finder = ResourceFinderClasspath.instance(); | ||
var metadata = new Xml2MavenMetadata(); | ||
assertTrue(metadata.processXml(resource_finder.getContent("maven-metadata2.txt"))); | ||
assertEquals(metadata.getLatest(), new VersionNumber(1, 1, 1, "SNAPSHOT")); | ||
assertEquals(metadata.getRelease(), VersionNumber.UNKNOWN); | ||
assertEquals(metadata.getSnapshot(), new VersionNumber(1, 1, 1, "SNAPSHOT")); | ||
} | ||
} |
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,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<metadata modelVersion="1.1.0"> | ||
<groupId>net.thauvin.erik</groupId> | ||
<artifactId>pinboard-poster</artifactId> | ||
<version>1.1.1-SNAPSHOT</version> | ||
<versioning> | ||
<lastUpdated>20231019093409</lastUpdated> | ||
<snapshot> | ||
<localCopy>true</localCopy> | ||
</snapshot> | ||
<snapshotVersions> | ||
<snapshotVersion> | ||
<classifier>javadoc</classifier> | ||
<extension>jar.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>module</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>module.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>jar</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<classifier>javadoc</classifier> | ||
<extension>jar</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>pom</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>pom.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<classifier>sources</classifier> | ||
<extension>jar.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<classifier>sources</classifier> | ||
<extension>jar</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>jar.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
</snapshotVersions> | ||
</versioning> | ||
</metadata> |
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,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<metadata modelVersion="1.1.0"> | ||
<groupId>net.thauvin.erik</groupId> | ||
<artifactId>pinboard-poster</artifactId> | ||
<versioning> | ||
<lastUpdated>20231019093409</lastUpdated> | ||
<snapshot> | ||
<localCopy>true</localCopy> | ||
</snapshot> | ||
<snapshotVersions> | ||
<snapshotVersion> | ||
<classifier>javadoc</classifier> | ||
<extension>jar.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>module</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>module.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>jar</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<classifier>javadoc</classifier> | ||
<extension>jar</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>pom</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>pom.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<classifier>sources</classifier> | ||
<extension>jar.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<classifier>sources</classifier> | ||
<extension>jar</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>jar.asc</extension> | ||
<value>1.1.1-SNAPSHOT</value> | ||
<updated>20231019093409</updated> | ||
</snapshotVersion> | ||
</snapshotVersions> | ||
</versioning> | ||
<version>1.1.1-SNAPSHOT</version> | ||
</metadata> |