DebugRotationTest.java revision cc87cf22700a4a41bf0eba0d9579db53e7cedd94
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2016 ForgeRock AS.
*/
public class DebugRotationTest extends DebugTestTemplate {
@Test
public void sizeRotation() throws Exception {
long minimumBytesPrinted = 0l;
while (minimumBytesPrinted < minimumBytesRequestedForTest) {
}
}
double espilon = 0.1;
}
}
}
public void rotationInNormalDate() throws Exception {
System.out.println("Test rotation for date : '" + dateFormat.format(calRandomDate.getTime()) + "'");
}
@Test
public void rotationInDSTDateMarch() throws Exception {
}
@Test
public void rotationInDSTDateOctober() throws Exception {
System.out.println("Test rotation for date : '" + dateFormat.format(calDSTOctober.getTime()) + "'");
}
//initialize a scenario
//Accelerate the test timeservice
// Simulate 1 hours of logs
//In order to have an effective and short in time test, we accelerate the time
// check debugFiles.properties to see the mapping
// We will print on logs from threads, for testing the synchronized
PrintLogRunnable printLogRunnableTest1 = new PrintLogRunnable(debugTest1MergeToDebugMerge, fakeInitTime,
PrintLogRunnable printLogRunnableTest2 = new PrintLogRunnable(debugTest2MergeToDebugMerge, fakeInitTime,
PrintLogRunnable printLogRunnableTest3 = new PrintLogRunnable(debugTest3MergeToDebugMerge, fakeInitTime,
}
//The first writing initialize the log file. So we test that a swift of 1 minute doesn't
//create a new file at the end
//Start threads
}
//Wait threads
}
//Check if any thread had a exception
}
//Check files creation
int currentPeriod = -1;
failAndPrintFolderStatusReport("A log rotation file is created before the log rotation ended. " +
}
currentPeriod = 0;
}
}
}
/**
* Runnable for printing in a log file
*/
public static class PrintLogRunnable implements Runnable {
private long initTime;
private int testDuration;
private TimeService accelerateClock;
//Date formats for helping the debugging
private SimpleDateFormat dateFormatWithMs;
public PrintLogRunnable(IDebug debug, long initTime, int testDurationMS, TimeService accelerateClock) {
this.testDuration = testDurationMS;
this.accelerateClock = accelerateClock;
}
public void run() {
try {
}
} catch (Exception e) {
this.ex = e;
}
}
}
}