Java | .Net |
---|---|
java.util.Hashtable getRecognitionProperties() | System.Collections.Hashtable GetRecognitionProperties() |
int getRecognitionPropertyWeight(String propertyName) | int GetRecognitionPropertyWeight(String propertyName) |
L'exemple Java™ suivant illustre l'ajout d'une nouvelle propriété appelée ".priorLabel" sous forme de propriété de reconnaissance supplémentaire :
import com.rational.test.ft.domain.*; public class someProxy extends baseProxy { . . public java.util.Hashtable getRecognitionProperties() { java.util.Hashtable properties = super.getRecognitionProperties(); properties.put(".priorLabel", getPriorLabel()); return properties; } . . . public Object getRecognitionPropertyWeight(String propertyName) { if (propertyName.equals(".priorLabel")) return 60; return super.getRecognitionPropertyWeight(propertyName); } }
L'exemple .Net suivant illustre l'ajout d'une nouvelle propriété appelée ".priorLabel" sous forme de propriété de reconnaissance supplémentaire.
using Rational.Test.Ft.Domain; public class AnyProxy:BaseProxy { . . . public override System.Collections.Hashtable GetRecognitionProperties() { System.Collections.Hashtable properties= base.GetRecognitionProperties(); properties.Add(".priorLabel", GetPriorLabel() ); return properties; } . . . public override object GetRecognitionPropertyWeight(string propertyName) { if (propertyName == ".priorLabel" ) return 60; return base.GetRecognitionPropertyWeight(propertyName) ; }