Package org.apache.jmeter.testelement

Examples of org.apache.jmeter.testelement.TestElement


            controller.initialize();
            for (int i = 0; i < 2; i++)
            {
                assertEquals(7, counter);
                counter = 0;
                TestElement sampler = null;
                while ((sampler = controller.next()) != null)
                {
                    assertEquals(
                        order[counter++],
                        sampler.getPropertyAsString(TestElement.NAME));
                }
            }
        }
View Full Code Here


      {
        continue;
      }
      this.assertEquals("Failed on " + item.getClass().getName(),
          item.getStaticLabel(), item.getName());
      TestElement el = item.createTestElement();
      assertEquals("GUI-CLASS: Failed on " + item.getClass().getName(), item.getClass().getName(),
          el.getProperty(TestElement.GUI_CLASS));
      assertEquals("NAME: Failed on " + item.getClass().getName(), item.getName(),
          el.getProperty(TestElement.NAME));
      assertEquals("TEST-CLASS: Failed on " + item.getClass().getName(),
          el.getClass().getName(), el.getProperty(TestElement.TEST_CLASS));
      el.setProperty(TestElement.NAME, "hey, new name!:");
      el.setProperty("NOT","Shouldn't be here");
      TestElement el2 = item.createTestElement();
      assertNull("GUI-CLASS: Failed on " + item.getClass().getName(),
      el2.getProperty("NOT"));
      el = SaveService.createTestElement(SaveService.getConfigForTestElement(null,
          el));
      item.configure(el);
      assertEquals("CONFIGURE-TEST: Failed on " + item.getClass().getName(),
          el.getProperty(TestElement.NAME), item.getName());
View Full Code Here

  public void testTestElements() throws Exception
  {
    Iterator iter = getObjects(TestElement.class).iterator();
    while(iter.hasNext())
    {
      TestElement item = (TestElement)iter.next();
      checkElementCloning(item);
      assertTrue(item.getClass().getName()+" must implement Serializable",
          item instanceof Serializable);
    }
  }
View Full Code Here

        item.getClass().getName(), clonedItem.getClass().getName());
  }

  private void checkElementCloning(TestElement item)
  {
    TestElement clonedItem = (TestElement)item.clone();
    cloneTesting(item, clonedItem);
    Iterator iter2 = item.getPropertyNames().iterator();
    while(iter2.hasNext())
    {
      Object item2 = iter2.next();
View Full Code Here

        {
                Iterator iter = subTree.list().iterator();
                List configs = new LinkedList();
                while (iter.hasNext())
                {
                        TestElement item = (TestElement)iter.next();
                        DefaultConfiguration config = new DefaultConfiguration("node","node");
                        config.addChild(getConfigForTestElement(null,item));
                        List configList = getConfigsFromTree(subTree.getTree(item));
                        Iterator iter2 = configList.iterator();
                        while(iter2.hasNext())
View Full Code Here

        }

        public static TestElement createTestElement(Configuration config) throws ConfigurationException,
                        ClassNotFoundException, IllegalAccessException,InstantiationException
        {
                TestElement element = null;
                element = (TestElement)Class.forName((String)config.getAttribute("class")).newInstance();
                Configuration[] children = config.getChildren();
                for (int i = 0; i < children.length; i++)
                {
                        if(children[i].getName().equals("property"))
                        {
                                try
                                {
                                        element.setProperty(children[i].getAttribute("name"),
                                                children[i].getValue());
                                }
                                catch (Exception ex)
                                {
                                        log.error("Problem loading property",ex);
                                        element.setProperty(children[i].getAttribute("name"),"");
                                }
                        }
                        else if(children[i].getName().equals("testelement"))
                        {
                                element.setProperty(children[i].getAttribute("name"),
                                                createTestElement(children[i]));
                        }
                        else if(children[i].getName().equals("collection"))
                        {
                                element.setProperty(children[i].getAttribute("name"),
                                                createCollection(children[i]));
                        }
                }
                return element;
        }
View Full Code Here

                return coll;
        }

        private static HashTree generateNode(Configuration config)
        {
                TestElement element = null;
                try
                {
                        element = createTestElement(config.getChild("testelement"));
                }
                catch(Exception e)
View Full Code Here

    Iterator iter = new LinkedList(tree.list()).iterator();
    while (iter.hasNext())
    {
      JMeterGUIComponent item = (JMeterGUIComponent)iter.next();
      convertSubTree(tree.getTree(item));
      TestElement testElement = item.createTestElement();
      tree.replace(item,testElement);
    }
  }
View Full Code Here

  private void convertTree(HashTree tree) throws Exception
  {
    Iterator iter = new LinkedList(tree.list()).iterator();
    while (iter.hasNext())
    {
      TestElement item = (TestElement)iter.next();
      convertTree(tree.getTree(item));
      JMeterGUIComponent comp = generateGUIComponent(item);
      tree.replace(item,comp);
    }
  }
View Full Code Here

  }

  public Sampler next()
  {
    setInterleave(DEFAULT_STYLE);
    TestElement controller = getCurrentController();
    if(controller == null)
    {
      nextAtEnd();
      return next();
    }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.testelement.TestElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.