|
11 | 11 | import java.util.List; |
12 | 12 | import java.util.Map; |
13 | 13 |
|
| 14 | +import org.assertj.core.api.SoftAssertions; |
| 15 | +import org.assertj.core.api.junit.jupiter.SoftAssertionsExtension; |
14 | 16 | import org.junit.jupiter.api.AfterEach; |
15 | 17 | import org.junit.jupiter.api.BeforeEach; |
16 | 18 | import org.junit.jupiter.api.Test; |
| 19 | +import org.junit.jupiter.api.extension.ExtendWith; |
17 | 20 | import org.osgi.service.repository.Repository; |
18 | 21 |
|
19 | 22 | import aQute.bnd.build.Workspace; |
|
25 | 28 | import aQute.lib.io.IO; |
26 | 29 | import aQute.maven.provider.FakeNexus; |
27 | 30 |
|
| 31 | +@ExtendWith(SoftAssertionsExtension.class) |
28 | 32 | public class WorkspaceTest { |
29 | 33 | @InjectTemporaryDirectory |
30 | 34 | File tmp; |
@@ -150,4 +154,62 @@ public void testTagDisplay() { |
150 | 154 | assertEquals("foo", Tags.print(Tags.of(Tagged.EMPTY_TAGS, "foo"))); |
151 | 155 | assertEquals("bar,foo", Tags.print(Tags.of(Tagged.EMPTY_TAGS, "foo", "bar"))); |
152 | 156 | } |
| 157 | + |
| 158 | + @Test |
| 159 | + public void testTags(SoftAssertions softly) { |
| 160 | + |
| 161 | + softly.assertThat(Tags.of() |
| 162 | + .includesAny("resolve")) |
| 163 | + .isTrue(); |
| 164 | + |
| 165 | + softly.assertThat(Tags.of() |
| 166 | + .includesAny("compile")) |
| 167 | + .isTrue(); |
| 168 | + |
| 169 | + softly.assertThat(Tags.of("resolve") |
| 170 | + .includesAny("resolve")) |
| 171 | + .isTrue(); |
| 172 | + // only in 7.2.0, will be stop working in 7.3.0 |
| 173 | + softly.assertThat(Tags.of("resolve") |
| 174 | + .includesAny("compile")) |
| 175 | + .isTrue(); |
| 176 | + |
| 177 | + softly.assertThat(Tags.of("resolve", "compile") |
| 178 | + .includesAny("resolve")) |
| 179 | + .isTrue(); |
| 180 | + |
| 181 | + softly.assertThat(Tags.of("resolve", "compile") |
| 182 | + .includesAny("compile")) |
| 183 | + .isTrue(); |
| 184 | + |
| 185 | + softly.assertThat(Tags.of("resolve", "compile") |
| 186 | + .includesAny("compile", "resolve")) |
| 187 | + .isTrue(); |
| 188 | + |
| 189 | + softly.assertThat(Tags.of("resolve", "compile") |
| 190 | + .includesAny("resolve", "compile")) |
| 191 | + .isTrue(); |
| 192 | + |
| 193 | + softly.assertThat(Tags.of("resolve", "compile", "somethingelse") |
| 194 | + .includesAny("resolve", "compile")) |
| 195 | + .isTrue(); |
| 196 | + |
| 197 | + // negative |
| 198 | + softly.assertThat(Tags.of("resolve", "nocompile") |
| 199 | + .includesAny("resolve")) |
| 200 | + .isTrue(); |
| 201 | + |
| 202 | + softly.assertThat(Tags.of("resolve", "nocompile") |
| 203 | + .includesAny("compile")) |
| 204 | + .isFalse(); |
| 205 | + |
| 206 | + softly.assertThat(Tags.of("noresolve", "nocompile") |
| 207 | + .includesAny("resolve")) |
| 208 | + .isFalse(); |
| 209 | + |
| 210 | + softly.assertThat(Tags.of("noresolve", "nocompile") |
| 211 | + .includesAny("compile")) |
| 212 | + .isFalse(); |
| 213 | + |
| 214 | + } |
153 | 215 | } |
0 commit comments