]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed CvalChecker invalid version message (#17879)
authorTeppo Kurki <teppo.kurki@vaadin.com>
Thu, 4 Jun 2015 19:02:41 +0000 (22:02 +0300)
committerVaadin Code Review <review@vaadin.com>
Fri, 5 Jun 2015 09:52:33 +0000 (09:52 +0000)
Change-Id: I2eed6d907be299ebca3e69d7f492aff6f1244fe4

client-compiler/src/com/vaadin/tools/CvalChecker.java
client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java

index 645667be947bcc14a0acd07cd41761d7a351e289..9217781695a78fdbdad065671ca962890099a457 100644 (file)
@@ -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"
index fb4799ae12cac0b6d5694f4327bccec07af6dc71..6da455b2f69739d39c44ac5d96d2f6d9fe614a21 100644 (file)
@@ -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));