Java | .Net |
---|---|
java.util.Hashtable getRecognitionProperties() | System.Collections.Hashtable GetRecognitionProperties() |
int getRecognitionPropertyWeight(String propertyName) | int GetRecognitionPropertyWeight(String propertyName) |
以下 Java™ 样本添加了新属性 ".priorLabel" 作为附加的识别属性。
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); } }
以下 .Net 样本添加新属性 ".priorLabel" 为附加的识别属性。
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) ; }