You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2016/12/06 22:30:12 UTC

[17/24] incubator-freemarker git commit: Setting version to 2.3.26-nightly. Also cleaned up version related testing a bit.

Setting version to 2.3.26-nightly. Also cleaned up version related testing a bit.


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/cded5be7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/cded5be7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/cded5be7

Branch: refs/heads/2.3
Commit: cded5be79eb22bca2735275c239cd87bfe25ec27
Parents: ad4d726
Author: ddekany <dd...@apache.org>
Authored: Sat Dec 3 15:15:12 2016 +0100
Committer: ddekany <dd...@apache.org>
Committed: Sat Dec 3 15:24:05 2016 +0100

----------------------------------------------------------------------
 src/main/java/freemarker/template/Configuration.java     |  3 +++
 src/main/java/freemarker/template/_TemplateAPI.java      |  1 +
 src/main/resources/freemarker/version.properties         |  8 ++++----
 .../freemarker/ext/beans/BeansWrapperSingletonsTest.java |  3 ++-
 .../freemarker/template/DefaultObjectWrapperTest.java    |  1 +
 .../freemarker/template/TemplateLanguageVersionTest.java |  3 ++-
 src/test/java/freemarker/test/TestUtil.java              | 11 +++++++++++
 7 files changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cded5be7/src/main/java/freemarker/template/Configuration.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/Configuration.java b/src/main/java/freemarker/template/Configuration.java
index a888a60..3d9ec04 100644
--- a/src/main/java/freemarker/template/Configuration.java
+++ b/src/main/java/freemarker/template/Configuration.java
@@ -410,6 +410,9 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
 
     /** FreeMarker version 2.3.25 (an {@link #Configuration(Version) incompatible improvements break-point}) */
     public static final Version VERSION_2_3_25 = new Version(2, 3, 25);
+
+    /** FreeMarker version 2.3.26 (an {@link #Configuration(Version) incompatible improvements break-point}) */
+    public static final Version VERSION_2_3_26 = new Version(2, 3, 26);
     
     /** The default of {@link #getIncompatibleImprovements()}, currently {@link #VERSION_2_3_0}. */
     public static final Version DEFAULT_INCOMPATIBLE_IMPROVEMENTS = Configuration.VERSION_2_3_0;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cded5be7/src/main/java/freemarker/template/_TemplateAPI.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/_TemplateAPI.java b/src/main/java/freemarker/template/_TemplateAPI.java
index c3d6e23..0fc702a 100644
--- a/src/main/java/freemarker/template/_TemplateAPI.java
+++ b/src/main/java/freemarker/template/_TemplateAPI.java
@@ -47,6 +47,7 @@ public class _TemplateAPI {
     public static final int VERSION_INT_2_3_23 = Configuration.VERSION_2_3_23.intValue();
     public static final int VERSION_INT_2_3_24 = Configuration.VERSION_2_3_24.intValue();
     public static final int VERSION_INT_2_3_25 = Configuration.VERSION_2_3_25.intValue();
+    public static final int VERSION_INT_2_3_26 = Configuration.VERSION_2_3_26.intValue();
     public static final int VERSION_INT_2_4_0 = Version.intValueFor(2, 4, 0);
     
     public static void checkVersionNotNullAndSupported(Version incompatibleImprovements) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cded5be7/src/main/resources/freemarker/version.properties
----------------------------------------------------------------------
diff --git a/src/main/resources/freemarker/version.properties b/src/main/resources/freemarker/version.properties
index 04a41da..35cabc6 100644
--- a/src/main/resources/freemarker/version.properties
+++ b/src/main/resources/freemarker/version.properties
@@ -58,12 +58,12 @@
 # - When the major version number is increased, major backward
 #   compatibility violations are allowed, but still should be avoided.
 # During Apache Incubation, "-incubating" is added to this string.
-version=2.3.25-incubating
+version=2.3.26-nightly_@timestampInVersion@-incubating
 # This exists as oss.sonatype only allows SNAPSHOT and final releases,
 # so instead 2.3.21-rc01 and such we have to use 2.3.21-SNAPSHOT there.
 # For final releases it's the same as "version".
 # During Apache Incubation, "-incubating" is added to this string.
-mavenVersion=2.3.25-incubating
+mavenVersion=2.3.26-SNAPSHOT-incubating
 
 # Version string that conforms to OSGi
 # ------------------------------------
@@ -77,7 +77,7 @@ mavenVersion=2.3.25-incubating
 #   2.4.0.pre01
 #   2.4.0.nightly_@timestampInVersion@
 # During Apache Incubation, "-incubating" is added to this string.
-versionForOSGi=2.3.25.stable-incubating
+versionForOSGi=2.3.26.nightly_@timestampInVersion@-incubating
 
 # Version string that conforms to legacy MF
 # -----------------------------------------
@@ -95,7 +95,7 @@ versionForOSGi=2.3.25.stable-incubating
 # "97 denotes "nightly", 98 denotes "pre", 99 denotes "rc" build.
 # In general, for the nightly/preview/rc Y of version 2.X, the versionForMf is
 # 2.X-1.(99|98).Y. Note the X-1.
-versionForMf=2.3.25
+versionForMf=2.3.25.97
 
 # The date of the build.
 # This should be automatically filled by the building tool (Ant).

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cded5be7/src/test/java/freemarker/ext/beans/BeansWrapperSingletonsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/ext/beans/BeansWrapperSingletonsTest.java b/src/test/java/freemarker/ext/beans/BeansWrapperSingletonsTest.java
index baa8ee2..d4f762f 100644
--- a/src/test/java/freemarker/ext/beans/BeansWrapperSingletonsTest.java
+++ b/src/test/java/freemarker/ext/beans/BeansWrapperSingletonsTest.java
@@ -39,6 +39,7 @@ import freemarker.template.TemplateModelException;
 import freemarker.template.TemplateScalarModel;
 import freemarker.template.Version;
 import freemarker.template._TemplateAPI;
+import freemarker.test.TestUtil;
 import junit.framework.TestCase;
 
 public class BeansWrapperSingletonsTest extends TestCase {
@@ -58,7 +59,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         assertEquals(Configuration.VERSION_2_3_21, new BeansWrapperBuilder(Configuration.VERSION_2_3_21).getIncompatibleImprovements());
         assertEquals(Configuration.VERSION_2_3_0, new BeansWrapperBuilder(Configuration.VERSION_2_3_20).getIncompatibleImprovements());
         try {
-            new BeansWrapperBuilder(new Version(2, 3, 26));
+            new BeansWrapperBuilder(TestUtil.getClosestFutureVersion());
             fail("Maybe you need to update this test for the new FreeMarker version");
         } catch (IllegalArgumentException e) {
             assertThat(e.getMessage(), containsString("upgrade"));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cded5be7/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/template/DefaultObjectWrapperTest.java b/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
index 70bf263..77d513d 100644
--- a/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
+++ b/src/test/java/freemarker/template/DefaultObjectWrapperTest.java
@@ -91,6 +91,7 @@ public class DefaultObjectWrapperTest {
         expected.add(Configuration.VERSION_2_3_22); // no non-BC change in 2.3.23
         expected.add(Configuration.VERSION_2_3_24);
         expected.add(Configuration.VERSION_2_3_24); // no non-BC change in 2.3.25
+        expected.add(Configuration.VERSION_2_3_24); // no non-BC change in 2.3.26
 
         List<Version> actual = new ArrayList<Version>();
         for (int i = _TemplateAPI.VERSION_INT_2_3_0; i <= Configuration.getVersion().intValue(); i++) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cded5be7/src/test/java/freemarker/template/TemplateLanguageVersionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/template/TemplateLanguageVersionTest.java b/src/test/java/freemarker/template/TemplateLanguageVersionTest.java
index 97dc183..7d60c30 100644
--- a/src/test/java/freemarker/template/TemplateLanguageVersionTest.java
+++ b/src/test/java/freemarker/template/TemplateLanguageVersionTest.java
@@ -27,6 +27,7 @@ import java.io.IOException;
 import org.junit.Test;
 
 import freemarker.cache.StringTemplateLoader;
+import freemarker.test.TestUtil;
 public class TemplateLanguageVersionTest {
 
     @Test
@@ -37,7 +38,7 @@ public class TemplateLanguageVersionTest {
         testDefaultWithVersion(Configuration.VERSION_2_3_20, Configuration.VERSION_2_3_20);
         testDefaultWithVersion(Configuration.VERSION_2_3_21, Configuration.VERSION_2_3_21);
         try {
-            testDefaultWithVersion(new Version(2, 3, 26), Configuration.VERSION_2_3_21);
+            testDefaultWithVersion(TestUtil.getClosestFutureVersion(), Configuration.VERSION_2_3_21);
             fail("Maybe you need to update this test for the new FreeMarker version");
         } catch (IllegalArgumentException e) {
             assertThat(e.getMessage(), containsString("version"));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/cded5be7/src/test/java/freemarker/test/TestUtil.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/test/TestUtil.java b/src/test/java/freemarker/test/TestUtil.java
index 9505d55..23669c0 100644
--- a/src/test/java/freemarker/test/TestUtil.java
+++ b/src/test/java/freemarker/test/TestUtil.java
@@ -18,6 +18,9 @@
  */
 package freemarker.test;
 
+import freemarker.template.Configuration;
+import freemarker.template.Version;
+
 public final class TestUtil {
     
     private TestUtil() {
@@ -112,4 +115,12 @@ public final class TestUtil {
         return ftl.substring(0, commentFirstIdx) + ftl.substring(commentLastIdx + afterCommentNLChars + 1);
     }
 
+    /**
+     * Returns the closes FreeMarker version number that doesn't exit yet (so it's illegal).
+     */
+    public static Version getClosestFutureVersion() {
+        Version v = Configuration.getVersion();
+        return new Version(v.getMajor(), v.getMinor(), v.getMicro() + 1);
+    }
+
 }