Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 846 → Rev 847

/trunk/javasrc/adapter/org/etsi/its/adapter/TestAdapter.java
128,9 → 128,9
 
IPort port;
if (tsiPortId.getPortName() == "acPort") {
if (tsiPortId.getPortName().equals("acPort")) {
port = new AdapterControlPort(tsiPortId.getPortName(), compPortId.getComponent().getComponentId());
} else if (tsiPortId.getPortName() == "utPort") {
} else if (tsiPortId.getPortName().equals("utPort")) {
port = new UpperTesterPort(tsiPortId.getPortName(), compPortId.getComponent().getComponentId(), _localPortNumber, _remotePortNumber);
// TODO: To be enhanced
/trunk/javasrc/codec/org/etsi/its/codec/adapter/test/UpperTesterCodecImplTest.java
588,7 → 588,7
assertEquals(TestAdapterMessageTypeEnum.Situation.name(), current.name()); // Skip situation type
byte[] cause = (byte[])tlvs.getNextType().getValue(); // Get cause
byte[] subCause = (byte[])tlvs.getNextType().getValue(); // subCause
if (message != "UtDenmEvent_LinkedCause") {
if (!message.equals("UtDenmEvent_LinkedCause")) {
assertArrayEquals(
String.format("#### Process message value %s - %s", message, TestAdapterMessageTypeEnum.cause.name()),
(byte[])_responses.get(message).get(TestAdapterMessageTypeEnum.cause),
/trunk/javasrc/codec/org/etsi/its/codec/ttcn/LibItsBtp_TypesAndValues/LibItsBtp_TypesAndValuesCodec.java
133,11 → 133,11
}
 
if (
(rv.getType().getName() == TestAdapterMessageTypeEnum.UtBtpInitialize.name()) ||
(rv.getType().getName() == TestAdapterMessageTypeEnum.BtpPacket.name()) ||
(rv.getType().getName() == TestAdapterMessageTypeEnum.BtpAHeader.name()) ||
(rv.getType().getName() == TestAdapterMessageTypeEnum.BtpBHeader.name()) ||
(rv.getType().getName() == TestAdapterMessageTypeEnum.BtpPayload.name())) {
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.UtBtpInitialize.name())) ||
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.BtpPacket.name())) ||
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.BtpAHeader.name())) ||
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.BtpBHeader.name())) ||
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.BtpPayload.name()))) {
// Non protocol message
encodeValueWithTLV(encodingContext, rv);
} else {
219,7 → 219,7
}
 
if (
(uv.getType().getName() == "UtBtpEvent")) {
(uv.getType().getName().equals("UtBtpEvent"))) {
try {
encodingContext.setByte(TestAdapterMessageTypeEnum.convert(uv.getType().getName()));
} catch (IOException e) {
227,8 → 227,8
} // Type
EncodingContext out_uv = new EncodingContext();
if (
(uv.getPresentVariantName() == "btpA") ||
(uv.getPresentVariantName() == "btpB")) {
(uv.getPresentVariantName().equals("btpA")) ||
(uv.getPresentVariantName().equals("btpB"))) {
RecordValue rv = (RecordValue) uv.getVariant(uv.getPresentVariantName());
try {
out_uv.setByte(TestAdapterMessageTypeEnum.valueOf(rv.getType().getName()).convert());
269,9 → 269,9
e.printStackTrace();
}
}
} else if (uv.getPresentVariantName() == "payload") {
} else if (uv.getPresentVariantName().equals("payload")) {
UnionValue tmp = (UnionValue)uv.getVariant(uv.getPresentVariantName());
if (tmp.getPresentVariantName() == "otherPayload") {
if (tmp.getPresentVariantName().equals("otherPayload")) {
OctetstringValue ov = (OctetstringValue) tmp.getVariant(tmp.getPresentVariantName());
try {
out_uv.setByte(TestAdapterMessageTypeEnum.valueOf(tmp.getType().getName()).convert());
465,7 → 465,7
UnionValue unionValue = (UnionValue)decodingHypothesis.newInstance();
String variantName = null;
Value decodedType = null; // Used when the union variant selector is an record type
if (decodingHypothesis.getName() == "BtpHeader") {
if (decodingHypothesis.getName().equals("BtpHeader")) {
/**
* See ETSI TS 102 636-5-1 V1.1.1 - Clause 7.1 Overview
* See ETSI TS 102 636-5-1 V1.1.1 - Table 2: Fields of BTP-A header
479,7 → 479,7
throw new RuntimeException("LibItsBtp_TypesAndValuesCodec.decodeUnionValue: BTP header (type A or B) not set");
}
decodedType = decodeProtocolLayer(unionValue.getVariant(variantName).getType(), decodingContext);
} else if (decodingHypothesis.getName() == "BtpPayload") {
} else if (decodingHypothesis.getName().equals("BtpPayload")) {
TriMessage message = new TriMessageImpl(decodingContext.getRemaindingBytes());
if (_logger.isLoggable(Level.ALL)) ByteHelper.dump("BtpPayload dump: ", message.getEncodedMessage());
// Check with CamPdu
/trunk/javasrc/codec/org/etsi/its/codec/ttcn/LibItsDenm_TypesAndValues/LibItsDenm_TypesAndValuesCodec.java
124,11 → 124,11
} catch (IOException e) {
e.printStackTrace();
}
} else if (rv.getType().getName() == "DenmPdu") {
} else if (rv.getType().getName().equals("DenmPdu")) {
super.encodeRecordValue(encodingContext, rv);
} else {
try {
if (rv.getType().getName() == "_0DecentralizedSituation") { // FIXME Optimise this!!!!
if (rv.getType().getName().equals("_0DecentralizedSituation")) { // FIXME Optimise this!!!!
encodingContext.setByte(TestAdapterMessageTypeEnum.eventCharact.convert());
} else {
encodingContext.setByte(TestAdapterMessageTypeEnum.convert(rv.getType().getName())); // Type
146,11 → 146,11
} else {
EncodingContext out_rv = new EncodingContext();
if (
(rv.getType().getName() == TestAdapterMessageTypeEnum.Situation.name()) ||
(rv.getType().getName() == TestAdapterMessageTypeEnum.EventTimeFrequency.name()) ||
(rv.getType().getName() == "_0DecentralizedSituation") ||
(rv.getType().getName() == TestAdapterMessageTypeEnum.ActionID.name()) ||
(rv.getType().getName() == TestAdapterMessageTypeEnum.UpdateEventExpiry.name())) {
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.Situation.name())) ||
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.EventTimeFrequency.name())) ||
(rv.getType().getName().equals("_0DecentralizedSituation")) ||
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.ActionID.name())) ||
(rv.getType().getName().equals(TestAdapterMessageTypeEnum.UpdateEventExpiry.name()))) {
for (String fieldName : rv.getFieldNames()) {
Value fieldValue = rv.getField(fieldName);
switch(fieldValue.getType().getTypeClass()) {
213,8 → 213,8
e.printStackTrace();
}
} else if (
(uv.getType().getName() == TestAdapterMessageTypeEnum.UtDenmEvent.name()) ||
(uv.getType().getName() == TestAdapterMessageTypeEnum.EventOption.name())) {
(uv.getType().getName().equals(TestAdapterMessageTypeEnum.UtDenmEvent.name())) ||
(uv.getType().getName().equals(TestAdapterMessageTypeEnum.EventOption.name()))) {
_logger.info(String.format("Process union %s - %s", uv.getType().getName(), uv.getPresentVariantName()));
try {
encodingContext.setByte(TestAdapterMessageTypeEnum.convert(uv.getType().getName()));
223,7 → 223,7
} // Type
EncodingContext out_uv = new EncodingContext();
try {
if (uv.getVariant(uv.getPresentVariantName()).getType().getName() == TestAdapterMessageTypeEnum.EventTimeFrequency.name()) {
if (uv.getVariant(uv.getPresentVariantName()).getType().getName().equals(TestAdapterMessageTypeEnum.EventTimeFrequency.name())) {
out_uv.setByte(TestAdapterMessageTypeEnum.EventTimeFrequency.convert()); // Type
} else {
out_uv.setByte(TestAdapterMessageTypeEnum.valueOf(uv.getPresentVariantName()).convert()); // Type
233,8 → 233,8
}
EncodingContext out_uv1 = new EncodingContext();
if (
(uv.getPresentVariantName() == TestAdapterMessageTypeEnum.setTurnAdvice.name()) ||
(uv.getPresentVariantName() == TestAdapterMessageTypeEnum.setPtLineDescription.name())) {
(uv.getPresentVariantName().equals(TestAdapterMessageTypeEnum.setTurnAdvice.name())) ||
(uv.getPresentVariantName().equals(TestAdapterMessageTypeEnum.setPtLineDescription.name()))) {
RecordValue rv = (RecordValue) uv.getVariant(uv.getPresentVariantName());
for (String item : rv.getFieldNames()) {
try {
272,11 → 272,11
}
} // End of 'for' statement
} else if (
(uv.getPresentVariantName() == TestAdapterMessageTypeEnum.setDoorStatus.name()) ||
(uv.getPresentVariantName() == TestAdapterMessageTypeEnum.setExteriorLightsStatus.name())) {
(uv.getPresentVariantName().equals(TestAdapterMessageTypeEnum.setDoorStatus.name())) ||
(uv.getPresentVariantName().equals(TestAdapterMessageTypeEnum.setExteriorLightsStatus.name()))) {
super.encodeBitstringValue(out_uv1, (BitstringValue) uv.getVariant(uv.getPresentVariantName())); // Value
out_uv1.finalizeBitstringValueEncoding();
// } else if (uv.getPresentVariantName() == "eventCancellation") {
// } else if (uv.getPresentVariantName().equals("eventCancellation")) {
// super.encodeIntegerValue(out_uv1, (IntegerValue) uv.getVariant(uv.getPresentVariantName()), _bitpos); // Value
} else {
super.encodeUnionValue(out_uv1, uv);
/trunk/javasrc/codec/org/etsi/its/codec/ttcn/LibItsIpv6OverGeoNetworking_TypesAndValues/LibItsIpv6OverGeoNetworking_TypesAndValuesCodec.java
145,7 → 145,7
return;
}
 
if ((uv.getType().getName() == "AcGn6Primitive") || (uv.getType().getName() == "AcGn6Response")) {
if ((uv.getType().getName().equals("AcGn6Primitive")) || (uv.getType().getName().equals("AcGn6Response"))) {
try { // Type
encodingContext.setByte(TestAdapterMessageTypeEnum.convert(uv.getType().getName()));
} catch (IOException e) {
175,12 → 175,12
}
}
} else if ( // The Codec shall set the length of the payload if present
(uv.getType().getName() == "Ipv6Payload")) {
(uv.getType().getName().equals("Ipv6Payload"))) {
EncodingContext out_uv = new EncodingContext();
super.encodeUnionValue(out_uv, uv);
if (out_uv.size() != 0) {
try {
if (uv.getPresentVariantName() == "routerAdvMsg") { // FIXME Use TestEnum...
if (uv.getPresentVariantName().equals("routerAdvMsg")) { // FIXME Use TestEnum...
// Set IPv6 source address value
OctetstringValue ipv6SrcAddress = TciCDWrapperFactory.getTciCDInstance().getOctetstring();
ipv6SrcAddress.setLength(16);
221,7 → 221,7
out_uv.setBytesAtMarkForIPv6ChecksumCalculation(buffer);
encodingContext.setBytes(out_uv.toByteArray());
encodingContext.setBytesAtMark(ByteHelper.intToByteArray(out_uv.size(), 2)); // 2 byte length
} else if (uv.getPresentVariantName() == "octetstringMsg") { // FIXME Use TestEnum...
} else if (uv.getPresentVariantName().equals("octetstringMsg")) { // FIXME Use TestEnum...
encodingContext.setBytes(out_uv.toByteArray());
encodingContext.setBytesAtMark(ByteHelper.intToByteArray(out_uv.size(), 2)); // 2 byte length
} else {
249,7 → 249,7
_logger.entering("LibItsIpv6OverGeoNetworking_TypesAndValuesCodec", "encodeRecordofValue", rov.getType().getName());
 
// Set type
if ((rov.getType().getName() == "AcGn6InterfaceInfoList")/* || (rov.getType().getName() == "Ipv6AddressList")*/) {
if ((rov.getType().getName().equals("AcGn6InterfaceInfoList"))/* || (rov.getType().getName().equals("Ipv6AddressList"))*/) {
try {
encodingContext.setByte(TestAdapterMessageTypeEnum.convert(rov.getType().getName()));
} catch (IOException e) {
276,7 → 276,7
e.printStackTrace();
}
}
} else if (rov.getType().getName() == "Ipv6AddressList") {
} else if (rov.getType().getName().equals("Ipv6AddressList")) {
// Write number of items
try {
encodingContext.setBytes(ByteHelper.intToByteArray(rov.getLength(), Integer.SIZE / Byte.SIZE));
285,7 → 285,7
}
// Write items
super.encodeRecordofValue(encodingContext, rov);
} else if (rov.getType().getName() == "PrefixInfoList") {
} else if (rov.getType().getName().equals("PrefixInfoList")) {
// Protocol message
super.encodeRecordofValue(encodingContext, rov);
} else {
398,7 → 398,7
// only one variant.
type = TestAdapterMessageTypeEnum.AcGn6InterfaceInfoList;
for (String variantName : unionValue.getVariantNames()) {
if (unionValue.getVariant(variantName).getType().getName() == type.name()) {
if (unionValue.getVariant(variantName).getType().getName().equals(type.name())) {
Value value = decodeTLVLayer(unionValue.getVariant(variantName).getType(), decodingContext);
unionValue.setVariant(variantName, value);
return unionValue;
514,7 → 514,7
RecordValue recordValue = (RecordValue)decodingHypothesis.newInstance();
 
if (decodingHypothesis.getName() == "RtAdvOptions") { // FIXME Use Type..
if (decodingHypothesis.getName().equals("RtAdvOptions")) { // FIXME Use Type..
for (String fieldName : recordValue.getFieldNames()) {
if (decodingContext.isEndOfBufferReached()) {
recordValue.setFieldOmitted(fieldName);
560,11 → 560,11
// } else {
_logger.info(String.format("Process %s - %s - %s", fieldName, fieldValue.getValueEncodingVariant(), decodingContext.toString()));
if (!decodingContext.isEndOfBufferReached()) {
if (fieldName != "extHdrList") { // FIXME Work-around for fieldValue.notPresent() problem
if (!fieldName.equals("extHdrList")) { // FIXME Work-around for fieldValue.notPresent() problem
fieldValue = decodeProtocolLayer(fieldValue.getType(), decodingContext);
if (fieldName == "payloadLength") {
if (fieldName.equals("payloadLength")) {
decodingContext.set_payloadLength((IntegerValue) fieldValue);
} else if (fieldName == "nextHeader") {
} else if (fieldName.equals("nextHeader")) {
decodingContext.set_nextHeader((IntegerValue) fieldValue);
}
recordValue.setField(fieldName, fieldValue);
598,7 → 598,7
UnionValue unionValue = (UnionValue)decodingHypothesis.newInstance();
String variantName = null;
Value decodedType = null; // Used when the union variant selector is an record type
if (decodingHypothesis.getName() == "Ipv6Payload") {
if (decodingHypothesis.getName().equals("Ipv6Payload")) {
boolean extHeaderPresent;
do {
extHeaderPresent = false;
663,7 → 663,7
_logger.entering("LibItsIpv6OverGeoNetworking_TypesAndValuesCodec", "decodeRecordOfValue", decodingHypothesis.getName());
RecordOfValue recordofValue = (RecordOfValue)decodingHypothesis.newInstance();
if (decodingHypothesis.getName() == "PrefixInfoList") { // FIXME Use TypeEnum...
if (decodingHypothesis.getName().equals("PrefixInfoList")) { // FIXME Use TypeEnum...
// Protocol message
while (!decodingContext.isEndOfBufferReached()) { // Decode message
Value fieldValue = decodeProtocolLayer(recordofValue.getElementType(), decodingContext);
/trunk/javasrc/uppertester/org/etsi/its/uppertester/operator/OperatorGUI.java
72,7 → 72,7
@Override
public void actionPerformed(ActionEvent arg0) {
if (arg0.getSource() == passButton) {
if (arg0.getSource().equals(passButton)) {
result = true;
}
setVisible(false);