Skip to content

Commit

Permalink
Added not released versions 1.24 and 1.25 of MediaWiki
Browse files Browse the repository at this point in the history
Task: #38
  • Loading branch information
eldur committed Dec 7, 2014
1 parent aa8485a commit 3b505a4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/main/java/net/sourceforge/jwbf/core/NotReleased.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package net.sourceforge.jwbf.core;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
public @interface NotReleased {
}
16 changes: 14 additions & 2 deletions src/main/java/net/sourceforge/jwbf/mediawiki/MediaWiki.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.primitives.Ints;
import net.sourceforge.jwbf.core.NotReleased;
import net.sourceforge.jwbf.core.internal.Checked;
import org.apache.commons.lang3.StringEscapeUtils;

/**
Expand Down Expand Up @@ -150,6 +152,14 @@ public enum Version {
* Released 2014-06-05
*/
, MW1_23
/**
* TODO Not released
*/
, @NotReleased MW1_24
/**
* TODO Not released
*/
, @NotReleased MW1_25
/**
*
*/
Expand Down Expand Up @@ -207,8 +217,10 @@ public static Version getLatest() {
@VisibleForTesting
public static boolean isStableVersion(Version version) {
if (version != null) {
boolean isDeprecated = getField(version).isAnnotationPresent(Deprecated.class);
return !(version.equals(DEVELOPMENT) || version.equals(UNKNOWN) || isDeprecated);
Field field = getField(version);
boolean isDeprecated = field.isAnnotationPresent(Deprecated.class);
boolean isBeta = field.isAnnotationPresent(NotReleased.class);
return !(version.equals(DEVELOPMENT) || version.equals(UNKNOWN) || isDeprecated || isBeta);
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ public void testValuesStable() {
.add(MediaWiki.Version.MW1_18) //
.add(MediaWiki.Version.MW1_20) //
.add(MediaWiki.Version.MW1_21) //
// --
.add(MediaWiki.Version.MW1_24) //
.add(MediaWiki.Version.MW1_25) //
.build();

assertFalse("there should be unstable versions as reference test", unstable.isEmpty());
Expand Down

0 comments on commit 3b505a4

Please sign in to comment.