Tabnine Logo
SystemInfoUtils.attribute
Code IndexAdd Tabnine to your IDE (free)

How to use
attribute
method
in
org.sonar.process.systeminfo.SystemInfoUtils

Best Java code snippets using org.sonar.process.systeminfo.SystemInfoUtils.attribute (Showing top 14 results out of 315)

origin: SonarSource/sonarqube

@Test
public void node_attributes() {
 ProtobufSystemInfo.Section section = underTest.toProtobuf();
 assertThat(attribute(section, "CPU Usage (%)")).isNotNull();
 assertThat(attribute(section, "Disk Available")).isNotNull();
 assertThat(attribute(section, "Store Size")).isNotNull();
}
origin: SonarSource/sonarqube

public static void assertThatAttributeIs(ProtobufSystemInfo.Section section, String key, String expectedValue) {
 ProtobufSystemInfo.Attribute value = attribute(section, key);
 assertThat(value).as(key).isNotNull();
 assertThat(value.getStringValue()).isEqualTo(expectedValue);
}
origin: SonarSource/sonarqube

 public static void assertThatAttributeIs(ProtobufSystemInfo.Section section, String key, long expectedValue) {
  ProtobufSystemInfo.Attribute value = attribute(section, key);
  assertThat(value).as(key).isNotNull();
  assertThat(value.getLongValue()).isEqualTo(expectedValue);
 }
}
origin: SonarSource/sonarqube

public static void assertThatAttributeIs(ProtobufSystemInfo.Section section, String key, boolean expectedValue) {
 ProtobufSystemInfo.Attribute value = attribute(section, key);
 assertThat(value).as(key).isNotNull();
 assertThat(value.getBooleanValue()).isEqualTo(expectedValue);
}
origin: SonarSource/sonarqube

@Test
public void pool_info() {
 ProtobufSystemInfo.Section section = underTest.toProtobuf();
 assertThat(attribute(section, "Pool Max Connections").getLongValue()).isGreaterThan(0L);
 assertThat(attribute(section, "Pool Idle Connections").getLongValue()).isGreaterThanOrEqualTo(0L);
 assertThat(attribute(section, "Pool Min Idle Connections").getLongValue()).isGreaterThanOrEqualTo(0L);
 assertThat(attribute(section, "Pool Max Idle Connections").getLongValue()).isGreaterThanOrEqualTo(0L);
 assertThat(attribute(section, "Pool Max Wait (ms)")).isNotNull();
 assertThat(attribute(section, "Pool Remove Abandoned")).isNotNull();
 assertThat(attribute(section, "Pool Remove Abandoned Timeout (seconds)").getLongValue()).isGreaterThanOrEqualTo(0L);
}
origin: SonarSource/sonarqube

@Test
public void index_attributes() {
 ProtobufSystemInfo.Section section = underTest.toProtobuf();
 // one index "issues"
 assertThat(attribute(section, "Index issues - Docs").getLongValue()).isEqualTo(0L);
 assertThat(attribute(section, "Index issues - Shards").getLongValue()).isGreaterThan(0);
 assertThat(attribute(section, "Index issues - Store Size").getStringValue()).isNotNull();
}
origin: SonarSource/sonarqube

@Test
public void test_setAttribute_with_boolean_parameter() {
 Section.Builder builder = Section.newBuilder();
 SystemInfoUtils.setAttribute(builder, "isNull", (Boolean)null);
 SystemInfoUtils.setAttribute(builder, "isTrue", true);
 SystemInfoUtils.setAttribute(builder, "isFalse", false);
 Section section = builder.build();
 assertThat(SystemInfoUtils.attribute(section, "isNull")).isNull();
 assertThat(SystemInfoUtils.attribute(section, "isTrue").getBooleanValue()).isTrue();
 assertThat(SystemInfoUtils.attribute(section, "isFalse").getBooleanValue()).isFalse();
}
origin: SonarSource/sonarqube

@Test
public void no_realm() {
 when(securityRealmFactory.getRealm()).thenReturn(null);
 ProtobufSystemInfo.Section protobuf = underTest.toProtobuf();
 assertThat(attribute(protobuf, "External User Authentication")).isNull();
}
origin: SonarSource/sonarqube

@Test
public void no_realm() {
 when(securityRealmFactory.getRealm()).thenReturn(null);
 ProtobufSystemInfo.Section protobuf = underTest.toProtobuf();
 assertThat(attribute(protobuf, "External User Authentication")).isNull();
}
origin: SonarSource/sonarqube

 @Test
 public void test_attributes() {
  ProtobufSystemInfo.Section section = underTest.toProtobuf();
  assertThat(attribute(section, "Nodes").getLongValue()).isGreaterThan(0);
  assertThat(attribute(section, "State").getStringValue()).isIn("RED", "YELLOW", "GREEN");
 }
}
origin: SonarSource/sonarqube

 @Test
 public void return_nb_of_processors() {
  ProtobufSystemInfo.Section protobuf = underTest.toProtobuf();
  assertThat(attribute(protobuf, "Processors").getLongValue()).isGreaterThan(0);
 }
}
origin: SonarSource/sonarqube

@Test
public void return_nb_of_processors() {
 ProtobufSystemInfo.Section section = underTest.toProtobuf();
 assertThat(attribute(section, "Processors").getLongValue()).isGreaterThan(0);
}
origin: SonarSource/sonarqube

 @Test
 public void db_info() {
  ProtobufSystemInfo.Section section = underTest.toProtobuf();
  SystemInfoTesting.assertThatAttributeIs(section, "Database", "H2");
  assertThat(attribute(section, "Database Version").getStringValue()).startsWith("1.");
  SystemInfoTesting.assertThatAttributeIs(section, "Username", "SONAR");
  assertThat(attribute(section, "Driver Version").getStringValue()).startsWith("1.");
 }
}
origin: SonarSource/sonarqube

 @Test
 public void return_dir_paths() {
  settings.setProperty(PATH_HOME.getKey(), "/home");
  settings.setProperty(PATH_DATA.getKey(), "/data");
  settings.setProperty(PATH_TEMP.getKey(), "/temp");
  settings.setProperty(PATH_LOGS.getKey(), "/logs");
  settings.setProperty(PATH_WEB.getKey(), "/web");

  ProtobufSystemInfo.Section section = underTest.toProtobuf();

  assertThatAttributeIs(section, "Home Dir", "/home");
  assertThatAttributeIs(section, "Data Dir", "/data");
  assertThatAttributeIs(section, "Temp Dir", "/temp");

  // logs dir is part of LoggingSection
  assertThat(attribute(section, "Logs Dir")).isNull();

  // for internal usage
  assertThat(attribute(section, "Web Dir")).isNull();

 }
}
org.sonar.process.systeminfoSystemInfoUtilsattribute

Popular methods of SystemInfoUtils

  • setAttribute
  • order

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • Menu (java.awt)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now