Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: BJ Hargrave <bj@hargrave.dev>
  • Loading branch information
laeubi and bjhargrave committed Aug 25, 2022
1 parent 124db32 commit a3889d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
22 changes: 8 additions & 14 deletions biz.aQute.bndlib.tests/test/test/model/EETest.java
Expand Up @@ -92,9 +92,9 @@ public void checkEEHasCompatible(EE ee) throws Exception {
assertThat(compatible).isNotEmpty();
}

@ParameterizedTest(name = "Validate valid release target foe EEs exist for {arguments}")
@ParameterizedTest(name = "Validate release target for {arguments}")
@ArgumentsSource(EEsArgumentsProvider.class)
@DisplayName("Validate each EEs has valid release target")
@DisplayName("Validate release target for each EE")
public void checkEEHasValidRelease(EE ee) throws Exception {
switch (ee) {
case OSGI_Minimum_1_0 :
Expand All @@ -105,30 +105,24 @@ public void checkEEHasValidRelease(EE ee) throws Exception {
case J2SE_1_4 :
case J2SE_1_5 :
case JRE_1_1 :
assertTrue(ee.getReleaseTarget()
.isEmpty());
assertThat(ee.getReleaseTarget()).isEmpty();
break;
case JavaSE_1_6 :
assertEquals(6, ee.getReleaseTarget()
.getAsInt());
assertThat(ee.getReleaseTarget()).hasValue(6);
break;
case JavaSE_1_7 :
assertEquals(7, ee.getReleaseTarget()
.getAsInt());
assertThat(ee.getReleaseTarget()).hasValue(7);
break;
case JavaSE_1_8 :
case JavaSE_compact1_1_8 :
case JavaSE_compact2_1_8 :
case JavaSE_compact3_1_8 :
assertEquals(8, ee.getReleaseTarget()
.getAsInt());
assertThat(ee.getReleaseTarget()).hasValue(8);
break;

default :
assertEquals(ee.getCapabilityVersion()
.getMajor(),
ee.getReleaseTarget()
.getAsInt());
assertThat(ee.getReleaseTarget()).hasValue(ee.getCapabilityVersion()
.getMajor());
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion biz.aQute.bndlib/src/aQute/bnd/build/model/EE.java
Expand Up @@ -152,7 +152,7 @@ public Version getCapabilityVersion() {
public OptionalInt getReleaseTarget() {
Version version = getCapabilityVersion();
int major = version.getMajor();
if (major > 8) {
if (major > 1) {
return OptionalInt.of(major);
}
if (major == 1 && version.getMinor() > 5) {
Expand Down

0 comments on commit a3889d6

Please sign in to comment.