@Test public void testGetNumThreads() { System.out.println("getNumThreads"); CollectionProperty prop = JMeterPluginsUtils.tableModelRowsToCollectionProperty(dataModel, UltimateThreadGroup.DATA_PROPERTY); instance.setData(prop); instance.testStarted(); int expResult = 15; int result = instance.getNumThreads(); assertEquals(expResult, result); }
@Override public int getNumThreads() { int result = 0; JMeterProperty threadValues = getData(); if (!(threadValues instanceof NullProperty)) { CollectionProperty columns = (CollectionProperty) threadValues; List<?> rows = (List<?>) columns.getObjectValue(); for (Object row1 : rows) { CollectionProperty prop = (CollectionProperty) row1; ArrayList<JMeterProperty> row = (ArrayList<JMeterProperty>) prop.getObjectValue(); result += row.get(0).getIntValue(); } } return result; }
UltimateThreadGroup extends AbstractSimpleThreadGroup implements Serializable, TestStateListener { @Override public int getNumThreads() { int result = 0; JMeterProperty threadValues = getData(); if (!(threadValues instanceof NullProperty)) { CollectionProperty columns = (CollectionProperty) threadValues; List<?> rows = (List<?>) columns.getObjectValue(); for (Object row1 : rows) { CollectionProperty prop = (CollectionProperty) row1; ArrayList<JMeterProperty> row = (ArrayList<JMeterProperty>) prop.getObjectValue(); result += row.get(0).getIntValue(); } } return result; } }
UltimateThreadGroup extends AbstractSimpleThreadGroup implements Serializable, TestStateListener { @Override public int getNumThreads() { int result = 0; JMeterProperty threadValues = getData(); if (!(threadValues instanceof NullProperty)) { CollectionProperty columns = (CollectionProperty) threadValues; List<?> rows = (List<?>) columns.getObjectValue(); for (Object row1 : rows) { CollectionProperty prop = (CollectionProperty) row1; ArrayList<JMeterProperty> row = (ArrayList<JMeterProperty>) prop.getObjectValue(); result += row.get(0).getIntValue(); } } return result; } UltimateThreadGroup(); }
UltimateThreadGroup extends AbstractSimpleThreadGroup implements Serializable, TestStateListener { @Override public int getNumThreads() { int result = 0; JMeterProperty threadValues = getData(); if (!(threadValues instanceof NullProperty)) { CollectionProperty columns = (CollectionProperty) threadValues; List<?> rows = (List<?>) columns.getObjectValue(); for (Object row1 : rows) { CollectionProperty prop = (CollectionProperty) row1; ArrayList<JMeterProperty> row = (ArrayList<JMeterProperty>) prop.getObjectValue(); result += row.get(0).getIntValue(); } } return result; } UltimateThreadGroup(); JMeterProperty getData(); void setData(CollectionProperty rows); @Override int getNumThreads(); @Override void testStarted(); @Override void testStarted(String host); @Override void testEnded(); @Override void testEnded(String host); }
UltimateThreadGroup extends AbstractSimpleThreadGroup implements Serializable, TestStateListener { @Override public int getNumThreads() { int result = 0; JMeterProperty threadValues = getData(); if (!(threadValues instanceof NullProperty)) { CollectionProperty columns = (CollectionProperty) threadValues; List<?> rows = (List<?>) columns.getObjectValue(); for (Object row1 : rows) { CollectionProperty prop = (CollectionProperty) row1; ArrayList<JMeterProperty> row = (ArrayList<JMeterProperty>) prop.getObjectValue(); result += row.get(0).getIntValue(); } } return result; } UltimateThreadGroup(); JMeterProperty getData(); void setData(CollectionProperty rows); @Override int getNumThreads(); @Override void testStarted(); @Override void testStarted(String host); @Override void testEnded(); @Override void testEnded(String host); static final String DATA_PROPERTY; static final String EXTERNAL_DATA_PROPERTY; static final int START_THREADS_CNT_FIELD_NO; static final int INIT_DELAY_FIELD_NO; static final int STARTUP_TIME_FIELD_NO; static final int HOLD_LOAD_FOR_FIELD_NO; static final int SHUTDOWN_TIME_FIELD_NO; }