Package org.jboss.test.proxyfactory.support

Examples of org.jboss.test.proxyfactory.support.SimpleBean


public class NonInterfaceAdvisedTestCase extends AbstractProxyTest
{
   public void testSimple() throws Exception
   {
      SimpleInterceptor.invoked = null;
      SimpleBean bean = new SimpleBean();
      SimpleBean proxy = (SimpleBean) assertCreateProxy(bean, SimpleBean.class);
      proxy.doSomethingElse();
      assertTrue(bean.invoked);
      Method invoked = SimpleInterceptor.invoked;
      assertNotNull(invoked);
      assertEquals("doSomethingElse", invoked.getName());
   }
View Full Code Here


{
   private static final int iterations = 1000;
  
   public void testSimple() throws Exception
   {
      SimpleBean bean = new SimpleBean();
      Simple simple = (Simple) assertCreateProxy(bean, Simple.class);
      SimpleInterceptor.invoked = null;
      simple.doSomething();
      assertTrue(bean.invoked);
      Method invoked = SimpleInterceptor.invoked;
View Full Code Here

  
   public void testStressNoProxy() throws Exception
   {
      for (int i = 0; i < iterations; ++i)
      {
         SimpleBean bean = new SimpleBean();
         bean.doSomething();
      }
   }
View Full Code Here

   {
      Class[] interfaces = new Class[] { Simple.class };
      ClassLoader cl = Simple.class.getClassLoader();
      for (int i = 0; i < iterations; ++i)
      {
         SimpleBean bean = new SimpleBean();
         InvocationHandler ih = new MyInvocationHandler(bean);
         Simple simple = (Simple) Proxy.newProxyInstance(cl, interfaces, ih);
         simple.doSomething();
      }
   }
View Full Code Here

  
   public void testStressProxyFactory() throws Exception
   {
      for (int i = 0; i < iterations; ++i)
      {
         SimpleBean bean = new SimpleBean();
         Simple simple = (Simple) createProxy(bean);
         simple.doSomething();
      }
   }
View Full Code Here

*/
public class InstanceAdvisedTestCase extends AbstractProxyTest
{
   public void testInstanceAdvised() throws Exception
   {
      SimpleBean bean1 = new SimpleBean();
      Simple simple1 = (Simple) assertCreateProxy(bean1, Simple.class);
      SimpleBean bean2 = new SimpleBean();
      Simple simple2 = (Simple) assertCreateProxy(bean2, Simple.class);
      InstanceInterceptor.last = null;
      simple1.doSomething();
      assertTrue(bean1.invoked);
      Object instance1 = InstanceInterceptor.last;
View Full Code Here

*/
public class ProxyCacheTestCase extends AbstractProxyTest
{
   public void testCache() throws Exception
   {
      SimpleBean bean = new SimpleBean();
      assertCreateProxy(bean, Simple.class);
      assertCreateProxy(bean, new Class[] { Tagging.class }, Tagging.class);
   }
View Full Code Here

*/
public class FieldTestCase extends AbstractProxyTest
{
   public void testField() throws Exception
   {
      SimpleBean bean = new SimpleBean();
      Simple simple = (Simple) assertCreateProxy(bean, Simple.class);
      SimpleInterceptor.invoked = null;
      simple.doSomething();
      assertTrue(bean.invoked);
      Method invoked = SimpleInterceptor.invoked;
View Full Code Here

*/
public class SimpleMetaDataTestCase extends AbstractProxyTest
{
   public void testSimpleMetaData() throws Exception
   {
      SimpleBean bean = new SimpleBean();
      SimpleMetaData metaData = new SimpleMetaData();
      metaData.addMetaData("Simple", "MetaData", "Value");
      Simple simple = (Simple) assertCreateProxy(bean, new Class[] { Simple.class }, metaData, Simple.class);
      SimpleInterceptor.invoked = null;
      simple.doSomething();
View Full Code Here

*/
public class TaggingInterfaceTestCase extends AbstractProxyTest
{
   public void testTagging() throws Exception
   {
      SimpleBean bean = new SimpleBean();
      Object tagging = assertCreateProxy(bean, new Class[] { Tagging.class }, Tagging.class);
      Simple simple = (Simple) tagging;
      SimpleInterceptor.invoked = null;
      simple.doSomething();
      assertTrue(bean.invoked);
View Full Code Here

TOP

Related Classes of org.jboss.test.proxyfactory.support.SimpleBean

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.