Skip to content

Commit

Permalink
Merge branch 'AATIM-1339-TMD'
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerDicks committed Nov 3, 2016
2 parents 679c2d2 + 49fe773 commit e777378
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 93 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@

public final class SadlErrorMessages {
/**
* Subject '{0}' did not translate to node
**/
public static final SadlErrorMessage TRANSLATE_TO_NODE = new SadlErrorMessage("translate_to_node");
/**
* A(n) {0} exception occurred while type-checking this expression.
**/
public static final SadlErrorMessage TYPE_CHECK_EXCEPTION = new SadlErrorMessage("type_check_exception");
/**
* {0} is expected to be a(n) {1} but it is not.
**/
public static final SadlErrorMessage IS_NOT_A = new SadlErrorMessage("is_not_a");
/**
* Property '{0}' does not exist in the model.
**/
public static final SadlErrorMessage PROPERTY_NOT_EXIST = new SadlErrorMessage("property_not_exist");
Expand All @@ -43,29 +31,25 @@ public final class SadlErrorMessages {
**/
public static final SadlErrorMessage UNIDENTIFIED = new SadlErrorMessage("unidentified");
/**
* Value of '{0}' is not in range of property '{1}'.
* Must select folder (not file) for running Batch ATPT
**/
public static final SadlErrorMessage NOT_IN_RANGE = new SadlErrorMessage("not_in_range");
public static final SadlErrorMessage ATPT_FOLDER_NOT_SELECT = new SadlErrorMessage("atpt_folder_not_select");
/**
* {0} is a special reserved name. Please choose a different name.
**/
public static final SadlErrorMessage RESERVED_NAME = new SadlErrorMessage("reserved_name");
/**
* Invalid property type: {0}.
**/
public static final SadlErrorMessage INVALID_PROP_TYPE = new SadlErrorMessage("invalid_prop_type");
/**
* Fatal Configuration Error: {0}
* Type comparison not possible
**/
public static final SadlErrorMessage CONFIGURATION_ERROR = new SadlErrorMessage("configuration_error");
public static final SadlErrorMessage TYPE_COMPARISON = new SadlErrorMessage("type_comparison");
/**
* Range failed to resolve to a class or datatype
* ERROR-ATPT: Must select folder for Batch Mode
**/
public static final SadlErrorMessage RANGE_RESOLVE = new SadlErrorMessage("range_resolve");
public static final SadlErrorMessage ATPT_BATCH_ERROR = new SadlErrorMessage("atpt_batch_error");
/**
* Type comparison not possible
* Only files of type {0} are valid for this command
**/
public static final SadlErrorMessage TYPE_COMPARISON = new SadlErrorMessage("type_comparison");
public static final SadlErrorMessage FILE_TYPE_ERROR = new SadlErrorMessage("file_type_error");
/**
* Import of '{0}' is part of a circular set of imports.
**/
Expand All @@ -75,38 +59,22 @@ public final class SadlErrorMessages {
**/
public static final SadlErrorMessage OBJECT_PROP_SYMMETRY = new SadlErrorMessage("object_prop_symmetry");
/**
* {0} should not be null.
* No folder or xml file selected for ATPT
**/
public static final SadlErrorMessage INVALID_NULL = new SadlErrorMessage("invalid_null");
public static final SadlErrorMessage ATPT_NO_XML_SELECTED = new SadlErrorMessage("atpt_no_xml_selected");
/**
* Cannot assign {0}: property '{1}' already has {0} assigned to '{2}'.
**/
public static final SadlErrorMessage CANNOT_ASSIGN_EXISTING = new SadlErrorMessage("cannot_assign_existing");
/**
* A {0} with name '{1}' already exists in the set of {0}s. {0} names must be unique.
**/
public static final SadlErrorMessage UNIQUE_NAME = new SadlErrorMessage("unique_name");
/**
* translate(Name) called with a SadlResource which resolved to null; this needs to be caught in validation
* ERROR-ATPT: Cannot run batch mode using TED files. Update ATPT preferences
**/
public static final SadlErrorMessage TRANSLATE_NAME_SADLRESOURCE = new SadlErrorMessage("translate_name_sadlresource");
public static final SadlErrorMessage ATPT_BATCH_TED_ERROR = new SadlErrorMessage("atpt_batch_ted_error");
/**
* {0} must be applied to a List ({1} is not a List).
**/
public static final SadlErrorMessage MUST_BE_APPLIED_TO_LIST = new SadlErrorMessage("must_be_applied_to_list");
/**
* Invalid name in {0}: {1}
**/
public static final SadlErrorMessage INVALID_NAME = new SadlErrorMessage("invalid_name");
/**
* Did not expect a property ({0}) as a triple pattern subject.
**/
public static final SadlErrorMessage UNEXPECTED_TRIPLE = new SadlErrorMessage("unexpected_triple");
/**
* type checking doesn't handle {0}
**/
public static final SadlErrorMessage TYPE_CHECK_HANDLE_WARNING = new SadlErrorMessage("type_check_handle_warning");
/**
* {0} is not defined so return type is unknown, can't do type checking
**/
public static final SadlErrorMessage RETURN_TYPE_WARNING = new SadlErrorMessage("return_type_warning");
Expand All @@ -115,18 +83,10 @@ public final class SadlErrorMessages {
**/
public static final SadlErrorMessage PROPERTY_RESTRICTIONS = new SadlErrorMessage("property_restrictions");
/**
*
**/
public static final SadlErrorMessage NULL_ONT_MODEL = new SadlErrorMessage("null_ont_model");
/**
* {0} is undefined. Please define the {1} before referencing it.
**/
public static final SadlErrorMessage UNDEFINED = new SadlErrorMessage("undefined");
/**
* Unhandled {0}: '{1}'
**/
public static final SadlErrorMessage UNHANDLED = new SadlErrorMessage("unhandled");
/**
* A(n) {0} cannot be converted to a(n) {1}.
**/
public static final SadlErrorMessage CANNOT_CONVERT = new SadlErrorMessage("cannot_convert");
Expand All @@ -147,30 +107,122 @@ public final class SadlErrorMessages {
**/
public static final SadlErrorMessage UNKNOWN_VALUE = new SadlErrorMessage("unknown_value");
/**
* A(n) {0} requires a {1} but it is missing.
**/
public static final SadlErrorMessage MISSING = new SadlErrorMessage("missing");
/**
* Import resolved to a null {0}
**/
public static final SadlErrorMessage NULL_IMPORT = new SadlErrorMessage("null_import");
/**
* {0} could not be found, expected to be in '{1}'.
**/
public static final SadlErrorMessage NOT_FOUND = new SadlErrorMessage("not_found");
/**
* Unexpected null type error
**/
public static final SadlErrorMessage NULL_TYPE = new SadlErrorMessage("null_type");
/**
* Translation exception in Test: {0}
**/
public static final SadlErrorMessage TEST_TRANSLATION_EXCEPTION = new SadlErrorMessage("test_translation_exception");
/**
* ERROR-ATPT: No {0} selected.
**/
public static final SadlErrorMessage ATPT_NO_SELECTION = new SadlErrorMessage("atpt_no_selection");
/**
* {0} cannot {1} with {2}.
**/
public static final SadlErrorMessage VALIDATE_BIN_OP_ERROR = new SadlErrorMessage("validate_bin_op_error");
/**
* "Translation error in {0}: {1}
**/
public static final SadlErrorMessage TRANSLATION_ERROR = new SadlErrorMessage("translation_error");
/**
* This expression ({0}) cannot be decomposed into a known type"
**/
public static final SadlErrorMessage DECOMPOSITION_ERROR = new SadlErrorMessage("decomposition_error");
/**
* expected a {0}
**/
public static final SadlErrorMessage EXPECTED_A = new SadlErrorMessage("expected_a");
/**
* unable to add {0}: {1}
**/
public static final SadlErrorMessage UNABLE_TO_ADD = new SadlErrorMessage("unable_to_add");
/**
* Unable to do domain-range matching on a(n) {0}
**/
public static final SadlErrorMessage DOMAIN_MATCHING = new SadlErrorMessage("domain_matching");
/**
* unable to create {0}: {1}
**/
public static final SadlErrorMessage UNABLE_TO_CREATE = new SadlErrorMessage("unable_to_create");
/**
* Subject '{0}' did not translate to node
**/
public static final SadlErrorMessage TRANSLATE_TO_NODE = new SadlErrorMessage("translate_to_node");
/**
* A(n) {0} exception occurred while type-checking this expression.
**/
public static final SadlErrorMessage TYPE_CHECK_EXCEPTION = new SadlErrorMessage("type_check_exception");
/**
* {0} is expected to be a(n) {1} but it is not.
**/
public static final SadlErrorMessage IS_NOT_A = new SadlErrorMessage("is_not_a");
/**
* Value of '{0}' is not in range of property '{1}'.
**/
public static final SadlErrorMessage NOT_IN_RANGE = new SadlErrorMessage("not_in_range");
/**
* Invalid property type: {0}.
**/
public static final SadlErrorMessage INVALID_PROP_TYPE = new SadlErrorMessage("invalid_prop_type");
/**
* Fatal Configuration Error: {0}
**/
public static final SadlErrorMessage CONFIGURATION_ERROR = new SadlErrorMessage("configuration_error");
/**
* Range failed to resolve to a class or datatype
**/
public static final SadlErrorMessage RANGE_RESOLVE = new SadlErrorMessage("range_resolve");
/**
* ERROR-ATPT: Must select Common Test Procedure XML file for Single CTP File Mode
**/
public static final SadlErrorMessage ATPT_CTP_NOT_FOUND = new SadlErrorMessage("atpt_ctp_not_found");
/**
* {0} should not be null.
**/
public static final SadlErrorMessage INVALID_NULL = new SadlErrorMessage("invalid_null");
/**
* A {0} with name '{1}' already exists in the set of {0}s. {0} names must be unique.
**/
public static final SadlErrorMessage UNIQUE_NAME = new SadlErrorMessage("unique_name");
/**
* translate(Name) called with a SadlResource which resolved to null; this needs to be caught in validation
**/
public static final SadlErrorMessage TRANSLATE_NAME_SADLRESOURCE = new SadlErrorMessage("translate_name_sadlresource");
/**
* Invalid name in {0}: {1}
**/
public static final SadlErrorMessage INVALID_NAME = new SadlErrorMessage("invalid_name");
/**
* Did not expect a property ({0}) as a triple pattern subject.
**/
public static final SadlErrorMessage UNEXPECTED_TRIPLE = new SadlErrorMessage("unexpected_triple");
/**
* type checking doesn't handle {0}
**/
public static final SadlErrorMessage TYPE_CHECK_HANDLE_WARNING = new SadlErrorMessage("type_check_handle_warning");
/**
*
**/
public static final SadlErrorMessage NULL_ONT_MODEL = new SadlErrorMessage("null_ont_model");
/**
* Unhandled {0}: '{1}'
**/
public static final SadlErrorMessage UNHANDLED = new SadlErrorMessage("unhandled");
/**
* A(n) {0} requires a {1} but it is missing.
**/
public static final SadlErrorMessage MISSING = new SadlErrorMessage("missing");
/**
* Import resolved to a null {0}
**/
public static final SadlErrorMessage NULL_IMPORT = new SadlErrorMessage("null_import");
/**
* Unexpected null type error
**/
public static final SadlErrorMessage NULL_TYPE = new SadlErrorMessage("null_type");
/**
* cannot create {0} from {1}
**/
public static final SadlErrorMessage CANNOT_CREATE = new SadlErrorMessage("cannot_create");
Expand All @@ -179,22 +231,18 @@ public final class SadlErrorMessages {
**/
public static final SadlErrorMessage ONLY_ONE = new SadlErrorMessage("only_one");
/**
* Phrase 'not known' is not a valid graph pattern. Did you mean 'is not known'?
* Was not able to find atpt.exe in ASSERT/ATPT/atpt.exe
**/
public static final SadlErrorMessage PHRASE_NOT_KNOWN = new SadlErrorMessage("phrase_not_known");
public static final SadlErrorMessage ATPT_EXE_NOT_FOUND = new SadlErrorMessage("atpt_exe_not_found");
/**
* "Translation error in {0}: {1}
* Phrase 'not known' is not a valid graph pattern. Did you mean 'is not known'?
**/
public static final SadlErrorMessage TRANSLATION_ERROR = new SadlErrorMessage("translation_error");
public static final SadlErrorMessage PHRASE_NOT_KNOWN = new SadlErrorMessage("phrase_not_known");
/**
* A unit has been given to a numeric value for a property whose range is not a sublcass of UnittedQuantity
**/
public static final SadlErrorMessage UNITTED_QUANTITY_ERROR = new SadlErrorMessage("unitted_quantity_error");
/**
* This expression ({0}) cannot be decomposed into a known type"
**/
public static final SadlErrorMessage DECOMPOSITION_ERROR = new SadlErrorMessage("decomposition_error");
/**
* "Unexpected error processing type check for {0}: {1}
**/
public static final SadlErrorMessage UNEXPECTED_TYPE_CHECK_ERROR = new SadlErrorMessage("unexpected_type_check_error");
Expand All @@ -210,21 +258,5 @@ public final class SadlErrorMessages {
* Import failed to provide an imported resource
**/
public static final SadlErrorMessage IMPORT_FAIL = new SadlErrorMessage("import_fail");
/**
* expected a {0}
**/
public static final SadlErrorMessage EXPECTED_A = new SadlErrorMessage("expected_a");
/**
* unable to add {0}: {1}
**/
public static final SadlErrorMessage UNABLE_TO_ADD = new SadlErrorMessage("unable_to_add");
/**
* Unable to do domain-range matching on a(n) {0}
**/
public static final SadlErrorMessage DOMAIN_MATCHING = new SadlErrorMessage("domain_matching");
/**
* unable to create {0}: {1}
**/
public static final SadlErrorMessage UNABLE_TO_CREATE = new SadlErrorMessage("unable_to_create");

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
#Sadl Messages - PLEASE ADD NEW MESSAGES IN ALPHABETICAL ORDER
atpt_batch_error=ERROR-ATPT: Must select folder for Batch Mode
atpt_batch_error.description=This error is caused by not selecting a folder in the project explorer to run batch atpt command on. \
Fix this by selecting a folder (not a file) or by changing the preferences to run in Single mode.
atpt_batch_ted_error=ERROR-ATPT: Cannot run batch mode using TED files. Update ATPT preferences
atpt_batch_ted_error.description=Currently ATPT cannot run batch mode using TED files. Fix this by changing the preferences to not \
use TED files, or use a batch configuration file to run batch TED ATPT.
atpt_ctp_not_found=ERROR-ATPT: Must select Common Test Procedure XML file for Single CTP File Mode
atpt_ctp_not_found.description=When running in Single CTP file mode a single CTP xml file must be selected. Fix this by selecting a \
file (not a folder) or by changing the preferences to run in a different mode.
atpt_exe_not_found=Was not able to find atpt.exe in ASSERT/ATPT/atpt.exe
atpt_exe_not_found.description=The assert atpt.exe file location is found using the ASSERTROOT environment variable, make sure it \
is set to your ASSERT home directory, and contains the atpt/ directory and atpt.exe file.
atpt_folder_not_select=Must select folder (not file) for running Batch ATPT
atpt_folder_not_select.description=When running ATPT in 'Batch Test Procedure' mode, you must select a folder to run ATPT on, \
not a file.
atpt_no_selection=ERROR-ATPT: No {0} selected.
atpt_no_selection.description=When running ATPT, you must select the right item for the mode you are in (batch=folder, single=xml file) \
Also make sure the correct file paths are set in the preferences for the mode you are in.
atpt_no_xml_selected=No folder or xml file selected for ATPT
atpt_no_xml_selected.description=To run ATPT from eclipse, you must select the associated common test procedure (CTP) \
output file or folder which contains the CTP output file(s).
cannot_assign_existing=Cannot assign {0}: property '{1}' already has {0} assigned to '{2}'.
cannot_assign_existing.description=Property already has an assigned value
cannot_convert=A(n) {0} cannot be converted to a(n) {1}.
Expand All @@ -15,6 +36,8 @@ decomposition_error=This expression ({0}) cannot be decomposed into a known type
decomposition_error.description= error occurred while getting expression type
expected_a=expected a {0}
expected_a.description=A certain property was expected in this location, but was not found
file_type_error=Only files of type {0} are valid for this command
file_type_error.description=Ensure you have selected the correct file or folder for the command you are running
import_fail=Import failed to provide an imported resource
import_fail.description=There is an error trying to access resource from given import
invalid_name=Invalid name in {0}: {1}
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ Export-Package: com.ge.research.sadl.ui,
com.ge.research.sadl.ui.quickfix,
com.ge.research.sadl.ui.syntaxcoloring,
com.ge.research.sadl.ui.visualize
Import-Package: org.apache.log4j,
org.pojava.datetime,
Import-Package: com.ge.research.sadl.errorgenerator.generator,
com.ge.research.sadl.errorgenerator.messages,
com.ge.research.sadl.reasoner,
com.ge.research.sadl.reasoner.utils
com.ge.research.sadl.reasoner.utils,
org.apache.log4j,
org.pojava.datetime
Bundle-Activator: com.ge.research.sadl.ui.internal.SadlActivator
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.eclipse.xtext.validation.IResourceValidator;

import com.ge.research.sadl.builder.MessageManager.MessageType;
import com.ge.research.sadl.errorgenerator.generator.SadlErrorMessages;
import com.ge.research.sadl.model.DeclarationExtensions;
import com.ge.research.sadl.model.visualizer.IGraphVisualizer;
import com.ge.research.sadl.preferences.SadlPreferences;
Expand Down Expand Up @@ -196,7 +197,7 @@ public EObject exec(XtextResource resource) throws Exception {
sb.append(validTargetTypes[i]);
}
}
throw new TranslationException("Only files of type " + sb.toString() + " are valid for this command");
throw new TranslationException(SadlErrorMessages.FILE_TYPE_ERROR.get(sb.toString()));
}
}
else if (firstElement instanceof IFolder) {
Expand Down

0 comments on commit e777378

Please sign in to comment.