From 3ecc805eff05fd8ba905890d0c90c07421d2172b Mon Sep 17 00:00:00 2001 From: Teppo Kurki Date: Thu, 4 Jun 2015 22:02:41 +0300 Subject: [PATCH] Fixed CvalChecker invalid version message (#17879) Change-Id: I2eed6d907be299ebca3e69d7f492aff6f1244fe4 --- client-compiler/src/com/vaadin/tools/CvalChecker.java | 4 +++- .../tests/src/com/vaadin/tools/CvalCheckerTest.java | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client-compiler/src/com/vaadin/tools/CvalChecker.java b/client-compiler/src/com/vaadin/tools/CvalChecker.java index 645667be94..9217781695 100644 --- a/client-compiler/src/com/vaadin/tools/CvalChecker.java +++ b/client-compiler/src/com/vaadin/tools/CvalChecker.java @@ -243,7 +243,9 @@ public final class CvalChecker { String msg = ""; int majorVers = computeMajorVersion(version); - if (info != null && info.getMessage() != null) { + if (info != null && !info.isValidVersion(majorVers)) { + msg = getErrorMessage("invalid", title, majorVers); + } else if (info != null && info.getMessage() != null) { msg = info.getMessage().replace("\\n", "\n"); } else if (info != null && info.isLicenseExpired()) { String type = "evaluation".equals(info.getType()) ? "Evaluation license" diff --git a/client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java b/client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java index fb4799ae12..6da455b2f6 100644 --- a/client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java +++ b/client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java @@ -26,6 +26,7 @@ import static com.vaadin.tools.CvalChecker.deleteCache; import static com.vaadin.tools.CvalChecker.parseJson; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import java.io.File; @@ -198,6 +199,7 @@ public class CvalCheckerTest { Assert.fail(); } catch (InvalidCvalException expected) { assertEquals(productNameCval, expected.name); + assertTrue(expected.getMessage().contains("is not valid")); } Assert.assertFalse(cacheExists(productNameCval)); -- 2.39.5