test_class.declarator: RULE_ID1 = "ANSIBLE1"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID1 = "ANSIBLE1";
test_class.type: String
test_class.var_name: RULE_ID1
test_class.declarator: RULE_ID2 = "EAnyCheck1"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID2 = "EAnyCheck1";
test_class.type: String
test_class.var_name: RULE_ID2
test_class.declarator: RULE_ID3 = "EAnyCheck2"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID3 = "EAnyCheck2";
test_class.type: String
test_class.var_name: RULE_ID3
test_class.declarator: ruleKey1 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID1)
test_class.modifier: private final
test_class.original_string: private final RuleKey ruleKey1 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID1);
test_class.type: RuleKey
test_class.var_name: ruleKey1
test_class.declarator: ruleKey2 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID2)
test_class.modifier: private final
test_class.original_string: private final RuleKey ruleKey2 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID2);
test_class.type: RuleKey
test_class.var_name: ruleKey2
test_class.declarator: ruleKey3 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID3)
test_class.modifier: private final
test_class.original_string: private final RuleKey ruleKey3 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID3);
test_class.type: RuleKey
test_class.var_name: ruleKey3
test_class.declarator: sensor
test_class.modifier: private
test_class.original_string: private AnsibleSensor sensor;
test_class.type: AnsibleSensor
test_class.var_name: sensor
test_class.declarator: context
test_class.modifier: private
test_class.original_string: private SensorContextTester context;
test_class.type: SensorContextTester
test_class.var_name: context
test_class.declarator: temporaryFolder = new TemporaryFolder()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder temporaryFolder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: temporaryFolder
test_class.file: sonar-ansible-plugin/src/test/java/com/github/sbaudoin/sonar/plugins/ansible/rules/AnsibleSensorTest.java
test_class.identifier: AnsibleSensorTest
test_case.body: @Test
      public void testExecuteWithAnsibleLintStdOutput() throws IOException {
          Path baseDir = context.fileSystem().baseDirPath();
          InputFile playbook = TestInputFileBuilder.create("moduleKey", baseDir.resolve("playbooks/playbook1.yml").toString())
                  .setModuleBaseDir(Paths.get("."))
                  .setContents(new String(Files.readAllBytes(baseDir.resolve("playbooks/playbook1.yml"))))
                  .setLanguage(YamlLanguage.KEY)
                  .setCharset(StandardCharsets.UTF_8)
                  .build();
          context.fileSystem().add(playbook);
  
          if (System.getProperty("os.name").toLowerCase().contains("windows")) {
              context.settings().appendProperty(AnsibleSettings.ANSIBLE_LINT_PATH_KEY,
                      new File(getClass().getResource("/scripts/ansible-lint.cmd").getFile()).getAbsolutePath());
          } else {
              String path = new File(getClass().getResource("/scripts/ansible-lint.sh").getFile()).getAbsolutePath();
              context.settings().appendProperty(AnsibleSettings.ANSIBLE_LINT_PATH_KEY, path);
              Set<PosixFilePermission> perms = new HashSet<>();
              perms.add(PosixFilePermission.OWNER_READ);
              perms.add(PosixFilePermission.OWNER_WRITE);
              perms.add(PosixFilePermission.OWNER_EXECUTE);
              perms.add(PosixFilePermission.GROUP_READ);
              perms.add(PosixFilePermission.GROUP_EXECUTE);
              perms.add(PosixFilePermission.OTHERS_READ);
              perms.add(PosixFilePermission.OTHERS_EXECUTE);
              Files.setPosixFilePermissions(Paths.get(path), perms);
          }
  
          sensor.execute(context);
          assertEquals(1, sensor.scannedFiles.size());
          assertTrue(sensor.scannedFiles.contains(playbook));
  
          Collection<Issue> issues = context.allIssues();
          assertEquals(3, issues.size());
          assertTrue(issueExists(issues, ruleKey1, playbook, 1, "A first error"));
          assertTrue(issueExists(issues, ruleKey2, playbook, 3, "An error -p"));
          assertTrue(issueExists(issues, ruleKey3, playbook, 5, "Another error --nocolor"));
      }
test_case.class_method_signature: AnsibleSensorTest.testExecuteWithAnsibleLintStdOutput()
test_case.full_signature: @Test public void testExecuteWithAnsibleLintStdOutput()
test_case.identifier: testExecuteWithAnsibleLintStdOutput
test_case.invocations: baseDirPath fileSystem build setCharset setLanguage setContents setModuleBaseDir create toString resolve get readAllBytes resolve add fileSystem contains toLowerCase getProperty appendProperty settings getAbsolutePath getFile getResource getClass getAbsolutePath getFile getResource getClass appendProperty settings add add add add add add add setPosixFilePermissions get execute assertEquals size assertTrue contains allIssues assertEquals size assertTrue issueExists assertTrue issueExists assertTrue issueExists
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteWithAnsibleLintStdOutput()
focal_class.file: sonar-ansible-plugin/src/main/java/com/github/sbaudoin/sonar/plugins/ansible/rules/AnsibleSensor.java
focal_class.identifier: AnsibleSensor
focal_class.class_method_signature: AnsibleSensor.AnsibleSensor(FileSystem fileSystem)
focal_class.full_signature: public  AnsibleSensor(FileSystem fileSystem)
focal_class.identifier: AnsibleSensor
focal_class.modifiers: public
focal_class.parameters: (FileSystem fileSystem)
focal_class.signature:  AnsibleSensor(FileSystem fileSystem)
focal_class.class_method_signature: AnsibleSensor.describe(SensorDescriptor descriptor)
focal_class.full_signature: @Override public void describe(SensorDescriptor descriptor)
focal_class.identifier: describe
focal_class.modifiers: @Override public
focal_class.parameters: (SensorDescriptor descriptor)
focal_class.return: void
focal_class.signature: void describe(SensorDescriptor descriptor)
focal_class.class_method_signature: AnsibleSensor.execute(SensorContext context)
focal_class.full_signature: @Override public void execute(SensorContext context)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (SensorContext context)
focal_class.return: void
focal_class.signature: void execute(SensorContext context)
focal_class.superclass: extends AbstractAnsibleSensor
focal_method.body: @Override
      public void execute(SensorContext context) {
          executeWithAnsibleLint(context, null);
      }
focal_method.class_method_signature: AnsibleSensor.execute(SensorContext context)
focal_method.full_signature: @Override public void execute(SensorContext context)
focal_method.identifier: execute
focal_method.invocations: executeWithAnsibleLint
focal_method.modifiers: @Override public
focal_method.parameters: (SensorContext context)
focal_method.return: void
focal_method.signature: void execute(SensorContext context)