test_class.declarator: RULE_ID1 = "AnyCheck1"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID1 = "AnyCheck1";
test_class.type: String
test_class.var_name: RULE_ID1
test_class.declarator: RULE_ID2 = "AnyCheck2"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID2 = "AnyCheck2";
test_class.type: String
test_class.var_name: RULE_ID2
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: sensor
test_class.modifier: private
test_class.original_string: private AnsibleExtraSensor sensor;
test_class.type: AnsibleExtraSensor
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-api/src/test/java/com/github/sbaudoin/sonar/plugins/ansible/extras/rules/AnsibleExtraSensorTest.java
test_class.identifier: AnsibleExtraSensorTest
test_case.body: @Test
      public void testExecute() throws IOException {
          InputFile playbook1 = Utils.getInputFile("playbooks/playbook1.yml");
          InputFile playbook2 = Utils.getInputFile("playbooks/playbook2.yml");
          InputFile playbook3 = Utils.getInputFile("playbooks/playbook3.yml");
          context.fileSystem().add(playbook1).add(playbook2).add(playbook3);
  
          if (System.getProperty("os.name").toLowerCase().contains("windows")) {
              context.settings().appendProperty(AnsibleSettings.ANSIBLE_LINT_PATH_KEY,
                      new File(getClass().getResource("/scripts/ansible-lint4.cmd").getFile()).getAbsolutePath());
          } else {
              String path = new File(getClass().getResource("/scripts/ansible-lint4.sh").getFile()).getAbsolutePath();
              context.settings().appendProperty(AnsibleSettings.ANSIBLE_LINT_PATH_KEY, path);
              setShellRights(path);
          }
  
          DummySensorDescriptor descriptor = new DummySensorDescriptor();
          sensor.describe(descriptor);
  
          assertEquals("Ansible-Lint Sensor with Extra Rules", descriptor.sensorName);
          assertEquals(YamlLanguage.KEY, descriptor.languageKey);
  
          sensor.execute(context);
  
          Collection<Issue> issues = context.allIssues();
          assertEquals(3, issues.size());
          assertTrue(issueExists(issues, ruleKey1, playbook1, 3, "An error -p"));
          assertTrue(issueExists(issues, ruleKey2, playbook1, 5, "Another error --nocolor"));
          assertTrue(issueExists(issues, ruleKey2, playbook2, 3, "Another error -r"));
      }
test_case.class_method_signature: AnsibleExtraSensorTest.testExecute()
test_case.full_signature: @Test public void testExecute()
test_case.identifier: testExecute
test_case.invocations: getInputFile getInputFile getInputFile add add add fileSystem contains toLowerCase getProperty appendProperty settings getAbsolutePath getFile getResource getClass getAbsolutePath getFile getResource getClass appendProperty settings setShellRights describe assertEquals assertEquals execute 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 testExecute()
focal_class.declarator: EXTRA_RULES_TEMP_DIR = "ansible-lint-extra-rules"
focal_class.modifier: public static final
focal_class.original_string: public static final String EXTRA_RULES_TEMP_DIR = "ansible-lint-extra-rules";
focal_class.type: String
focal_class.var_name: EXTRA_RULES_TEMP_DIR
focal_class.declarator: EXTRA_RULES_DIR = "extra-rules"
focal_class.modifier: public static final
focal_class.original_string: public static final String EXTRA_RULES_DIR = "extra-rules";
focal_class.type: String
focal_class.var_name: EXTRA_RULES_DIR
focal_class.declarator: LOGGER = Loggers.get(AnsibleExtraSensor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Loggers.get(AnsibleExtraSensor.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: sonar-ansible-api/src/main/java/com/github/sbaudoin/sonar/plugins/ansible/extras/rules/AnsibleExtraSensor.java
focal_class.identifier: AnsibleExtraSensor
focal_class.class_method_signature: AnsibleExtraSensor.AnsibleExtraSensor(FileSystem fileSystem)
focal_class.full_signature: public  AnsibleExtraSensor(FileSystem fileSystem)
focal_class.identifier: AnsibleExtraSensor
focal_class.modifiers: public
focal_class.parameters: (FileSystem fileSystem)
focal_class.signature:  AnsibleExtraSensor(FileSystem fileSystem)
focal_class.class_method_signature: AnsibleExtraSensor.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: AnsibleExtraSensor.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.class_method_signature: AnsibleExtraSensor.extractExtraRules(String extraRulesDirectory)
focal_class.full_signature: private Path extractExtraRules(String extraRulesDirectory)
focal_class.identifier: extractExtraRules
focal_class.modifiers: private
focal_class.parameters: (String extraRulesDirectory)
focal_class.return: Path
focal_class.signature: Path extractExtraRules(String extraRulesDirectory)
focal_class.class_method_signature: AnsibleExtraSensor.copyExtraRule(Path ruleFile, Path directory)
focal_class.full_signature: private boolean copyExtraRule(Path ruleFile, Path directory)
focal_class.identifier: copyExtraRule
focal_class.modifiers: private
focal_class.parameters: (Path ruleFile, Path directory)
focal_class.return: boolean
focal_class.signature: boolean copyExtraRule(Path ruleFile, Path directory)
focal_class.class_method_signature: AnsibleExtraSensor.deleteDirectory(Path directory)
focal_class.full_signature: private boolean deleteDirectory(Path directory)
focal_class.identifier: deleteDirectory
focal_class.modifiers: private
focal_class.parameters: (Path directory)
focal_class.return: boolean
focal_class.signature: boolean deleteDirectory(Path directory)
focal_class.superclass: extends AbstractAnsibleSensor
focal_method.body: @Override
      public void execute(SensorContext context) {
          // Extract extra rules if any
          Path extraRulesDir = extractExtraRules(EXTRA_RULES_DIR);
          if (extraRulesDir != null) {
              executeWithAnsibleLint(context, Arrays.asList("-r", extraRulesDir.toString()));
              deleteDirectory(extraRulesDir);
          }
      }
focal_method.class_method_signature: AnsibleExtraSensor.execute(SensorContext context)
focal_method.full_signature: @Override public void execute(SensorContext context)
focal_method.identifier: execute
focal_method.invocations: extractExtraRules executeWithAnsibleLint asList toString deleteDirectory
focal_method.modifiers: @Override public
focal_method.parameters: (SensorContext context)
focal_method.return: void
focal_method.signature: void execute(SensorContext context)