michael-o commented on code in PR #319:
URL: https://github.com/apache/maven-resolver/pull/319#discussion_r1280642505


##########
maven-resolver-supplier/src/test/java/org/eclipse/aether/supplier/RepositorySystemSupplierTest.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.eclipse.aether.supplier;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.RepositorySystem;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.resolution.VersionRangeRequest;
+import org.eclipse.aether.resolution.VersionRangeResult;
+import org.eclipse.aether.version.Version;
+import org.junit.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.hamcrest.Matchers.hasSize;
+
+public class RepositorySystemSupplierTest {
+    private final RepositorySystemSupplier subject = new 
RepositorySystemSupplier();
+
+    public static DefaultRepositorySystemSession 
newRepositorySystemSession(RepositorySystem system) {
+        DefaultRepositorySystemSession session = 
MavenRepositorySystemUtils.newSession();
+        LocalRepository localRepo = new LocalRepository("target/local-repo");
+        
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, 
localRepo));
+        return session;
+    }
+
+    @Test
+    public void smoke() throws Exception {
+        RepositorySystem system = subject.get();
+        RepositorySystemSession session = newRepositorySystemSession(system);
+
+        Artifact artifact = new 
DefaultArtifact("org.apache.maven.resolver:maven-resolver-util:[0,)");
+        VersionRangeRequest rangeRequest = new VersionRangeRequest();
+        rangeRequest.setArtifact(artifact);
+        rangeRequest.setRepositories(Collections.singletonList(
+                new RemoteRepository.Builder("central", "default", 
"https://repo.maven.apache.org/maven2/";).build()));
+        VersionRangeResult rangeResult = system.resolveVersionRange(session, 
rangeRequest);
+        List<Version> versions = rangeResult.getVersions();
+
+        // 2023. 07. 26.: as of today, Central has 33 versions of this 
artifact (and it will just grow)

Review Comment:
   As of 2023-08-01, Maven Central...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to