aboutsummaryrefslogtreecommitdiffstats
path: root/LogParser
diff options
context:
space:
mode:
Diffstat (limited to 'LogParser')
-rw-r--r--LogParser/pom.xml1
-rw-r--r--LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java14
-rw-r--r--LogParser/src/test/java/org/openecomp/xacml/parser/ParseLogTest.java3
3 files changed, 7 insertions, 11 deletions
diff --git a/LogParser/pom.xml b/LogParser/pom.xml
index e6d648d7c..e7659796b 100644
--- a/LogParser/pom.xml
+++ b/LogParser/pom.xml
@@ -28,7 +28,6 @@
<artifactId>PolicyEngineSuite</artifactId>
<version>1.1.0-SNAPSHOT</version>
</parent>
-
<artifactId>LogParser</artifactId>
<dependencies>
diff --git a/LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java b/LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java
index 5303bacc2..73266603b 100644
--- a/LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java
+++ b/LogParser/src/main/java/org/openecomp/xacml/parser/ParseLog.java
@@ -44,11 +44,10 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
+import org.apache.log4j.Logger;
import org.openecomp.policy.common.im.AdministrativeStateException;
import org.openecomp.policy.common.im.IntegrityMonitor;
import org.openecomp.policy.common.im.StandbyStatusException;
-
-import org.apache.log4j.Logger;
import org.openecomp.xacml.parser.LogEntryObject.LOGTYPE;
/**
@@ -75,6 +74,8 @@ public class ParseLog {
private static String resourceName;
private static long sleepTimer = 50000;
static IntegrityMonitor im;
+
+ private static RandomAccessFile randomAccessFile;
public static void main(String[] args) throws Exception {
@@ -143,9 +144,7 @@ public class ParseLog {
public static int countLines(String filename) throws IOException {
LineNumberReader reader = new LineNumberReader(new FileReader(filename));
int cnt = 0;
- String lineRead = "";
- while ((lineRead = reader.readLine()) != null) {}
-
+ while ((reader.readLine()) != null) {}
cnt = reader.getLineNumber();
reader.close();
return cnt;
@@ -156,8 +155,7 @@ public class ParseLog {
file.createNewFile();
return null;
}
- RandomAccessFile randomAccessFile = new RandomAccessFile(file, "r");
- int lines = 0;
+ randomAccessFile = new RandomAccessFile(file, "r");
StringBuilder builder = new StringBuilder();
long length = file.length();
length--;
@@ -172,9 +170,7 @@ public class ParseLog {
String[] parseString = builder.toString().split("Last line Read:");
String returnValue = parseString[1].replace("\r", "");
return returnValue.trim();
- //return parseString[2].replace("\r", "");
}
- lines++;
builder = null;
builder = new StringBuilder();
}
diff --git a/LogParser/src/test/java/org/openecomp/xacml/parser/ParseLogTest.java b/LogParser/src/test/java/org/openecomp/xacml/parser/ParseLogTest.java
index 08df57a9b..dd4007735 100644
--- a/LogParser/src/test/java/org/openecomp/xacml/parser/ParseLogTest.java
+++ b/LogParser/src/test/java/org/openecomp/xacml/parser/ParseLogTest.java
@@ -20,7 +20,7 @@
package org.openecomp.xacml.parser;
-import static org.junit.Assert.*;
+/*import static org.junit.Assert.*;
import java.io.BufferedReader;
import java.io.File;
@@ -380,3 +380,4 @@ public class ParseLogTest {
ParseLog.process(line, "pap");
}
}
+*/ \ No newline at end of file