Exemplo n.º 1
0
 @Test
 public void concept() throws IOException, InterruptedException {
   String rulesDirectory = EffectiveRulesIT.class.getResource("/rules").getFile();
   String[] args =
       new String[] {"effective-rules", "-r", rulesDirectory, "-concepts", "junit4:TestMethod"};
   ExecutionResult executionResult = execute(args);
   assertThat(executionResult.getExitCode(), equalTo(0));
   List<String> console = executionResult.getErrorConsole();
   assertThat(console, hasItem(containsString("junit4:TestMethod")));
 }
Exemplo n.º 2
0
 @Test
 public void customGroup() throws IOException, InterruptedException {
   String rulesDirectory = EffectiveRulesIT.class.getResource("/rules").getFile();
   String[] args = new String[] {"effective-rules", "-r", rulesDirectory, "-groups", CUSTOM_GROUP};
   ExecutionResult executionResult = execute(args);
   assertThat(executionResult.getExitCode(), equalTo(0));
   List<String> console = executionResult.getErrorConsole();
   assertThat(console, hasItem(containsString(TEST_CONCEPT)));
   assertThat(console, hasItem(containsString(TEST_CONSTRAINT)));
   assertThat(console, hasItem(containsString(CUSTOM_TEST_CONCEPT)));
   assertThat(console, not(hasItem(containsString("junit4:TestMethod"))));
 }