1 18 19 package org.apache.jmeter.testelement.property; 20 21 import org.apache.jmeter.testelement.TestElement; 22 23 29 public abstract class MultiProperty extends AbstractProperty 30 { 31 public MultiProperty() 32 { 33 super(); 34 } 35 36 public MultiProperty(String name) 37 { 38 super(name); 39 } 40 41 47 public abstract PropertyIterator iterator(); 48 49 52 public abstract void addProperty(JMeterProperty prop); 53 54 57 public abstract void clear(); 58 59 60 public void setRunningVersion(boolean running) 61 { 62 super.setRunningVersion(running); 63 PropertyIterator iter = iterator(); 64 while (iter.hasNext()) 65 { 66 iter.next().setRunningVersion(running); 67 } 68 } 69 70 protected void recoverRunningVersionOfSubElements(TestElement owner) 71 { 72 PropertyIterator iter = iterator(); 73 while (iter.hasNext()) 74 { 75 JMeterProperty prop = iter.next(); 76 if (owner.isTemporary(prop)) 77 { 78 iter.remove(); 79 } 80 else 81 { 82 prop.recoverRunningVersion(owner); 83 } 84 } 85 } 86 87 public void mergeIn(JMeterProperty prop) 88 { 89 if (prop.getObjectValue() == getObjectValue()) 90 { 91 return; 92 } 93 log.debug("merging in " + prop.getClass()); 94 if (prop instanceof MultiProperty) 95 { 96 PropertyIterator iter = ((MultiProperty) prop).iterator(); 97 while (iter.hasNext()) 98 { 99 JMeterProperty item = iter.next(); 100 addProperty(item); 101 } 102 } 103 else 104 { 105 addProperty(prop); 106 } 107 } 108 } 109 | Popular Tags |