Commit 95f5c5f3 authored by Dominique Marcadet's avatar Dominique Marcadet

add code to test against #26

USe EcoreUtil.getAllContents() to display SCL tree as seen by EMF
parent 4df64afa
......@@ -22,6 +22,7 @@
package fr.centralesupelec.edf.riseclipse.iec61850.scl.validator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
......@@ -41,6 +42,7 @@ import fr.centralesupelec.edf.riseclipse.validation.ocl.OCLValidator;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
......@@ -49,6 +51,7 @@ import org.eclipse.emf.ecore.EValidator;
import org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.ocl.pivot.validation.ComposedEValidator;
......@@ -420,6 +423,12 @@ public class RiseClipseValidatorSCL {
}
});
});
for( TreeIterator< ? extends EObject > t = EcoreUtil.getAllContents( Collections.singleton( scl ) ); t.hasNext(); ) {
EObject child = t.next();
console.info( child.getClass().getName() );
}
}
System.exit( 0 );
......
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