Commit 67f98826 authored by Adam Knapp's avatar Adam Knapp
Browse files

Removing product numbering



Change-Id: I09cdd0227dff0de84d841deda5e323741dac0691
Signed-off-by: default avatarAdam Knapp <adam.knapp@sigmatechnology.se>
parent 80f0836e
......@@ -8,12 +8,14 @@
package org.eclipse.titan.common.product;
import org.eclipse.titan.common.utils.ObjectUtils;
import org.eclipse.titan.common.utils.StringUtils;
/**
* For information on the product identity system please refer to 0012-073 Uen or to 1092-212 Uen
* */
public final class ProductIdentity implements Comparable<ProductIdentity> {
public static final String TITAN_PRODUCT_NUMBER = "CAX 105 7730";
public static final String TITAN_PRODUCT_NUMBER = "";
public static final String TITAN_PRODUCT_NUMBER_CAX = "CAX 105 7730";
public static final String TITAN_PRODUCT_NUMBER_CRL = "CRL 113 200";
public static final int TITAN_VERSION_MAJOR = 7;
public static final int TITAN_VERSION_MINOR = 2;
......@@ -145,7 +147,7 @@ public final class ProductIdentity implements Comparable<ProductIdentity> {
}
final StringBuilder builder = new StringBuilder(20);
if (productNumber != null) {
if (!StringUtils.isNullOrEmpty(productNumber)) {
if (productNumber.contains("CRL") || productNumber.contains("crl")) {
builder.append(productNumber);
if (productNumberSuffix == 0 || (productNumberSuffix == 1 && revisionDigit < 9)) {
......@@ -162,14 +164,17 @@ public final class ProductIdentity implements Comparable<ProductIdentity> {
builder.append(productNumber);
builder.append(' ');
}
}
builder.append('R').append(revisionDigit).append((char) (revisionLetter + 'A'));
if (verificationStep != 0) {
if (verificationStep < 10) {
builder.append('0');
builder.append('R').append(revisionDigit).append((char) (revisionLetter + 'A'));
if (verificationStep != 0) {
if (verificationStep < 10) {
builder.append('0');
}
builder.append(verificationStep);
}
builder.append(verificationStep);
}
if (productNumber != null && productNumber.isEmpty()) {
builder.append(productNumberSuffix).append('.').append(revisionDigit).append('.')
.append(revisionLetter);
}
return builder.toString();
......
......@@ -3,4 +3,4 @@
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=7/CAX 105 7730 R2A
0=7.2.1
......@@ -3,4 +3,4 @@
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=7/CAX 105 7730 R2A
0=7.2.1
......@@ -67,6 +67,13 @@ public final class CompilerVersionInformationCollector {
+ "Compiled with: ([^\\n]+)\\n?\\n"
+ "(.+)", Pattern.MULTILINE | Pattern.DOTALL);
private static final Pattern BASE_TITAN_HEADER_PATTERN4 = Pattern.compile(
"TTCN\\-3 and ASN\\.1 Compiler for the TTCN\\-3 Test Executor\\n"
+ "Version: (.+)\\n"
+ "Build date: (.+)\\n"
+ "Compiled with: ([^\\n]+)\\n?\\n"
+ "(.+)", Pattern.MULTILINE | Pattern.DOTALL);
private static final class CompilerInfoStruct {
private String compilerProductNumber;
private String buildDate;
......@@ -293,6 +300,17 @@ public final class CompilerVersionInformationCollector {
return temp;
}
final Matcher baseTITANErrorMatcher4 = BASE_TITAN_HEADER_PATTERN4.matcher(readLines.toString());
if (baseTITANErrorMatcher3.matches()) {
final CompilerInfoStruct temp = new CompilerInfoStruct();
temp.compilerProductNumber = "";
temp.compilerVersion = baseTITANErrorMatcher4.group(1);
temp.buildDate = baseTITANErrorMatcher4.group(2);
temp.cCompilerVersion = baseTITANErrorMatcher4.group(3);
return temp;
}
return null;
}
......
......@@ -28,11 +28,15 @@ public final class ProductIdentityHelper {
private static final Matcher PRODUCT_PATTERN3_MATCHER = PRODUCT_PATTERN3.matcher("");
private static final Pattern PRODUCT_PATTERN4 = Pattern.compile("^(R.+)$");
private static final Matcher PRODUCT_PATTERN4_MATCHER = PRODUCT_PATTERN4.matcher("");
private static final Pattern PRODUCT_PATTERN5 = Pattern.compile("^([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})");
private static final Matcher PRODUCT_PATTERN5_MATCHER = PRODUCT_PATTERN5.matcher("");
private static final Pattern RNUMBER_PATTERN1 = Pattern.compile("^R([0-9]+)([A-Z]+)([0-9]+)$");
private static final Matcher RNUMBER_PATTERN1_MATCHER = RNUMBER_PATTERN1.matcher("");
private static final Pattern RNUMBER_PATTERN2 = Pattern.compile("^R([0-9]+)([A-Z]+)$");
private static final Matcher RNUMBER_PATTERN2_MATCHER = RNUMBER_PATTERN2.matcher("");
private static final Pattern RNUMBER_PATTERN3 = Pattern.compile("^([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})");
private static final Matcher RNUMBER_PATTERN3_MATCHER = RNUMBER_PATTERN3.matcher("");
private ProductIdentityHelper() {
}
......@@ -73,9 +77,13 @@ public final class ProductIdentityHelper {
rNumber = PRODUCT_PATTERN3_MATCHER.group(2);
} else if (PRODUCT_PATTERN4_MATCHER.reset(versionString).matches()) {
rNumber = PRODUCT_PATTERN4_MATCHER.group(1);
} else if (PRODUCT_PATTERN5_MATCHER.reset(versionString).matches()) {
productNumber = "";
rNumber = PRODUCT_PATTERN2_MATCHER.group(1);
} else {
if (location != null) {
location.reportSemanticError("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A");
location.reportSemanticError("Wrong format for product version information: "
+ "The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A or 7.2.1");
}
return null;
}
......@@ -90,9 +98,13 @@ public final class ProductIdentityHelper {
} else if (RNUMBER_PATTERN2_MATCHER.reset(rNumber).matches()) {
revisionDigit = RNUMBER_PATTERN2_MATCHER.group(1);
revisionLetter = RNUMBER_PATTERN2_MATCHER.group(2);
} else if (RNUMBER_PATTERN3_MATCHER.reset(rNumber).matches()) {
productNumberSuffix = RNUMBER_PATTERN3_MATCHER.group(1);
revisionDigit = RNUMBER_PATTERN3_MATCHER.group(2);
revisionLetter = RNUMBER_PATTERN3_MATCHER.group(3);
} else {
if (location != null) {
location.reportSemanticError("Wrong format for version information: The accepted formats resemble R2D02 and R2D");
location.reportSemanticError("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1");
}
return null;
}
......@@ -182,8 +194,7 @@ public final class ProductIdentityHelper {
}
if ("CNL 113 300".equals(productNumber) && majorVersion == 0) {
// in previous TITAN versions this information was not
// stored.
// in previous TITAN versions this information was not stored.
majorVersion = 1;
}
......
......@@ -3,4 +3,4 @@
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=7/CAX 105 7730 R2A
0=7.2.1
......@@ -3,4 +3,4 @@
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=7/CAX 105 7730 R2A
0=7.2.1
......@@ -3,4 +3,4 @@
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=7/CAX 105 7730 R2A
0=7.2.1
......@@ -3,4 +3,4 @@
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=7/CAX 105 7730 R2A
0=7.2.1
......@@ -369,11 +369,11 @@ public class AST_tests {
}
markersToCheck.add(new MarkerToCheck("Version template must be exactly <RnXnn>", --lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("The minor version number 2,147,483,648 is unexpectedly large, right now we can not handle such large numbers", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
......@@ -382,27 +382,27 @@ public class AST_tests {
for (i = 0; i < 5; i++) {
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", lineNum++, IMarker.SEVERITY_ERROR));
}
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A", --lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A or 7.2.1", --lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 1;
for (i = 0; i < 6; i++) {
markersToCheck.add(new MarkerToCheck("There is no module with name `nonExi'", lineNum++, IMarker.SEVERITY_ERROR));
}
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A", --lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A or 7.2.1", --lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("There is no module with name `nonExi'", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 4;
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 1;
for (i = 0; i < 2; i++) {
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", lineNum++, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", lineNum++, IMarker.SEVERITY_ERROR));
}
markersToCheck.add(new MarkerToCheck("The minor version number 2,147,483,648 is unexpectedly large, right now we can not handle such large numbers", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("The build version number 2,147,483,648 is unexpectedly large, right now we can not handle such large numbers", ++lineNum, IMarker.SEVERITY_ERROR));
lineNum += 5;
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Field qualifiers are only allowed for record, set and union types", ++lineNum, IMarker.SEVERITY_ERROR));
 
return markersToCheck;
......@@ -294,21 +294,21 @@ public class Semantic_errors_tests {
}
markersToCheck.add(new MarkerToCheck("Version template must be exactly <RnXnn>", --lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("The minor version number 2,147,483,648 is unexpectedly large, right now we can not handle such large numbers", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Duplicate version attribute", ++lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("The build version number 2,147,483,648 is unexpectedly large, right now we can not handle such large numbers", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("There is no module with name `nonExi'", ++lineNum, IMarker.SEVERITY_ERROR));
lineNum += 4;
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for product version information: The accepted formats resemble CRL 113 200/1 R9A or 7/CAX 105 7730 R2A or 7.2.1", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 1;
for (i = 0; i < 2; i++) {
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 and R2D", lineNum++, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("Wrong format for version information: The accepted formats resemble R2D02 or R2D or 7.2.1", lineNum++, IMarker.SEVERITY_ERROR));
}
markersToCheck.add(new MarkerToCheck("The minor version number 2,147,483,648 is unexpectedly large, right now we can not handle such large numbers", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("The build version number 2,147,483,648 is unexpectedly large, right now we can not handle such large numbers", ++lineNum, IMarker.SEVERITY_ERROR));
......
......@@ -41,7 +41,7 @@ public final class TTCN_Runtime {
public static final int TTCN3_BUILDNUMBER = 0;
public static final String VERSION_STRING = "7.2.1";
public static final String PRODUCT_NUMBER = "7/CAX 105 7730 R2B";
public static final String PRODUCT_NUMBER = VERSION_STRING;
public enum executorStateEnum {
UNDEFINED_STATE,
......
......@@ -3,4 +3,4 @@
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=7/CAX 105 7730 R2A
0=7.2.1
......@@ -3,4 +3,4 @@
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=7/CAX 105 7730 R2A
0=7.2.1
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