Commit 82afda40 authored by mullers's avatar mullers
Browse files

java files from madalina added

parent 037a5a7e
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -14,8 +14,9 @@ import de.tu_berlin.cs.uebb.ttcn.runtime.OctetString;

public class TraceParser {
	private List<List<TransactionStructure>> traceList = new ArrayList<List<TransactionStructure>>();
	private String startCommandStr = ":  trace";
	private String falseCommandStr = ": trace c";
//	private String startCommandStr = "trace";
//	private String falseCommandStr = "trace c";
	private String matchTrace = ".*:\\s.*trace$";
	private String stopCommandStr = "Those were the most recent";
	
	private String filePath;
@@ -43,7 +44,8 @@ public class TraceParser {
			boolean transactionStarted=false;
			while(null!=(line=br.readLine())) {
//				if (line.startsWith("here the dump starts ---------->")) {
				if (line.startsWith(startCommandStr) && !line.startsWith(falseCommandStr)){
//				if (line.startsWith(startCommandStr) && !line.startsWith(falseCommandStr)){
				if (line.matches(matchTrace)){
					transactionStarted = true;
					transactions = new ArrayList<TransactionStructure>();
					traceList.add(transactions);
+13 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import org.etsi.ttcn.tri.TriSignatureId;
import org.etsi.ttcn.tri.TriStatus;
import org.etsi.ttcn.tri.TriTestCaseId;

import com.testingtech.ttcn.logging.RTLoggingConstants;
import com.testingtech.ttcn.tri.AbstractPlugin;
import com.testingtech.ttcn.tri.ISAPlugin;
import com.testingtech.ttcn.tri.PluginIdentifier;
@@ -75,6 +76,12 @@ public class TracePortPlugin extends AbstractPlugin implements ISAPlugin {
		if ("setTraceFile".equals(signatureName)) {
			TriParameter tracePathParam = parameterList.get(0);
			String  tracePath = getCharstringParameterData(tracePathParam);
			
			//attaching the trace file to the log file
			File traceFile = new File(tracePath);
			RB.getTciTLProvidedV321TT().tliRT("", System.nanoTime(), "", -1, null, RTLoggingConstants.RT_LOG_INFO, "attach;EMBED;FILE=" + traceFile.getAbsolutePath());

			
			boolean result = setTraceFile(tracePath);
			BooleanReturn(componentId, portId, address, signatureId,
					parameterList, result);
@@ -197,6 +204,12 @@ public class TracePortPlugin extends AbstractPlugin implements ISAPlugin {
				payload = new byte[]{};//TODO for empty messages it is null instead of empty array
			}
			RB.getTriCommunicationTE().triEnqueueMsg(tsiPortId, new TriAddressImpl(address.getEncodedMessage()), componentId, new TriMessageImpl(payload));
			// This sleep is added as a workaround so that the exchanged of the messages between the components is shoed synchronized
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				//ignore
			}
		}
		return result;
	}