Commit d8f033e6 authored by garciay's avatar garciay
Browse files

Remove duplicate org.etsi.ttcn.common.ByteHelper.java file and replace it by...

Remove duplicate org.etsi.ttcn.common.ByteHelper.java file and replace it by org.etsi.common.ByteHelper.java after merge
parent 739f1ca2
......@@ -84,7 +84,7 @@ public class Management implements IManagementTA, IManagementLayers {
/**
* ITS-AID for Secure other profile
*/
private static final String TsItsAidOther = ((CharstringValue)TERFactory.getInstance().getTaParameter("TsItsAidOther")).getString();
private static final String TsItsAidOther = "141"; // GN-MGMT ((CharstringValue)TERFactory.getInstance().getTaParameter("TsItsAidOther")).getString();
/**
* Link-layer address of Component
......
......@@ -51,7 +51,7 @@ public class PcapMultiplexer implements Runnable {
int r = Pcap.findAllDevs(alldevs, errbuf);
if (r == Pcap.NOT_OK || alldevs.isEmpty()) {
if (r != Pcap.OK || alldevs.isEmpty()) {
TERFactory.getInstance().logError("Can't read list of devices, error is %s" + errbuf.toString());
return;
}
......
......@@ -115,7 +115,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable {
// UDP socket for communication with UT
running = true;
try {
utSocket = new DatagramSocket();
utSocket = new DatagramSocket(/*utPeerPort*/);
utThread = new UdpThread(utSocket);
utThread.start();
} catch (Exception e) {
......@@ -125,8 +125,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable {
@Override
public boolean send(final byte[] message) {
if (_offlineMode.equals("true")) {
/* FIXME: For debug only. Uncomment if no UT*/
if (/*true or */_offlineMode.equals("true")) { /* FIXME: For debug only. Uncomment if no UT - Do not forget the return true below*/
try {
Thread.sleep(500);
} catch (InterruptedException e) {
......@@ -202,7 +201,7 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable {
}
notifyObservers(new PortEvent(rsp, getPortName(), getComponentName()));
}
/* if(true)
/* FIXME: For debug only if(true)
return true;
*/
try {
......@@ -283,8 +282,8 @@ public class UpperTesterPort extends AdapterPort implements IPort, IObservable {
notifyObservers(new PortEvent(payload, getPortName(), getComponentName()));
} // else, packet was dropped
} else { // Notify received payload
setChanged();
notifyObservers(new PortEvent(ByteHelper.extract(packet.getData(), packet.getOffset(), packet.getLength()), getPortName(), getComponentName()));
setChanged();
notifyObservers(new PortEvent(ByteHelper.extract(packet.getData(), packet.getOffset(), packet.getLength()), getPortName(), getComponentName()));
}
} catch (IOException e) {
running = false;
......
......@@ -9,7 +9,7 @@ import java.util.Map;
import java.util.TreeMap;
import org.etsi.adapter.TERFactory;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
public class CodecBuffer {
......
......@@ -82,7 +82,8 @@ public class CodecFactory {
codec = externalCodecs.get(encoding);
if(codec != null) {
//TERFactory.getInstance().logDebug(String.format("%50s", encoding));
//TERFactory.getInstance().logDebug(" ==> " + codec.getClass().getName());
//TERFactory.getInstance().logDebug(" ==> " + codec.getClass().getName());
System.out.println(String.format("%50s", encoding) + " ==> " + codec.getClass().getName());
return codec;
}
return null;
......@@ -91,10 +92,12 @@ public class CodecFactory {
public ICodec getCodec(MainCodec mainCodec, int classType, String encoding, String typeName) {
//TERFactory.getInstance().logDebug(String.format("%50s", typeName + "(" + encoding + ")"));
System.out.println(String.format("%50s", typeName + "(" + encoding + ")"));
Class<? extends ICodec> cls = null;
Class<?>[] ctorParams = {MainCodec.class};
//TERFactory.getInstance().logDebug("getCodec: Search internal codec for " + classType + '/' + encoding + '/' + typeName);
System.out.println("getCodec: Search internal codec for " + classType + '/' + encoding + '/' + typeName);
cls = codecs.get(classType + '/' + encoding + '/' + typeName);
if(cls == null) {
cls = codecs.get(classType + '/' + encoding + '/');
......@@ -105,6 +108,7 @@ public class CodecFactory {
if(cls != null) {
//TERFactory.getInstance().logDebug(" ==> " + cls.getName());
System.out.println(" ==> " + cls.getName());
try {
Constructor<? extends ICodec> ctor = cls.getConstructor(ctorParams);
return ctor.newInstance(mainCodec);
......@@ -114,7 +118,8 @@ public class CodecFactory {
}
}
//TERFactory.getInstance().logDebug(" ==> No codec found !");
//TERFactory.getInstance().logDebug(" ==> No codec found !");
System.out.println(" ==> No codec found !");
return new Dummy(mainCodec);
}
......
......@@ -22,14 +22,10 @@ public class MainCodec extends ICodec {
}
public Value triDecode(TriMessage message, Type decodingHypothesis) {
// TERFactory.getInstance().logDebug("############################################################################################");
return decode(new CodecBuffer(message.getEncodedMessage()), decodingHypothesis);
}
public TriMessage triEncode(Value value) {
// TERFactory.getInstance().logDebug("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
CodecBuffer encoded = encode(value);
encoded.runCallbacks();
return new TriMessageImpl(encoded.getBytes());
......
......@@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.generic;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;
import org.etsi.ttcn.tci.EnumeratedValue;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.codec.ICodec;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
......
......@@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.generic;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.codec.ICodec;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.tci.FloatValue;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;
......
......@@ -12,7 +12,7 @@ import java.util.regex.Pattern;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;
import org.etsi.ttcn.tci.IntegerValue;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.codec.ICodec;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
......
......@@ -7,7 +7,7 @@ import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.codec.IMarkerCallback;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
public class AnyIcmpv6Message extends Record implements IMarkerCallback {
......
......@@ -7,7 +7,7 @@ import org.etsi.ttcn.codec.generic.Record;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
public class Ipv6ExtHdr extends Record {
......
......@@ -5,7 +5,7 @@ import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.codec.IMarkerCallback;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
public class Ipv6Header extends Record implements IMarkerCallback {
......
......@@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.its.adapter;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.generic.Union;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.tci.UnionValue;
public class AcFsapPrimitive extends Union {
......
......@@ -10,7 +10,7 @@ import org.etsi.ttcn.tci.UnionValue;
import org.etsi.ttcn.codec.generic.Union;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
public class AcGnPrimitive extends Union {
......
......@@ -11,7 +11,7 @@ import org.etsi.ttcn.tci.UnionValue;
import org.etsi.ttcn.codec.generic.Union;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
public class AcGnResponse extends Union {
......
......@@ -5,7 +5,7 @@ import org.etsi.ttcn.tci.UnionValue;
import org.etsi.ttcn.codec.generic.Union;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
public class AcGnssPrimitive extends Union {
......
......@@ -3,7 +3,7 @@ package org.etsi.ttcn.codec.its.adapter;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.generic.Union;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.UnionValue;
......
......@@ -10,7 +10,7 @@ import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.codec.IMarkerCallback;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.tci.EnumeratedValue;
import org.etsi.ttcn.tci.IntegerValue;
import org.etsi.ttcn.tci.RecordValue;
......
......@@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.its.geonetworking;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.generic.Record;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.tci.OctetstringValue;
import org.etsi.ttcn.tci.RecordValue;
import org.etsi.ttcn.tci.Type;
......
......@@ -8,7 +8,7 @@ package org.etsi.ttcn.codec.its.geonetworking;
import org.etsi.ttcn.codec.generic.Record;
import org.etsi.ttcn.codec.MainCodec;
import org.etsi.ttcn.codec.CodecBuffer;
import org.etsi.ttcn.common.ByteHelper;
import org.etsi.common.ByteHelper;
import org.etsi.ttcn.tci.RecordValue;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;
......
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