1 package org.codehaus.plexus.languages.java.jpms;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.IOException;
23 import java.nio.file.Path;
24 import java.nio.file.Paths;
25 import java.util.Collections;
26
27 import org.junit.jupiter.api.condition.DisabledOnJre;
28 import org.junit.jupiter.api.condition.JRE;
29
30 @DisabledOnJre(value = JRE.JAVA_8, disabledReason = "Requires Java 9+ Module System")
31 public class MainClassModuleNameExtractorTest extends AbstractFilenameModuleNameExtractorTest {
32 @Override
33 protected ModuleNameExtractor getExtractor() {
34 return new ModuleNameExtractor() {
35 final MainClassModuleNameExtractor extractor =
36 new MainClassModuleNameExtractor(Paths.get(System.getProperty("java.home")));
37
38 @Override
39 public String extract(Path file) throws IOException {
40 return extractor.extract(Collections.singletonMap(file, file)).get(file);
41 }
42 };
43 }
44 }