Search in sources :

Example 1 with SystemInfoPage

use of org.mifos.test.acceptance.framework.admin.SystemInfoPage in project head by mifos.

the class SystemInfoDateTimeTest method verifyDateTimeWithTimeMachineModification.

/**
     * Verify current date and time display and that current
     * date and time can be modified using "time machine"
     * http://mifosforge.jira.com/browse/MIFOSTEST-639
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyDateTimeWithTimeMachineModification() throws Exception {
    DateTime targetTime = new DateTime(2008, 1, 1, 0, 0, 0, 0);
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    TimeMachinePage timeMachinePage = dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    timeMachinePage.verifySuccess(targetTime);
    SystemInfoPage systemInfoPage = adminTestHelper.navigateToSystemInfoPage();
    systemInfoPage.verifyDateTime(targetTime);
}
Also used : TimeMachinePage(org.mifos.test.acceptance.framework.TimeMachinePage) SystemInfoPage(org.mifos.test.acceptance.framework.admin.SystemInfoPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 2 with SystemInfoPage

use of org.mifos.test.acceptance.framework.admin.SystemInfoPage in project head by mifos.

the class SystemInfoDateTimeTest method verifyDatabaseInformationSource.

// TODO - need to support MIFOS_CONF variable
@Test(enabled = false)
public void verifyDatabaseInformationSource() throws Exception {
    SystemInfoPage systemInfoPage = adminTestHelper.navigateToSystemInfoPage();
    String data = systemInfoPage.getDatabaseSource();
    String[] databaseConfigs = data.substring(1, data.length() - 1).split(", ");
    List<File> temp = new ArrayList<File>();
    for (String database : databaseConfigs) {
        File oldFile = new File(database);
        File tempFile = File.createTempFile(oldFile.getName(), ".tmp");
        temp.add(tempFile);
        if (oldFile.exists()) {
            FileUtil.copyFile(oldFile, tempFile);
            oldFile.delete();
        }
    }
    SystemInfoPage systemInfoPage2 = adminTestHelper.navigateToSystemInfoPage();
    systemInfoPage2.verifyDatabaseSource("[]");
    Iterator<File> it = temp.iterator();
    for (String database : databaseConfigs) {
        File newFile = new File(database);
        File tempFile = it.next();
        FileUtil.copyFile(tempFile, newFile);
        tempFile.delete();
    }
}
Also used : ArrayList(java.util.ArrayList) SystemInfoPage(org.mifos.test.acceptance.framework.admin.SystemInfoPage) File(java.io.File) Test(org.testng.annotations.Test)

Example 3 with SystemInfoPage

use of org.mifos.test.acceptance.framework.admin.SystemInfoPage in project head by mifos.

the class SystemInfoDateTimeTest method verifyDateTimeAndTimeZone.

public void verifyDateTimeAndTimeZone() throws UnsupportedEncodingException {
    DateTimeZone dateTimeZone = DateTimeZone.forOffsetHours(1);
    DateTime targetTime = new DateTime(2008, 1, 1, 0, 0, 0, 0);
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime, dateTimeZone);
    SystemInfoPage systemInfoPage = adminTestHelper.navigateToSystemInfoPage();
    systemInfoPage.verifyDateTime(targetTime);
}
Also used : SystemInfoPage(org.mifos.test.acceptance.framework.admin.SystemInfoPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTimeZone(org.joda.time.DateTimeZone) DateTime(org.joda.time.DateTime)

Aggregations

SystemInfoPage (org.mifos.test.acceptance.framework.admin.SystemInfoPage)3 DateTime (org.joda.time.DateTime)2 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 DateTimeZone (org.joda.time.DateTimeZone)1 TimeMachinePage (org.mifos.test.acceptance.framework.TimeMachinePage)1 Test (org.testng.annotations.Test)1