getdownDistDir = distDir;
}
- private static String getGetdownAppbase()
+ public static String getGetdownAppbase()
{
setGetdownAppbase();
return getdownAppbase;
}
- private static String getAppbaseBuildProperties()
+ public static String getAppbaseBuildProperties()
{
String appbase = getGetdownAppbase();
return appbase + "/" + getdownDistDir + "/build_properties";
*/
package jalview.bin;
+import static org.testng.Assert.assertNotEquals;
+import static org.testng.Assert.assertTrue;
import static org.testng.AssertJUnit.assertEquals;
-
-import jalview.gui.JvOptionPane;
+import static org.testng.AssertJUnit.assertNotNull;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import jalview.gui.JvOptionPane;
+
public class CacheTest
{
assertEquals(formattedDate, formattedDate2);
// currently using Locale.UK to format dates:
- assertEquals(
- formattedDate2,
- SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.MEDIUM,
- SimpleDateFormat.MEDIUM, Locale.UK).format(now));
+ assertEquals(formattedDate2,
+ SimpleDateFormat
+ .getDateTimeInstance(SimpleDateFormat.MEDIUM,
+ SimpleDateFormat.MEDIUM, Locale.UK)
+ .format(now));
+ }
+
+ @Test(groups = "Functional")
+ public void testVersionChecker()
+ {
+ Cache.loadProperties("test/jalview/bin/testProps.jvprops");
+ try
+ {
+ // 10s sleep to allow VersionChecker thread to run
+ Thread.sleep(10000);
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ String latestVersion = Cache.getProperty("LATEST_VERSION");
+ assertNotNull(latestVersion);
+ assertNotEquals(latestVersion, "test");
+ assertTrue(latestVersion.startsWith("2."));
}
}