use of alma.acs.logging.table.reduction.SourceAntennaRule in project ACS by ACS-Community.
the class AntennaSourceReductionTest method testIsReducible.
/**
* Check {@link AntennaRule#isReducible()}
* @throws Exception
*/
public void testIsReducible() throws Exception {
String msg = "In position";
// Reducible
ILogEntry log1 = createLog(msg, "CONTROL/DA41/WVR");
SourceAntennaRule sar = new SourceAntennaRule(log1);
if (!sar.isReducible()) {
System.out.println("Error: log1 should be reducible!!!");
}
// NOT reducible!
ILogEntry log2 = createLog(msg, "maci");
sar = new SourceAntennaRule(log2);
if (sar.isReducible()) {
System.out.println("Error: log2 should not be reducible!!!");
}
// NOT reducible!
ILogEntry log3 = createLog(msg, "");
sar = new SourceAntennaRule(log3);
if (sar.isReducible()) {
System.out.println("Error: log3 should not be reducible!!!");
}
// Reducible!
ILogEntry log4 = createLog(msg, "PM02");
sar = new SourceAntennaRule(log4);
if (!sar.isReducible()) {
System.out.println("Error: log4 should be reducible!!!");
}
}
use of alma.acs.logging.table.reduction.SourceAntennaRule in project ACS by ACS-Community.
the class AntennaSourceReductionTest method testRedction.
/**
* Test if the reduction works submitting several logs
*
* @throws Exception
*/
public void testRedction() throws Exception {
String msg = "In position";
// Reducible
ILogEntry log1 = createLog(msg, "CONTROL/DA41/WVR");
SourceAntennaRule sar = new SourceAntennaRule(log1);
ILogEntry log2 = createLog(msg, "CONTROL/DV13/WVR");
sar.applyRule(log2);
if (!sar.isReducingLogs()) {
System.out.println("isReducing should return TRUE at this point!");
}
ILogEntry log3 = createLog(msg, "CONTROL/PM02/WVR");
sar.applyRule(log3);
ILogEntry log4 = createLog(msg, "CONTROL/CM04/WVR");
sar.applyRule(log4);
// This log is not reduced even if the source contains an antenna name
ILogEntry log5 = createLog(msg, "CONTROL/CM03/ACD");
sar.applyRule(log5);
// This log is not reduced because the message is different
ILogEntry log6 = createLog("Different log message", "CONTROL/CM03/WVR");
sar.applyRule(log6);
ILogEntry log7 = createLog(msg, "CONTROL/DA44/WVR");
sar.applyRule(log7);
System.out.println("Reduced log: " + sar.getReducedLog().toString());
}
Aggregations