1
2
3
4
5 package com.qulice.maven;
6
7 import com.qulice.spi.ResourceValidator;
8 import com.qulice.spi.Violation;
9 import java.io.File;
10 import java.util.Collection;
11 import java.util.Collections;
12 import java.util.concurrent.atomic.AtomicInteger;
13
14
15
16
17
18
19
20
21
22
23 final class FakeResourceValidator implements ResourceValidator {
24
25
26
27
28 private final String label;
29
30
31
32
33 private final int total;
34
35
36
37
38 private final AtomicInteger cnt;
39
40 FakeResourceValidator(final String name) {
41 this(name, 0);
42 }
43
44 FakeResourceValidator(final String name, final int rules) {
45 this.label = name;
46 this.total = rules;
47 this.cnt = new AtomicInteger(0);
48 }
49
50 @Override
51 public Collection<Violation> validate(final Collection<File> files) {
52 this.cnt.incrementAndGet();
53 return Collections.emptyList();
54 }
55
56 @Override
57 public String name() {
58 return this.label;
59 }
60
61 @Override
62 public int rules() {
63 return this.total;
64 }
65
66 int count() {
67 return this.cnt.get();
68 }
69 }