import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
-import org.openecomp.xacml.parser.LogEntryObject;
-import org.openecomp.xacml.parser.ParseLog;
+import org.openecomp.policy.common.im.AdministrativeStateException;
+import org.openecomp.policy.common.im.IntegrityMonitor;
+import org.openecomp.policy.common.im.StandbyStatusException;
System.setProperty("com.sun.management.jmxremote.port", "9998");
im = Mockito.mock(IntegrityMonitor.class);
System.setProperty("com.sun.management.jmxremote.port", "9998");
im = Mockito.mock(IntegrityMonitor.class);
try {
Mockito.doNothing().when(im).startTransaction();
} catch (StandbyStatusException | AdministrativeStateException e) {
try {
Mockito.doNothing().when(im).startTransaction();
} catch (StandbyStatusException | AdministrativeStateException e) {
config.put("LOGPATH", "C:\\Workspaces\\HealthCheck\\pap-rest.log");
config.put("PARSERLOGPATH", "IntegrityMonitor.log");
config.put("LOGPATH", "C:\\Workspaces\\HealthCheck\\pap-rest.log");
config.put("PARSERLOGPATH", "IntegrityMonitor.log");
public void testParseDate(){
String line = "2016-02-23 08:07:30";
Date returnValue = ParseLog.parseDate(line, "yyyy-MM-dd HH:mm:ss", false);
public void testParseDate(){
String line = "2016-02-23 08:07:30";
Date returnValue = ParseLog.parseDate(line, "yyyy-MM-dd HH:mm:ss", false);
-
- assertEquals("Tue Feb 23 08:07:30 CST 2016", returnValue.toString());
+ line = returnValue.toString().substring(0, returnValue.toString().lastIndexOf(":30")+3);
+ assertEquals("Tue Feb 23 08:07:30", line);
LogEntryObject retrunObject = ParseLog.pullOutLogValues("", "Console");
assertEquals(null, retrunObject);
}
@Test
public void testLogEntryObject(){
LogEntryObject retrunObject = ParseLog.pullOutLogValues("", "Console");
assertEquals(null, retrunObject);
}
@Test
public void testLogEntryObject(){
Mockito.doNothing().when(im).endTransaction();
ParseLog.process(line, "pap");
}
Mockito.doNothing().when(im).endTransaction();
ParseLog.process(line, "pap");
}