Search in sources :

Example 6 with StorageStatus

use of org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus in project sonarlint-core by SonarSource.

the class ConnectedFileExclusionsMediumTest method writeModuleStatus.

private static void writeModuleStatus(Path storage, String name, String version) throws IOException {
    Path module = storage.resolve("local").resolve("modules").resolve(name);
    StorageStatus storageStatus = StorageStatus.newBuilder().setStorageVersion(StoragePaths.STORAGE_VERSION).setClientUserAgent("agent").setSonarlintCoreVersion(version).setUpdateTimestamp(new Date().getTime()).build();
    Files.createDirectories(module);
    ProtobufUtil.writeToFile(storageStatus, module.resolve(StoragePaths.STORAGE_STATUS_PB));
}
Also used : Path(java.nio.file.Path) StorageStatus(org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus) Date(java.util.Date)

Example 7 with StorageStatus

use of org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus in project sonarlint-core by SonarSource.

the class ConnectedFileExclusionsMediumTest method writeStatus.

private static void writeStatus(Path storage, String version) throws IOException {
    Path module = storage.resolve("local").resolve("global");
    StorageStatus storageStatus = StorageStatus.newBuilder().setStorageVersion(StoragePaths.STORAGE_VERSION).setClientUserAgent("agent").setSonarlintCoreVersion(version).setUpdateTimestamp(new Date().getTime()).build();
    Files.createDirectories(module);
    ProtobufUtil.writeToFile(storageStatus, module.resolve(StoragePaths.STORAGE_STATUS_PB));
}
Also used : Path(java.nio.file.Path) StorageStatus(org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus) Date(java.util.Date)

Example 8 with StorageStatus

use of org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus in project sonarlint-core by SonarSource.

the class ConnectedIssueMediumTest method writeModuleStatus.

private static void writeModuleStatus(Path storage, String name, String version) throws IOException {
    Path module = storage.resolve(StoragePaths.encodeForFs(SERVER_ID)).resolve("modules").resolve(name);
    StorageStatus storageStatus = StorageStatus.newBuilder().setStorageVersion(version).setClientUserAgent("agent").setSonarlintCoreVersion("1.0").setUpdateTimestamp(new Date().getTime()).build();
    Files.createDirectories(module);
    ProtobufUtil.writeToFile(storageStatus, module.resolve(StoragePaths.STORAGE_STATUS_PB));
}
Also used : Path(java.nio.file.Path) StorageStatus(org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus) Date(java.util.Date)

Example 9 with StorageStatus

use of org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus in project sonarlint-core by SonarSource.

the class ConnectedIssueMediumTest method writeStatus.

private static void writeStatus(Path storage, String version) throws IOException {
    Path module = storage.resolve(StoragePaths.encodeForFs(SERVER_ID)).resolve("global");
    StorageStatus storageStatus = StorageStatus.newBuilder().setStorageVersion(StoragePaths.STORAGE_VERSION).setClientUserAgent("agent").setSonarlintCoreVersion(version).setUpdateTimestamp(new Date().getTime()).build();
    Files.createDirectories(module);
    ProtobufUtil.writeToFile(storageStatus, module.resolve(StoragePaths.STORAGE_STATUS_PB));
}
Also used : Path(java.nio.file.Path) StorageStatus(org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus) Date(java.util.Date)

Example 10 with StorageStatus

use of org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus in project sonarlint-core by SonarSource.

the class ConnectedStaleStorageMediumTest method writeUpdateStatus.

private static void writeUpdateStatus(Path storage, String version) throws IOException {
    StorageStatus storageStatus = StorageStatus.newBuilder().setStorageVersion(version).setClientUserAgent("agent").setSonarlintCoreVersion("1.0").setUpdateTimestamp(new Date().getTime()).build();
    Path global = storage.resolve("global");
    Files.createDirectories(global);
    ProtobufUtil.writeToFile(storageStatus, global.resolve(StoragePaths.STORAGE_STATUS_PB));
}
Also used : Path(java.nio.file.Path) StorageStatus(org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus) Date(java.util.Date)

Aggregations

StorageStatus (org.sonarsource.sonarlint.core.proto.Sonarlint.StorageStatus)10 Date (java.util.Date)9 Path (java.nio.file.Path)8 ServerInfos (org.sonarsource.sonarlint.core.proto.Sonarlint.ServerInfos)2 Test (org.junit.Test)1 SonarAnalyzer (org.sonarsource.sonarlint.core.client.api.connected.SonarAnalyzer)1 ProgressWrapper (org.sonarsource.sonarlint.core.util.ProgressWrapper)1