Browse Source

Fixed CvalChecker invalid version message (#17879)

Change-Id: I2eed6d907be299ebca3e69d7f492aff6f1244fe4
tags/7.5.0.rc1
Teppo Kurki 9 years ago
parent
commit
3ecc805eff

+ 3
- 1
client-compiler/src/com/vaadin/tools/CvalChecker.java View File

String msg = ""; String msg = "";
int majorVers = computeMajorVersion(version); 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"); msg = info.getMessage().replace("\\n", "\n");
} else if (info != null && info.isLicenseExpired()) { } else if (info != null && info.isLicenseExpired()) {
String type = "evaluation".equals(info.getType()) ? "Evaluation license" String type = "evaluation".equals(info.getType()) ? "Evaluation license"

+ 2
- 0
client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java View File

import static com.vaadin.tools.CvalChecker.parseJson; import static com.vaadin.tools.CvalChecker.parseJson;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;


import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
Assert.fail(); Assert.fail();
} catch (InvalidCvalException expected) { } catch (InvalidCvalException expected) {
assertEquals(productNameCval, expected.name); assertEquals(productNameCval, expected.name);
assertTrue(expected.getMessage().contains("is not valid"));
} }
Assert.assertFalse(cacheExists(productNameCval)); Assert.assertFalse(cacheExists(productNameCval));



Loading…
Cancel
Save