Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/org/labkey/test/tests/upgrade/BaseUpgradeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import static org.apache.commons.lang3.StringUtils.trimToNull;

/**
* Base test class for tests that setup data and configure a server then verify the persistence or modification of those
* data and configurations after upgrading to a newer version of LabKey.<br>
* The {@code EariestVersion} and {@code LatestVersion} annotations can be used to skip particular tests when they are
* Base test class for tests that set up data and configure a server, then verify the persistence or modification of
* those data and configurations after upgrading to a newer version of LabKey.<br>
* The {@link EarliestVersion} and {@link LatestVersion} annotations can be used to skip particular tests when they are
Comment on lines +27 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you noticed that when you type /** IntelliJ will give you a prompt to have AI fill in the documentation? I've only used it once, and it was a bit verbose but kind of cool.

* not relevant to the version of LabKey being upgraded from (specified in the {@code webtest.upgradePreviousVersion}
* system property).<br>
* The setup steps will be skipped if the {@code webtest.upgradeSetup} system property is set to {@code false}.
Expand Down Expand Up @@ -77,7 +77,8 @@ public List<String> getAssociatedModules()
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
protected @interface EariestVersion {
protected @interface EarliestVersion
{
String value();
}

Expand All @@ -98,12 +99,12 @@ private static class UpgradeVersionCheck implements TestRule
@Override
public @NotNull Statement apply(Statement base, Description description)
{
String eariestVersion = Optional.ofNullable(description.getAnnotation(EariestVersion.class))
.map(EariestVersion::value).orElse(null);
String earliestVersion = Optional.ofNullable(description.getAnnotation(EarliestVersion.class))
.map(EarliestVersion::value).orElse(null);
String latestVersion = Optional.ofNullable(description.getAnnotation(LatestVersion.class))
.map(LatestVersion::value).orElse(null);

if (isUpgradeSetupPhase || previousVersion == null || (eariestVersion == null && latestVersion == null))
if (isUpgradeSetupPhase || previousVersion == null || (earliestVersion == null && latestVersion == null))
{
return base; // Run the test normally
}
Expand All @@ -114,7 +115,7 @@ private static class UpgradeVersionCheck implements TestRule
public void evaluate() throws Throwable
{
Assume.assumeTrue("Test doesn't support upgrading from version: " + previousVersion,
VersionRange.versionRange(eariestVersion, latestVersion).contains(previousVersion)
VersionRange.versionRange(earliestVersion, latestVersion).contains(previousVersion)
);
base.evaluate();
}
Expand Down