Skip to content
Snippets Groups Projects
Commit 7a085385 authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

signal not implemented validation

parent 1047212f
No related branches found
No related tags found
1 merge request!11Resolve "complete validation by NSD"
...@@ -55,7 +55,7 @@ public class AnyLNValidator { ...@@ -55,7 +55,7 @@ public class AnyLNValidator {
} }
public void generateValidators( HashMap< String, DataObject > doMap, HashMap< String, DOIValidator > cdcMap, AnyLNClass lnClass ) { private void generateValidators( HashMap< String, DataObject > doMap, HashMap< String, DOIValidator > cdcMap, AnyLNClass lnClass ) {
for( DataObject dObj : lnClass.getDataObject() ) { for( DataObject dObj : lnClass.getDataObject() ) {
doMap.put( dObj.getName(), dObj ); doMap.put( dObj.getName(), dObj );
if( dObj.getRefersToCDC() != null ) { if( dObj.getRefersToCDC() != null ) {
...@@ -110,7 +110,7 @@ public class AnyLNValidator { ...@@ -110,7 +110,7 @@ public class AnyLNValidator {
return res; return res;
} }
public boolean checkCompulsory( AnyLN ln, DataObject dataObject, HashSet< String > checkedDO, DiagnosticChain diagnostics ) { private boolean checkCompulsory( AnyLN ln, DataObject dataObject, HashSet< String > checkedDO, DiagnosticChain diagnostics ) {
switch( dataObject.getPresCond() ) { switch( dataObject.getPresCond() ) {
case "M": case "M":
if( ! checkedDO.contains( dataObject.getName() ) ) { if( ! checkedDO.contains( dataObject.getName() ) ) {
...@@ -122,11 +122,15 @@ public class AnyLNValidator { ...@@ -122,11 +122,15 @@ public class AnyLNValidator {
new Object[] { ln } )); new Object[] { ln } ));
return false; return false;
} }
break;
default:
AbstractRiseClipseConsole.getConsole().info( "NOT IMPLEMENTED: AnyLNValidator.checkCompulsory( " + dataObject.getPresCond() + " )" );
break;
} }
return true; return true;
} }
public boolean updateCompulsory( DOI doi, HashSet< String > checkedDO, DiagnosticChain diagnostics ) { private boolean updateCompulsory( DOI doi, HashSet< String > checkedDO, DiagnosticChain diagnostics ) {
switch( doMap.get( doi.getName() ).getPresCond() ) { switch( doMap.get( doi.getName() ).getPresCond() ) {
case "M": case "M":
case "O": case "O":
...@@ -149,11 +153,14 @@ public class AnyLNValidator { ...@@ -149,11 +153,14 @@ public class AnyLNValidator {
"DO " + doi + " is forbidden in LN at line " + doi.getParentAnyLN().getLineNumber(), "DO " + doi + " is forbidden in LN at line " + doi.getParentAnyLN().getLineNumber(),
new Object[] { doi } )); new Object[] { doi } ));
return false; return false;
default:
AbstractRiseClipseConsole.getConsole().info( "NOT IMPLEMENTED: AnyLNValidator.updateCompulsory( " + doMap.get( doi.getName() ).getPresCond() + " )" );
break;
} }
return true; return true;
} }
public boolean validateDOI( DOI doi, DiagnosticChain diagnostics ) { private boolean validateDOI( DOI doi, DiagnosticChain diagnostics ) {
AbstractRiseClipseConsole.getConsole().verbose( "found DO " + doi.getName() + " in LNClass " + lnClass ); AbstractRiseClipseConsole.getConsole().verbose( "found DO " + doi.getName() + " in LNClass " + lnClass );
......
...@@ -102,6 +102,10 @@ public class DOIValidator { ...@@ -102,6 +102,10 @@ public class DOIValidator {
new Object[] { da } )); new Object[] { da } ));
return false; return false;
} }
break;
default:
AbstractRiseClipseConsole.getConsole().info( "NOT IMPLEMENTED: DOIValidator.checkCompulsory( " + da.getPresCond() + " )" );
break;
} }
return true; return true;
} }
...@@ -131,6 +135,9 @@ public class DOIValidator { ...@@ -131,6 +135,9 @@ public class DOIValidator {
"DAI " + dai.getName() + " (line " + dai.getLineNumber() + ") is forbidden", "DAI " + dai.getName() + " (line " + dai.getLineNumber() + ") is forbidden",
new Object[] { dai } )); new Object[] { dai } ));
return false; return false;
default:
AbstractRiseClipseConsole.getConsole().info( "NOT IMPLEMENTED: DOIValidator.updateCompulsory( " + daMap.get( dai.getName() ).getPresCond() + " )" );
break;
} }
return true; return true;
} }
...@@ -247,6 +254,7 @@ public class DOIValidator { ...@@ -247,6 +254,7 @@ public class DOIValidator {
} }
} }
@SuppressWarnings( "unused" )
private void testValidateVal() { private void testValidateVal() {
log( "\n--\tSTART TEST\t--\n" ); log( "\n--\tSTART TEST\t--\n" );
assertTrue( validateVal( "0", "BOOLEAN" ) ); assertTrue( validateVal( "0", "BOOLEAN" ) );
......
...@@ -89,7 +89,7 @@ public class NsdEObjectValidator implements EValidator { ...@@ -89,7 +89,7 @@ public class NsdEObjectValidator implements EValidator {
return true; return true;
} }
public boolean validateLN( AnyLN ln, DiagnosticChain diagnostics ) { private boolean validateLN( AnyLN ln, DiagnosticChain diagnostics ) {
AbstractRiseClipseConsole.getConsole().verbose( "" ); AbstractRiseClipseConsole.getConsole().verbose( "" );
AbstractRiseClipseConsole.getConsole().verbose( "NsdEObjectValidator.validateLN( " + ln.getLnClass() + " )" ); AbstractRiseClipseConsole.getConsole().verbose( "NsdEObjectValidator.validateLN( " + ln.getLnClass() + " )" );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment