Search in sources :

Example 1 with PathResolver

use of com.google.jstestdriver.PathResolver in project intellij-plugins by JetBrains.

the class JstdConfigParsingUtils method resolveConfiguration.

@NotNull
public static ResolvedConfiguration resolveConfiguration(@NotNull ParsedConfiguration parsedConfiguration) {
    PathResolver pathResolver = new PathResolver(parsedConfiguration.getBasePaths(), Collections.emptySet(), new DisplayPathSanitizer());
    FlagsImpl flags = new FlagsImpl();
    flags.setServer("test:1");
    Configuration resolved = parsedConfiguration.resolvePaths(pathResolver, flags);
    return (ResolvedConfiguration) resolved;
}
Also used : DisplayPathSanitizer(com.google.jstestdriver.util.DisplayPathSanitizer) PathResolver(com.google.jstestdriver.PathResolver) FlagsImpl(com.google.jstestdriver.FlagsImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with PathResolver

use of com.google.jstestdriver.PathResolver in project intellij-plugins by JetBrains.

the class JstdTestFilePathIndex method doIndexConfigFile.

@NotNull
private static Map<String, Void> doIndexConfigFile(@NotNull Reader configFileReader, @NotNull BasePaths initialBasePaths) {
    YamlParser yamlParser = new YamlParser();
    final Map<String, Void> map = new THashMap<>();
    ParsedConfiguration parsedConfiguration = (ParsedConfiguration) yamlParser.parse(configFileReader, initialBasePaths);
    PathResolver pathResolver = new PathResolver(parsedConfiguration.getBasePaths(), Collections.emptySet(), new DisplayPathSanitizer());
    FlagsImpl flags = new FlagsImpl();
    flags.setServer("test:1");
    ResolvedConfiguration resolvedConfiguration = (ResolvedConfiguration) parsedConfiguration.resolvePaths(pathResolver, flags);
    doPutAll(map, resolvedConfiguration.getTests());
    doPutAll(map, resolvedConfiguration.getFilesList());
    return map;
}
Also used : YamlParser(com.google.jstestdriver.config.YamlParser) DisplayPathSanitizer(com.google.jstestdriver.util.DisplayPathSanitizer) ResolvedConfiguration(com.google.jstestdriver.config.ResolvedConfiguration) ParsedConfiguration(com.google.jstestdriver.config.ParsedConfiguration) THashMap(gnu.trove.THashMap) PathResolver(com.google.jstestdriver.PathResolver) FlagsImpl(com.google.jstestdriver.FlagsImpl) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

FlagsImpl (com.google.jstestdriver.FlagsImpl)2 PathResolver (com.google.jstestdriver.PathResolver)2 DisplayPathSanitizer (com.google.jstestdriver.util.DisplayPathSanitizer)2 NotNull (org.jetbrains.annotations.NotNull)2 ParsedConfiguration (com.google.jstestdriver.config.ParsedConfiguration)1 ResolvedConfiguration (com.google.jstestdriver.config.ResolvedConfiguration)1 YamlParser (com.google.jstestdriver.config.YamlParser)1 THashMap (gnu.trove.THashMap)1