/** * @param msg Message. */ @TestOnly protected void startMessageProcess(TcpDiscoveryAbstractMessage msg) { // No-op, intended for usage in tests. }
@TestOnly public GoIntroduceOperation(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file, boolean replaceAll) { myProject = project; myEditor = editor; myFile = file; myReplaceAll = replaceAll; }
@TestOnly public static void disableTypeInfoInLookup(@NotNull Disposable disposable) { typesDisabled = true; Disposer.register(disposable, () -> { //noinspection AssignmentToStaticFieldFromInstanceMethod typesDisabled = false; }); }
@TestOnly public static void setTestingPackageName(@NotNull String packageName, @NotNull Disposable disposable) { myTestingPackageName = packageName; Disposer.register(disposable, () -> { //noinspection AssignmentToStaticFieldFromInstanceMethod myTestingPackageName = null; }); }
@TestOnly public static void setTestingMode(@NotNull Disposable disposable) { isTestingMode = true; Disposer.register(disposable, () -> { //noinspection AssignmentToStaticFieldFromInstanceMethod isTestingMode = false; }); }
@TestOnly public static void setTestingSdkVersion(@Nullable String version, @NotNull Disposable disposable) { ourTestSdkVersion = version; Disposer.register(disposable, () -> { //noinspection AssignmentToStaticFieldFromInstanceMethod ourTestSdkVersion = null; }); } }
@Deprecated @TestOnly public class DebugUtils { private static final Logger LOG = LoggerFactory.getLogger(DebugUtils.class);
/** * {@link DistributedMetaStorageBridge#localFullData()} invoked on {@link #bridge}. */ @TestOnly private DistributedMetaStorageHistoryItem[] localFullData() throws IgniteCheckedException { return bridge.localFullData(); }
@TestOnly public static void setTestingMode(@NotNull Disposable disposable) { isTestingMode = true; Disposer.register(disposable, () -> { //noinspection AssignmentToStaticFieldFromInstanceMethod isTestingMode = false; }); }
@Nullable @TestOnly public String getFileCoverageInformationString(@NotNull VirtualFile file) { FileCoverageInfo coverageInfo = myFileCoverageInfos.get(file.getPath()); return coverageInfo != null ? getStatementsCoverageString(coverageInfo) : null; }
@TestOnly public static void setTestingSdkVersion(@Nullable String version, @NotNull Disposable disposable) { ourTestSdkVersion = version; Disposer.register(disposable, () -> { //noinspection AssignmentToStaticFieldFromInstanceMethod ourTestSdkVersion = null; }); } }
@Nullable @TestOnly public String getDirCoverageInformationString(@NotNull VirtualFile file) { DirCoverageInfo coverageInfo = myDirCoverageInfos.get(file.getPath()); return coverageInfo != null ? getDirCoverageString(coverageInfo) : null; }
@TestOnly @NotNull public static Sdk createMockSdk(@NotNull String sdkHome, @NotNull Release version) { getInstance().mySdkHomeToReleaseCache.put(getVersionCacheKey(sdkHome), version); // we'll not try to detect sdk version in tests environment Sdk sdk = new ProjectJdkImpl(getDefaultSdkName(sdkHome, version), getInstance()); SdkModificator sdkModificator = sdk.getSdkModificator(); sdkModificator.setHomePath(sdkHome); sdkModificator.setVersionString(getVersionString(version));// must be set after home path, otherwise setting home path clears the version string sdkModificator.commitChanges(); configureSdkPaths(sdk); return sdk; }
@TestOnly public static void allowAnonKex() { SecureSocketUtils.allowAnonKex = true; } }
@TestOnly MessageBodyExtractor(boolean forceTruncatorGroping, long ignoreMessageBodyLengthForTesting) { this.forceTruncatorGroping = forceTruncatorGroping; this.ignoreMessageBodyLengthForTesting = ignoreMessageBodyLengthForTesting; }
@TestOnly public static void disableClientAuth() { SecureSocketUtils.disableClientAuth = true; }
@TestOnly public static void forceTimeoutMs(final int timeoutMs) { SocketUtils.testTimeout = timeoutMs; } }
@TestOnly public Node(HostName hostname, State state, NodeType type, Optional<ApplicationId> owner, Version currentVersion, Version wantedVersion) { this(hostname, state, type, owner, currentVersion, wantedVersion, Version.emptyVersion, Version.emptyVersion, ServiceState.unorchestrated, 0, 0, 0, 0); }
@NotNull @TestOnly public String statistics() { return myName + " threads created counter = " + counter; }
@TestOnly public boolean isEmpty() { synchronized (treeLock) { return myRootObjects.isEmpty(); } }