Package org.springframework.util

Examples of org.springframework.util.StopWatch.stop()


    bw.registerCustomEditor(int.class, "array[0].somePath", new CustomNumberEditor(Integer.class, false));
    sw.start("array3");
    for (int i = 0; i < 1000; i++) {
      bw.setPropertyValue("array", input);
    }
    sw.stop();
    assertTrue("Took too long", sw.getLastTaskTimeMillis() < 100);

    bw.registerCustomEditor(int.class, new CustomNumberEditor(Integer.class, false));
    sw.start("array4");
    for (int i = 0; i < 100; i++) {
View Full Code Here


    bw.registerCustomEditor(int.class, new CustomNumberEditor(Integer.class, false));
    sw.start("array4");
    for (int i = 0; i < 100; i++) {
      bw.setPropertyValue("array", input);
    }
    sw.stop();
    assertEquals(1024, tb.getArray().length);
    assertEquals(0, tb.getArray()[0]);
    assertTrue("Took too long", sw.getLastTaskTimeMillis() > time1);
  }
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start("prototype");
    for (int i = 0; i < 100000; i++) {
      lbf.getBean("test");
    }
    sw.stop();
    // System.out.println(sw.getTotalTimeMillis());
    assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000);
  }

  public void testPrototypeCreationWithDependencyCheckIsFastEnough() {
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start("prototype");
    for (int i = 0; i < 100000; i++) {
      lbf.getBean("test");
    }
    sw.stop();
    // System.out.println(sw.getTotalTimeMillis());
    assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000);
  }

  /**
 
View Full Code Here

    for (int i = 0; i < 100000; i++) {
      TestBean tb = (TestBean) lbf.getBean("test");
      assertEquals("juergen", tb.getName());
      assertEquals(99, tb.getAge());
    }
    sw.stop();
    // System.out.println(sw.getTotalTimeMillis());
    assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000);
  }

  /**
 
View Full Code Here

    sw.start("prototype");
    for (int i = 0; i < 100000; i++) {
      TestBean tb = (TestBean) lbf.getBean("test");
      assertSame(spouse, tb.getSpouse());
    }
    sw.stop();
    // System.out.println(sw.getTotalTimeMillis());
    assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 4000);
  }

  public void testPrototypeCreationWithPropertiesIsFastEnough() {
View Full Code Here

    for (int i = 0; i < 100000; i++) {
      TestBean tb = (TestBean) lbf.getBean("test");
      assertEquals("juergen", tb.getName());
      assertEquals(99, tb.getAge());
    }
    sw.stop();
    // System.out.println(sw.getTotalTimeMillis());
    assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 3000);
  }

  /**
 
View Full Code Here

    sw.start("prototype");
    for (int i = 0; i < 100000; i++) {
      TestBean tb = (TestBean) lbf.getBean("test");
      assertSame(spouse, tb.getSpouse());
    }
    sw.stop();
    // System.out.println(sw.getTotalTimeMillis());
    assertTrue("Prototype creation took too long: " + sw.getTotalTimeMillis(), sw.getTotalTimeMillis() < 4000);
  }

  public void testBeanPostProcessorWithWrappedObjectAndDisposableBean() {
View Full Code Here

    StopWatch sw = new StopWatch();
    sw.start("Look up " + howMany + " prototype bean instances with method overrides");
    for (int i = 0; i < howMany; i++) {
      testLookupOverrideMethodsWithSetterInjection(xbf, "overrideOnPrototype", false);
    }
    sw.stop();
    System.out.println(sw);
    if (!LogFactory.getLog(DefaultListableBeanFactory.class).isDebugEnabled()) {
      assertTrue(sw.getTotalTimeMillis() < 2000);
    }
View Full Code Here

      ByteArrayOutputStream os = null;
      for (int i = 0; i < nrOfCalls; i++) {
        os = new ByteArrayOutputStream();
        this.imageDatabase.streamImage(image.getName(), os);
      }
      stopWatch.stop();
      System.out.println("Found image '" + image.getName() + "' with content size " + os.size() +
          " and description length " + image.getDescriptionLength());
    }
    System.out.println(stopWatch.prettyPrint());
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.