Commit c71c9b26 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

and now it is also possible to have HC -s with different time precisions...


and now it is also possible to have HC -s with different time precisions connected at the same time.
Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent e8b8bd29
...@@ -40,7 +40,6 @@ import org.eclipse.titan.executor.executors.BaseExecutor; ...@@ -40,7 +40,6 @@ import org.eclipse.titan.executor.executors.BaseExecutor;
import org.eclipse.titan.executor.executors.ExecuteDialog; import org.eclipse.titan.executor.executors.ExecuteDialog;
import org.eclipse.titan.executor.executors.ExecuteDialog.ExecutableType; import org.eclipse.titan.executor.executors.ExecuteDialog.ExecutableType;
import org.eclipse.titan.executor.executors.SeverityResolver; import org.eclipse.titan.executor.executors.SeverityResolver;
import org.eclipse.titan.executor.jni.Timeval;
import org.eclipse.titan.executor.views.executormonitor.ComponentElement; import org.eclipse.titan.executor.views.executormonitor.ComponentElement;
import org.eclipse.titan.executor.views.executormonitor.ExecutorMonitorView; import org.eclipse.titan.executor.views.executormonitor.ExecutorMonitorView;
import org.eclipse.titan.executor.views.executormonitor.ExecutorStorage; import org.eclipse.titan.executor.views.executormonitor.ExecutorStorage;
...@@ -54,6 +53,7 @@ import org.eclipse.titan.executor.views.testexecution.ExecutedTestcase; ...@@ -54,6 +53,7 @@ import org.eclipse.titan.executor.views.testexecution.ExecutedTestcase;
import org.eclipse.titan.executor.views.testexecution.TestExecutionView; import org.eclipse.titan.executor.views.testexecution.TestExecutionView;
import org.eclipse.titan.runtime.core.TitanVerdictType; import org.eclipse.titan.runtime.core.TitanVerdictType;
import org.eclipse.titan.runtime.core.mctr.MainController; import org.eclipse.titan.runtime.core.mctr.MainController;
import org.eclipse.titan.runtime.core.mctr.Timeval;
import org.eclipse.titan.runtime.core.mctr.UserInterface; import org.eclipse.titan.runtime.core.mctr.UserInterface;
/** /**
...@@ -115,8 +115,8 @@ public class NativeJavaExecutor extends BaseExecutor { ...@@ -115,8 +115,8 @@ public class NativeJavaExecutor extends BaseExecutor {
} }
@Override @Override
public void notify(final long timestamp, final String source, final int severity, final String message) { public void notify(final Timeval timestamp, final String source, final int severity, final String message) {
callback.notifyCallback(new Timeval(timestamp / 1000, timestamp % 1000), source, severity, message); callback.notifyCallback(timestamp, source, severity, message);
} }
@Override @Override
......
...@@ -46,7 +46,6 @@ import org.eclipse.titan.executor.jni.IJNICallback; ...@@ -46,7 +46,6 @@ import org.eclipse.titan.executor.jni.IJNICallback;
import org.eclipse.titan.executor.jni.JNIMiddleWare; import org.eclipse.titan.executor.jni.JNIMiddleWare;
import org.eclipse.titan.executor.jni.McStateEnum; import org.eclipse.titan.executor.jni.McStateEnum;
import org.eclipse.titan.executor.jni.QualifiedName; import org.eclipse.titan.executor.jni.QualifiedName;
import org.eclipse.titan.executor.jni.Timeval;
import org.eclipse.titan.executor.jni.VerdictTypeEnum; import org.eclipse.titan.executor.jni.VerdictTypeEnum;
import org.eclipse.titan.executor.views.executormonitor.ComponentElement; import org.eclipse.titan.executor.views.executormonitor.ComponentElement;
import org.eclipse.titan.executor.views.executormonitor.ExecutorStorage; import org.eclipse.titan.executor.views.executormonitor.ExecutorStorage;
...@@ -58,6 +57,7 @@ import org.eclipse.titan.executor.views.executormonitor.MainControllerElement; ...@@ -58,6 +57,7 @@ import org.eclipse.titan.executor.views.executormonitor.MainControllerElement;
import org.eclipse.titan.executor.views.notification.Notification; import org.eclipse.titan.executor.views.notification.Notification;
import org.eclipse.titan.executor.views.testexecution.ExecutedTestcase; import org.eclipse.titan.executor.views.testexecution.ExecutedTestcase;
import org.eclipse.titan.executor.views.testexecution.TestExecutionView; import org.eclipse.titan.executor.views.testexecution.TestExecutionView;
import org.eclipse.titan.runtime.core.mctr.Timeval;
/** /**
* This executor handles the execution of tests compiled in a parallel mode, via directly connecting to the MainController written in C++. * This executor handles the execution of tests compiled in a parallel mode, via directly connecting to the MainController written in C++.
......
...@@ -9,6 +9,8 @@ package org.eclipse.titan.executor.jni; ...@@ -9,6 +9,8 @@ package org.eclipse.titan.executor.jni;
import java.util.ArrayList; import java.util.ArrayList;
import org.eclipse.titan.runtime.core.mctr.Timeval;
/** /**
* The callback interface that is used by the MainController to call back to the executor. * The callback interface that is used by the MainController to call back to the executor.
* *
......
...@@ -12,6 +12,7 @@ import java.util.List; ...@@ -12,6 +12,7 @@ import java.util.List;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.titan.executor.TITANConsole; import org.eclipse.titan.executor.TITANConsole;
import org.eclipse.titan.runtime.core.mctr.Timeval;
/** /**
* The middleware that connects the JNI executor and the MainController. * The middleware that connects the JNI executor and the MainController.
......
...@@ -166,7 +166,7 @@ public class Cli extends UserInterface { ...@@ -166,7 +166,7 @@ public class Cli extends UserInterface {
} }
@Override @Override
public void notify(final long timestamp, final String source, final int severity, final String message) { public void notify(final Timeval timestamp, final String source, final int severity, final String message) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
......
...@@ -624,10 +624,10 @@ public class MainController { ...@@ -624,10 +624,10 @@ public class MainController {
private void notify(final String message) { private void notify(final String message) {
final long timestamp = System.currentTimeMillis(); final long timestamp = System.currentTimeMillis();
notify(timestamp, mc_hostname, TTCN_Logger.Severity.EXECUTOR_UNQUALIFIED.ordinal(), message); notify(new Timeval(timestamp / 1000, timestamp % 1000), mc_hostname, TTCN_Logger.Severity.EXECUTOR_UNQUALIFIED.ordinal(), message);
} }
private void notify(final long timestamp, final String source, final int severity, final String message) { private void notify(final Timeval timestamp, final String source, final int severity, final String message) {
unlock(); unlock();
ui.notify(timestamp, source, severity, message); ui.notify(timestamp, source, severity, message);
lock(); lock();
...@@ -5827,7 +5827,7 @@ public class MainController { ...@@ -5827,7 +5827,7 @@ public class MainController {
final int length = text_buf.pull_int().get_int(); final int length = text_buf.pull_int().get_int();
final byte messageBytes[] = new byte[length]; final byte messageBytes[] = new byte[length];
text_buf.pull_raw(length, messageBytes); text_buf.pull_raw(length, messageBytes);
notify(seconds * 1000 + microseconds / 1000, source, severity, new String(messageBytes)); notify(new Timeval(seconds, microseconds), source, severity, new String(messageBytes));
} }
private void process_log(final Host hc) { private void process_log(final Host hc) {
...@@ -5842,7 +5842,7 @@ public class MainController { ...@@ -5842,7 +5842,7 @@ public class MainController {
final int length = text_buf.pull_int().get_int(); final int length = text_buf.pull_int().get_int();
final byte messageBytes[] = new byte[length]; final byte messageBytes[] = new byte[length];
text_buf.pull_raw(length, messageBytes); text_buf.pull_raw(length, messageBytes);
notify(seconds * 1000 + microseconds / 1000, hc.log_source, severity, new String(messageBytes)); notify(new Timeval(seconds, microseconds), hc.log_source, severity, new String(messageBytes));
} }
private void process_log(final ComponentStruct tc) { private void process_log(final ComponentStruct tc) {
...@@ -5856,7 +5856,7 @@ public class MainController { ...@@ -5856,7 +5856,7 @@ public class MainController {
final int length = text_buf.pull_int().get_int(); final int length = text_buf.pull_int().get_int();
final byte messageBytes[] = new byte[length]; final byte messageBytes[] = new byte[length];
text_buf.pull_raw(length, messageBytes); text_buf.pull_raw(length, messageBytes);
notify(seconds * 1000 + microseconds / 1000, tc.log_source, severity, new String(messageBytes)); notify(new Timeval(seconds, microseconds), tc.log_source, severity, new String(messageBytes));
} }
public void execute_testcase(final String moduleName, final String testcaseName) { public void execute_testcase(final String moduleName, final String testcaseName) {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
******************************************************************************/ ******************************************************************************/
package org.eclipse.titan.executor.jni; package org.eclipse.titan.runtime.core.mctr;
/** /**
* Data structure for representing a time value. * Data structure for representing a time value.
......
...@@ -41,9 +41,8 @@ public abstract class UserInterface { ...@@ -41,9 +41,8 @@ public abstract class UserInterface {
/** /**
* General notification from MC. * General notification from MC.
* timestamp is in miliseconds.
*/ */
public abstract void notify(final long timestamp, final String source, final int severity, final String message); public abstract void notify(final Timeval timestamp, final String source, final int severity, final String message);
public abstract void executeBatchFile(final String filename); public abstract void executeBatchFile(final String filename);
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment