Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
19,000
|
boolean () { return true; }
|
shouldAddRuntimeDependenciesToTestCompilationClasspath
|
19,001
|
boolean (JpsDependencyElement element) { return JpsMavenExtensionService.getInstance().isProductionOnTestDependency(element); }
|
isProductionOnTestsDependency
|
19,002
|
boolean () { return false; }
|
shouldIncludeTestsFromDependentModulesToTestClasspath
|
19,003
|
boolean () { return false; }
|
shouldProcessDependenciesRecursively
|
19,004
|
JpsJavaDependenciesEnumerationHandler (@NotNull Collection<JpsModule> modules) { JpsMavenExtensionService service = JpsMavenExtensionService.getInstance(); for (JpsModule module : modules) { if (service.getExtension(module) != null) { return INSTANCE; } } return null; }
|
createHandler
|
19,005
|
ResourceRootConfiguration () { return myConfig; }
|
getConfiguration
|
19,006
|
String () { return myId; }
|
getRootId
|
19,007
|
File () { return myFile; }
|
getRootFile
|
19,008
|
MavenResourcesTarget () { return myTarget; }
|
getTarget
|
19,009
|
FileFilter () { return new MavenResourceFileFilter(myFile, myConfig); }
|
createFileFilter
|
19,010
|
boolean () { return true; }
|
canUseFileCache
|
19,011
|
int () { return myIndexInPom; }
|
getIndexInPom
|
19,012
|
boolean () { return myOverwrite; }
|
isOverwrite
|
19,013
|
MavenModuleResourceConfiguration (MavenIdBean id) { return getModuleConfigurationMap().get(id); }
|
findProject
|
19,014
|
String (final String propName, final MavenModuleResourceConfiguration moduleConfig, Map<String, String> additionalProperties) { boolean hasPrefix = false; String unprefixed = propName; if (propName.startsWith("pom.")) { unprefixed = propName.substring("pom.".length()); hasPrefix = true; } else if (propName.startsWith("project.")) { unprefixed = propName.substring("project.".length()); hasPrefix = true; } MavenModuleResourceConfiguration selectedConfig = moduleConfig; while (unprefixed.startsWith("parent.")) { MavenIdBean parentId = selectedConfig.parentId; if (parentId == null) { return null; } unprefixed = unprefixed.substring("parent.".length()); if (unprefixed.equals("groupId")) { return parentId.groupId; } if (unprefixed.equals("artifactId")) { return parentId.artifactId; } selectedConfig = findProject(parentId); if (selectedConfig == null) { return null; } } if (unprefixed.equals("basedir") || (hasPrefix && moduleConfig == selectedConfig && unprefixed.equals("baseUri"))) { return selectedConfig.directory; } String result; result = getMavenOptsProperties().get(propName); if (result != null) { return result; } result = getMavenAndJvmConfig(selectedConfig).get(propName); if (result != null) { return result; } result = getSystemProperties().getProperty(propName); if (result != null) { return result; } result = selectedConfig.modelMap.get(unprefixed); if (result != null) { return result; } result = additionalProperties.get(propName); if (result != null) { return result; } return moduleConfig.properties.get(propName); }
|
resolveProperty
|
19,015
|
Properties () { Properties res = ourSystemProperties; if (res == null) { res = new Properties(); res.putAll(System.getProperties()); for (Iterator<Object> itr = res.keySet().iterator(); itr.hasNext(); ) { final String propertyName = itr.next().toString(); if (propertyName.startsWith("idea.") || propertyName.startsWith("jps.")) { itr.remove(); } } for (Map.Entry<String, String> entry : System.getenv().entrySet()) { String key = entry.getKey(); if (key.startsWith("=")) { continue; } if (SystemInfo.isWindows) { key = StringUtil.toUpperCase(key); } res.setProperty("env." + key, entry.getValue()); } ourSystemProperties = res; } return res; }
|
getSystemProperties
|
19,016
|
void (File baseDir, String relativePath, Map<String, String> result, String valueIfMissing) { File configFile = new File(baseDir, relativePath); if (configFile.isFile()) { try { for (String parameter : ParametersListUtil.parse(FileUtil.loadFile(configFile, CharsetToolkit.UTF8))) { Matcher matcher = MAVEN_PROPERTY_PATTERN.matcher(parameter); if (matcher.matches()) { result.put(matcher.group(1), StringUtil.notNullize(matcher.group(2), valueIfMissing)); } } } catch (IOException ignore) { } } }
|
readConfigFile
|
19,017
|
File (String path) { File workingDir = new File(FileUtil.toSystemDependentName(path)); File baseDir = workingDir; File dir = workingDir; while ((dir = dir.getParentFile()) != null) { if (new File(dir, ".mvn").exists()) { baseDir = dir; break; } } try { return baseDir.getCanonicalFile(); } catch (IOException e) { return baseDir.getAbsoluteFile(); } }
|
getBaseDir
|
19,018
|
void (@NotNull JpsModule module, @NotNull Element rootElement) { boolean isMavenModule = Boolean.parseBoolean(rootElement.getAttributeValue(MAVEN_MODULE_ATTRIBUTE)) || rootElement.getChildren().stream() .anyMatch(element -> MAVEN_SYSTEM_ID.equals(element.getAttributeValue("externalSystem"))); if (isMavenModule) { JpsMavenModuleExtension extension = JpsMavenExtensionService.getInstance().getOrCreateExtension(module); Element component = JDomSerializationUtil.findComponent(rootElement, MavenAnnotationProcessorsModel.COMPONENT_NAME); if (component != null) { MavenAnnotationProcessorsModel annotationProcessorsModel = deserialize(component, MavenAnnotationProcessorsModel.class); extension.getAnnotationProcessorModules().addAll(annotationProcessorsModel.annotationProcessorModules); } } }
|
loadModuleOptions
|
19,019
|
void (JpsDependencyElement dependency, Element orderEntry) { if (orderEntry.getAttributeValue(PRODUCTION_ON_TEST_ATTRIBUTE) != null) { JpsMavenExtensionService.getInstance().setProductionOnTestDependency(dependency, true); } }
|
loadModuleDependencyProperties
|
19,020
|
String () { return myModule.getName(); }
|
getId
|
19,021
|
boolean () { return true; }
|
isCompiledBeforeModuleLevelBuilders
|
19,022
|
List<MavenResourceRootDescriptor> (@NotNull JpsModel model, @NotNull ModuleExcludeIndex index, @NotNull IgnoredFileIndex ignoredFileIndex, @NotNull BuildDataPaths dataPaths) { // todo: should we honor ignored and excluded roots here? final List<MavenResourceRootDescriptor> result = new ArrayList<>(); MavenModuleResourceConfiguration moduleConfig = getModuleResourcesConfiguration(dataPaths); if (moduleConfig == null) return Collections.emptyList(); int i = 0; for (ResourceRootConfiguration resource : getRootConfigurations(moduleConfig)) { result.add(new MavenResourceRootDescriptor(this, resource, i++, moduleConfig.overwrite)); } return result; }
|
computeRootDescriptors
|
19,023
|
Collection<ResourceRootConfiguration> (@Nullable MavenModuleResourceConfiguration moduleConfig) { if (moduleConfig != null) { return isTests() ? moduleConfig.testResources : moduleConfig.resources; } return Collections.emptyList(); }
|
getRootConfigurations
|
19,024
|
MavenModuleResourceConfiguration (BuildDataPaths dataPaths) { final MavenProjectConfiguration projectConfig = JpsMavenExtensionService.getInstance().getMavenProjectConfiguration(dataPaths); if (projectConfig == null) return null; return projectConfig.moduleConfigurations.get(myModule.getName()); }
|
getModuleResourcesConfiguration
|
19,025
|
boolean () { return ((MavenResourcesTargetType)getTargetType()).isTests(); }
|
isTests
|
19,026
|
MavenResourceRootDescriptor (@NotNull String rootId, @NotNull BuildRootIndex rootIndex) { for (MavenResourceRootDescriptor descriptor : rootIndex.getTargetRoots(this, null)) { if (descriptor.getRootId().equals(rootId)) { return descriptor; } } return null; }
|
findRootDescriptor
|
19,027
|
String () { return getTargetType().getTypeId() + ":" + myModule.getName(); }
|
getPresentableName
|
19,028
|
Collection<File> (@NotNull CompileContext context) { MavenModuleResourceConfiguration configuration = getModuleResourcesConfiguration(context.getProjectDescriptor().dataManager.getDataPaths()); if (configuration == null) return Collections.emptyList(); Set<File> result = FileCollectionFactory.createCanonicalFileSet(); final File moduleOutput = getModuleOutputDir(); for (ResourceRootConfiguration resConfig : getRootConfigurations(configuration)) { final File output = getOutputDir(moduleOutput, resConfig, configuration.outputDirectory); if (output != null) { result.add(output); } } return result; }
|
getOutputRoots
|
19,029
|
File () { return JpsJavaExtensionService.getInstance().getOutputDirectory(myModule, isTests()); }
|
getModuleOutputDir
|
19,030
|
File (@Nullable File moduleOutput, ResourceRootConfiguration config, @Nullable String outputDirectory) { if(outputDirectory != null) { moduleOutput = JpsPathUtil.urlToFile(outputDirectory); } if (moduleOutput == null) { return null; } String targetPath = config.targetPath; if (StringUtil.isEmptyOrSpaces(targetPath)) { return moduleOutput; } final File targetPathFile = new File(targetPath); final File outputFile = targetPathFile.isAbsolute() ? targetPathFile : new File(moduleOutput, targetPath); return new File(FileUtil.toCanonicalPath(outputFile.getPath())); }
|
getOutputDir
|
19,031
|
void (@NotNull ProjectDescriptor pd, @NotNull PrintWriter out) { final BuildDataPaths dataPaths = pd.getTargetsState().getDataPaths(); final MavenModuleResourceConfiguration configuration = getModuleResourcesConfiguration(dataPaths); if (configuration != null) { out.write(Integer.toHexString(configuration.computeConfigurationHash(isTests()))); } }
|
writeConfiguration
|
19,032
|
Set<String> () { if (filteringExclusions.isEmpty()) { return MavenProjectConfiguration.DEFAULT_FILTERING_EXCLUDED_EXTENSIONS; } final Set<String> result = CollectionFactory.createFilePathSet(); result.addAll(MavenProjectConfiguration.DEFAULT_FILTERING_EXCLUDED_EXTENSIONS); result.addAll(filteringExclusions); return Collections.unmodifiableSet(result); }
|
getFilteringExcludedExtensions
|
19,033
|
int (boolean forTestResources) { int result = computeModuleConfigurationHash(); final List<ResourceRootConfiguration> _resources = forTestResources? testResources : resources; result = 31 * result; for (ResourceRootConfiguration resource : _resources) { result += resource.computeConfigurationHash(); } return result; }
|
computeConfigurationHash
|
19,034
|
int () { int result = id.hashCode(); result = 31 * result + (parentId != null ? parentId.hashCode() : 0); result = 31 * result + directory.hashCode(); result = 31 * result + (manifest != null ? manifest.hashCode() : 0); result = 31 * result + (classpath != null ? classpath.hashCode() : 0); result = 31 * result + delimitersPattern.hashCode(); result = 31 * result + modelMap.hashCode(); result = 31 * result + properties.hashCode(); result = 31 * result + filteringExclusions.hashCode(); result = 31 * result + (escapeString != null ? escapeString.hashCode() : 0); result = 31 * result + (outputDirectory != null ? outputDirectory.hashCode() : 0); result = 31 * result + (testOutputDirectory != null ? testOutputDirectory.hashCode() : 0); result = 31 * result + (escapeWindowsPaths ? 1 : 0); result = 31 * result + (overwrite ? 1 : 0); return result; }
|
computeModuleConfigurationHash
|
19,035
|
String () { return "MavenModuleResourceConfiguration{" + "id=" + id + ", parentId=" + parentId + ", directory='" + directory + '\'' + ", manifest='" + manifest + '\'' + ", classpath='" + classpath + '\'' + ", delimitersPattern='" + delimitersPattern + '\'' + ", modelMap=" + modelMap + ", properties=" + properties + ", filteringExclusions=" + filteringExclusions + ", escapeString='" + escapeString + '\'' + ", escapeWindowsPaths=" + escapeWindowsPaths + ", overwrite=" + overwrite + ", outputDirectory='" + outputDirectory + '\'' + ", testOutputDirectory='" + testOutputDirectory + '\'' + ", resources=" + resources + ", testResources=" + testResources + '}'; }
|
toString
|
19,036
|
boolean (JpsModule module) { // enable standard resource processing only if this is not a maven module // for maven modules use maven-aware resource builder return getExtension(module) == null; }
|
isResourceProcessingEnabled
|
19,037
|
JpsMavenModuleExtension (@NotNull JpsModule module) { return module.getContainer().getChild(JpsMavenModuleExtensionImpl.ROLE); }
|
getExtension
|
19,038
|
JpsMavenModuleExtension (@NotNull JpsModule module) { JpsMavenModuleExtension extension = module.getContainer().getChild(JpsMavenModuleExtensionImpl.ROLE); if (extension == null) { extension = new JpsMavenModuleExtensionImpl(); module.getContainer().setChild(JpsMavenModuleExtensionImpl.ROLE, extension); } return extension; }
|
getOrCreateExtension
|
19,039
|
void (@NotNull JpsDependencyElement dependency, boolean value) { if (value) { dependency.getContainer().setChild(PRODUCTION_ON_TEST_ROLE, JpsElementFactory.getInstance().createSimpleElement(true)); } else { dependency.getContainer().removeChild(PRODUCTION_ON_TEST_ROLE); } }
|
setProductionOnTestDependency
|
19,040
|
boolean (@NotNull JpsDependencyElement dependency) { JpsSimpleElement<Boolean> child = dependency.getContainer().getChild(PRODUCTION_ON_TEST_ROLE); return child != null && child.getData(); }
|
isProductionOnTestDependency
|
19,041
|
boolean (@NotNull BuildDataPaths paths) { return myConfigFileExists.get(new File(paths.getDataStorageRoot(), MavenProjectConfiguration.CONFIGURATION_FILE_RELATIVE_PATH)); }
|
hasMavenProjectConfiguration
|
19,042
|
MavenProjectConfiguration (BuildDataPaths paths) { if (!hasMavenProjectConfiguration(paths)) { return null; } final File dataStorageRoot = paths.getDataStorageRoot(); return getMavenProjectConfiguration(dataStorageRoot); }
|
getMavenProjectConfiguration
|
19,043
|
MavenProjectConfiguration (@NotNull File dataStorageRoot) { final File configFile = new File(dataStorageRoot, MavenProjectConfiguration.CONFIGURATION_FILE_RELATIVE_PATH); MavenProjectConfiguration config; synchronized (myLoadedConfigs) { config = myLoadedConfigs.get(configFile); if (config == null) { config = new MavenProjectConfiguration(); try { XmlSerializer.deserializeInto(config, JDOMUtil.load(configFile)); } catch (Exception e) { LOG.info(e); } myLoadedConfigs.put(configFile, config); } } return config; }
|
getMavenProjectConfiguration
|
19,044
|
boolean () { return includes.isEmpty() && excludes.isEmpty(); }
|
isEmpty
|
19,045
|
boolean () { return myIsTests; }
|
isTests
|
19,046
|
List<MavenAnnotationProcessorTarget> (@NotNull JpsModel model) { List<MavenAnnotationProcessorTarget> targets = new ArrayList<>(); for (JpsModule module : model.getProject().getModules()) { targets.add(new MavenAnnotationProcessorTarget(this, module)); } return targets; }
|
computeAllTargets
|
19,047
|
BuildTargetLoader<MavenAnnotationProcessorTarget> (@NotNull JpsModel model) { final Map<String, JpsModule> modules = new HashMap<>(); for (JpsModule module : model.getProject().getModules()) { modules.put(module.getName(), module); } return new BuildTargetLoader<MavenAnnotationProcessorTarget>() { @Nullable @Override public MavenAnnotationProcessorTarget createTarget(@NotNull String targetId) { JpsModule module = modules.get(targetId); return module == null ? null : new MavenAnnotationProcessorTarget(MavenAnnotationProcessorTargetType.this, module); } }; }
|
createLoader
|
19,048
|
MavenAnnotationProcessorTarget (@NotNull String targetId) { JpsModule module = modules.get(targetId); return module == null ? null : new MavenAnnotationProcessorTarget(MavenAnnotationProcessorTargetType.this, module); }
|
createTarget
|
19,049
|
void () { loadProject("plugins/maven/jps-plugin/testData/compiler/classpathTest"); List<JpsModule> modules = myProject.getModules(); assertEquals(3, modules.size()); JpsModule main = modules.get(0); assertEquals("main", main.getName()); JpsModule dep = modules.get(1); assertEquals("dep", dep.getName()); JpsModule depTest = modules.get(2); assertEquals("dep-test", depTest.getName()); for (JpsModule module : modules) { assertNotNull(getService().getExtension(module)); } List<JpsDependencyElement> dependencies = main.getDependenciesList().getDependencies(); assertEquals(5, dependencies.size()); assertTrue(getService().isProductionOnTestDependency(dependencies.get(3))); assertFalse(getService().isProductionOnTestDependency(dependencies.get(4))); }
|
testLoadProject
|
19,050
|
JpsMavenExtensionService () { return JpsMavenExtensionService.getInstance(); }
|
getService
|
19,051
|
void (Class<?> aClass, String testName) { if (!preimportTestMode) return; try { if (aClass.getDeclaredAnnotation(InstantImportCompatible.class) == null) { Method testMethod = aClass.getMethod(testName); Assume.assumeNotNull(testMethod.getDeclaredAnnotation(InstantImportCompatible.class)); } } catch (NoSuchMethodException ignore) { } }
|
assumeTestCanBeReusedForPreimport
|
19,052
|
void () { assumeTestCanBeReusedForPreimport(this.getClass(), getName()); }
|
assumeThisTestCanBeReusedForPreimport
|
19,053
|
void () { String wslMsId = System.getProperty("wsl.distribution.name"); if (wslMsId == null) return; List<WSLDistribution> distributions = WslDistributionManager.getInstance().getInstalledDistributions(); if (distributions.isEmpty()) throw new IllegalStateException("no WSL distributions configured!"); myWSLDistribution = distributions.stream().filter(it -> wslMsId.equals(it.getMsId())).findFirst() .orElseThrow(() -> new IllegalStateException("Distribution " + wslMsId + " was not found")); String jdkPath = System.getProperty("wsl.jdk.path"); if (jdkPath == null) { jdkPath = "/usr/lib/jvm/java-11-openjdk-amd64"; } Sdk wslSdk = getWslSdk(myWSLDistribution.getWindowsPath(jdkPath)); WriteAction.runAndWait(() -> ProjectRootManagerEx.getInstanceEx(myProject).setProjectSdk(wslSdk)); assertTrue(new File(myWSLDistribution.getWindowsPath(myWSLDistribution.getUserHome())).isDirectory()); }
|
setupWsl
|
19,054
|
void () { PlatformTestUtil.waitWithEventsDispatching(() -> "Waiting for MavenUtils runnables completed" + MavenUtil.getUncompletedRunnables(), () -> MavenUtil.noUncompletedRunnables(), 15); }
|
waitForMavenUtilRunnablesComplete
|
19,055
|
Set<Action> (@NotNull String category, @NotNull String message, String @NotNull [] details, @Nullable Throwable t) { boolean intercept = t != null && ( StringUtil.notNullize(t.getMessage()).contains("The network name cannot be found") && message.contains("Couldn't read shelf information") || "JDK annotations not found".equals(t.getMessage()) && "#com.intellij.openapi.projectRoots.impl.JavaSdkImpl".equals(category)); return intercept ? Action.NONE : Action.ALL; }
|
processError
|
19,056
|
Sdk (String jdkPath) { Sdk sdk = ContainerUtil.find(ProjectJdkTable.getInstance().getAllJdks(), it -> jdkPath.equals(it.getHomePath())); ProjectJdkTable jdkTable = ProjectJdkTable.getInstance(); for (Sdk existingSdk : jdkTable.getAllJdks()) { if (existingSdk == sdk) return sdk; } Sdk newSdk = JavaSdk.getInstance().createJdk("Wsl JDK For Tests", jdkPath); WriteAction.runAndWait(() -> jdkTable.addJdk(newSdk, myProject)); return newSdk; }
|
getWslSdk
|
19,057
|
void () { MavenProjectsManager manager = MavenProjectsManager.getInstanceIfCreated(myProject); if (manager == null) return; manager.getEmbeddersManager().releaseInTests(); }
|
tearDownEmbedders
|
19,058
|
void () { assertEmpty("all maven connectors should be disposed", MavenServerManager.getInstance().getAllConnectors()); }
|
checkAllMavenConnectorsDisposed
|
19,059
|
boolean () { return false; }
|
useDirectoryBasedProjectFormat
|
19,060
|
MavenProgressIndicator () { return myProgressIndicator; }
|
getMavenProgressIndicator
|
19,061
|
void (File dir) { FileUtil.delete(dir); // cannot use reliably the result of the com.intellij.openapi.util.io.FileUtil.delete() method // because com.intellij.openapi.util.io.FileUtilRt.deleteRecursivelyNIO() does not honor this contract if (dir.exists()) { System.err.println("Cannot delete " + dir); //printDirectoryContent(myDir); dir.deleteOnExit(); } }
|
deleteDirOnTearDown
|
19,062
|
void (File dir) { File[] files = dir.listFiles(); if (files == null) return; for (File file : files) { System.out.println(file.getAbsolutePath()); if (file.isDirectory()) { printDirectoryContent(file); } } }
|
printDirectoryContent
|
19,063
|
String () { if (SystemInfo.isWindows) return "c:"; return ""; }
|
getRoot
|
19,064
|
String () { if (SystemInfo.isWindows) { return "TEMP"; } else if (SystemInfo.isLinux) return "HOME"; return "TMPDIR"; }
|
getEnvVar
|
19,065
|
MavenGeneralSettings () { return MavenProjectsManager.getInstance(myProject).getGeneralSettings(); }
|
getMavenGeneralSettings
|
19,066
|
MavenImportingSettings () { return MavenProjectsManager.getInstance(myProject).getImportingSettings(); }
|
getMavenImporterSettings
|
19,067
|
String () { String path = getRepositoryFile().getPath(); return FileUtil.toSystemIndependentName(path); }
|
getRepositoryPath
|
19,068
|
File () { return getMavenGeneralSettings().getEffectiveLocalRepository(); }
|
getRepositoryFile
|
19,069
|
void (String path) { getMavenGeneralSettings().setLocalRepository(path); }
|
setRepositoryPath
|
19,070
|
String () { return myProjectRoot.getPath(); }
|
getProjectPath
|
19,071
|
String () { return myProjectRoot.getParent().getPath(); }
|
getParentPath
|
19,072
|
String (String relPath) { return pathFromBasedir(myProjectRoot, relPath); }
|
pathFromBasedir
|
19,073
|
String (VirtualFile root, String relPath) { return FileUtil.toSystemIndependentName(root.getPath() + "/" + relPath); }
|
pathFromBasedir
|
19,074
|
String (String content) { return "<settings>" + content + "</settings>\r\n"; }
|
createSettingsXmlContent
|
19,075
|
Module (String name) { return createModule(name, StdModuleTypes.JAVA); }
|
createModule
|
19,076
|
Module (final String name, final ModuleType type) { try { return WriteCommandAction.writeCommandAction(myProject).compute(() -> { VirtualFile f = createProjectSubFile(name + "/" + name + ".iml"); Module module = ModuleManager.getInstance(myProject).newModule(f.getPath(), type.getId()); PsiTestUtil.addContentRoot(module, f.getParent()); return module; }); } catch (IOException e) { throw new RuntimeException(e); } }
|
createModule
|
19,077
|
VirtualFile (String xml) { return createProfilesFile(myProjectRoot, xml, true); }
|
createProfilesXmlOldStyle
|
19,078
|
VirtualFile (String relativePath, String xml) { return createProfilesFile(createProjectSubDir(relativePath), xml, true); }
|
createProfilesXmlOldStyle
|
19,079
|
VirtualFile (String xml) { return createProfilesFile(myProjectRoot, xml, false); }
|
createProfilesXml
|
19,080
|
VirtualFile (String relativePath, String xml) { return createProfilesFile(createProjectSubDir(relativePath), xml, false); }
|
createProfilesXml
|
19,081
|
VirtualFile (VirtualFile dir, String xml, boolean oldStyle) { return createProfilesFile(dir, createValidProfiles(xml, oldStyle)); }
|
createProfilesFile
|
19,082
|
VirtualFile (String content) { return createProfilesFile(myProjectRoot, content); }
|
createFullProfilesXml
|
19,083
|
VirtualFile (String relativePath, String content) { return createProfilesFile(createProjectSubDir(relativePath), content); }
|
createFullProfilesXml
|
19,084
|
VirtualFile (final VirtualFile dir, String content) { VirtualFile f = dir.findChild("profiles.xml"); if (f == null) { try { f = WriteAction.computeAndWait(() -> dir.createChildData(null, "profiles.xml")); } catch (IOException e) { throw new RuntimeException(e); } } setFileContent(f, content, true); return f; }
|
createProfilesFile
|
19,085
|
void (String... relativePaths) { for (String path : relativePaths) { createProjectSubDir(path); } }
|
createProjectSubDirs
|
19,086
|
VirtualFile (String relativePath) { File f = new File(getProjectPath(), relativePath); f.mkdirs(); return LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f); }
|
createProjectSubDir
|
19,087
|
void (final VirtualFile file, final String content, final boolean advanceStamps) { try { WriteAction.runAndWait(() -> { if (advanceStamps) { file.setBinaryContent(content.getBytes(StandardCharsets.UTF_8), -1, file.getTimeStamp() + 4000); } else { file.setBinaryContent(content.getBytes(StandardCharsets.UTF_8), file.getModificationStamp(), file.getTimeStamp()); } }); } catch (IOException e) { throw new RuntimeException(e); } }
|
setFileContent
|
19,088
|
void (Collection<String> actual, Collection<String> expected) { assertEquals(new SetWithToString<>(CollectionFactory.createFilePathSet(expected)), new SetWithToString<>(CollectionFactory.createFilePathSet(actual))); }
|
assertUnorderedPathsAreEqual
|
19,089
|
void (String filePath, String expectedText) { try { assertSameLinesWithFile(filePath, expectedText); } catch (FileComparisonFailure e) { String expected = e.getExpected(); String actual = e.getActual(); assertUnorderedElementsAreEqual(expected.split("\n"), actual.split("\n")); } }
|
assertUnorderedLinesWithFile
|
19,090
|
boolean () { //printIgnoredMessage(null); return false; }
|
ignore
|
19,091
|
boolean () { boolean result = getTestMavenHome() != null; if (!result) printIgnoredMessage("Maven installation not found"); return result; }
|
hasMavenInstallation
|
19,092
|
MavenServerConnector (MavenServerConnector connector) { assertTrue("Connector is Dummy!", connector instanceof MavenServerConnectorImpl); long timeout = TimeUnit.SECONDS.toMillis(10); long start = System.currentTimeMillis(); while (connector.getState() == MavenServerConnectorImpl.State.STARTING) { if (System.currentTimeMillis() > start + timeout) { throw new RuntimeException("Server connector not connected in 10 seconds"); } EdtTestUtil.runInEdtAndWait(() -> { PlatformTestUtil.dispatchAllEventsInIdeEventQueue(); }); } assertTrue(connector.checkConnected()); return connector; }
|
ensureConnected
|
19,093
|
void (String message) { String toPrint = "Ignored"; if (message != null) { toPrint += ", because " + message; } toPrint += ": " + getClass().getSimpleName() + "." + getName(); System.out.println(toPrint); }
|
printIgnoredMessage
|
19,094
|
String () { return System.getProperty("idea.maven.test.home"); }
|
getTestMavenHome
|
19,095
|
DataContext (VirtualFile pomFile) { final DataContext defaultContext = DataManager.getInstance().getDataContext(); return dataId -> { if (CommonDataKeys.PROJECT.is(dataId)) { return myProject; } if (CommonDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) { return new VirtualFile[]{pomFile}; } return defaultContext.getData(dataId); }; }
|
createTestDataContext
|
19,096
|
int () { return myDelegate.size(); }
|
size
|
19,097
|
boolean (Object o) { return myDelegate.contains(o); }
|
contains
|
19,098
|
Iterator<T> () { return myDelegate.iterator(); }
|
iterator
|
19,099
|
boolean (Collection<?> c) { return myDelegate.containsAll(c); }
|
containsAll
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.