Examples of MyInterface


Examples of org.apache.tuscany.sca.databinding.json.MyInterface

        bean.setName("Test");
        bean.setAge(20);
        bean.getNotes().add("1");
        bean.getNotes().add("2");
        bean.getMap().put("1", 1);
        MyInterface service = new MyInterfaceImpl();
        service.setId("ID001");
        bean.setService(service);
        bean.setOtherService(service);

        roundTrip(bean);
    }
View Full Code Here

Examples of org.jboss.ejb3.test.interceptors.inheritance.MyInterface

     
      ProxyContainer<AnnotatedBean> container = new ProxyContainer<AnnotatedBean>("AnnotatedContainer", "InterceptorContainer", AnnotatedBean.class);
      Interceptions.clear();
     
      Class<?> interfaces[] = { MyInterface.class };
      MyInterface proxy = container.constructProxy(interfaces);
     
      ArrayList<Class<?>> interceptions = Interceptions.getAroundInvokes();
      assertEquals(0, interceptions.size());
     
      proxy.method();
     
      assertEquals(6,  interceptions.size());
      assertEquals(ClassBaseInterceptor.class, interceptions.get(0));
      assertEquals(ClassInterceptor.class, interceptions.get(1));
      assertEquals(MethodBaseInterceptor.class, interceptions.get(2));
View Full Code Here

Examples of org.jboss.ejb3.test.interceptors.proxy.MyInterface

      Thread.currentThread().setContextClassLoader(MyInterface.class.getClassLoader());
     
      ProxyContainer<ProxiedBean> container = new ProxyContainer<ProxiedBean>("ProxyTestCase", "InterceptorContainer", ProxiedBean.class);
     
      Class<?> interfaces[] = { MyInterface.class };
      MyInterface proxy = container.constructProxy(interfaces);
     
      String result = proxy.sayHi("Me");
      assertEquals("Hi Me", result);

      assertEquals(1, InvocationCounterInterceptor.counter);
   }
View Full Code Here

Examples of org.jboss.ejb3.test.interceptors.proxy.MyInterface

      ProxyContainer<ProxiedBean> container = new ProxyContainer<ProxiedBean>("ProxyTestCase", "InterceptorContainer", ProxiedBean.class);
     
      assertEquals(0, ProxiedInterceptor.postConstructs);
     
      Class<?> interfaces[] = { MyInterface.class };
      MyInterface proxy = container.constructProxy(interfaces);
     
      assertEquals("ProxiedInterceptor postConstruct must have been called once", 1, ProxiedInterceptor.postConstructs);
     
      String result = proxy.sayHi("Me");
      assertEquals("Hi Me", result);
     
      assertEquals("sayHi didn't invoke ProxiedInterceptor.aroundInvoke once", 1, ProxiedInterceptor.aroundInvokes);
      assertEquals("sayHi didn't invoke ProxiedBean.aroundInvoke once", 1, ProxiedBean.aroundInvokes);
      log.info("======= Done");
View Full Code Here

Examples of org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.MyInterface

     
      ProxyContainerWithPool<ProxiedBean> container = new ProxyContainerWithPool<ProxiedBean>("ProxyInstanceAdvisorTestCase", "InterceptorContainer", ProxiedBean.class);
     
     
      Class<?> interfaces[] = { MyInterface.class };
      MyInterface proxy = container.constructProxy(interfaces);
     
     
      reset(true);
      String result = proxy.sayHi("Me");
      assertEquals("Hi Me", result);
      ProxiedBean bean1hi = Interceptions.getProxiedBean();
      PerInstanceInterceptor pi1hi = Interceptions.getPerInstanceInterceptor();
      PerJoinpointInterceptor pj1hi = Interceptions.getPerJoinpointInterceptor();
      assertEquals(1, Interceptions.getProxiedBeanCalls());
      assertEquals(1, Interceptions.getPerInstanceCalls());
      assertEquals(1, Interceptions.getPerJoinpointCalls());
     
      reset(false);
      result = proxy.sayBye("Me");
      assertEquals("Bye Me", result);
      ProxiedBean bean1bye = Interceptions.getProxiedBean();
      PerInstanceInterceptor pi1bye = Interceptions.getPerInstanceInterceptor();
      PerJoinpointInterceptor pj1bye = Interceptions.getPerJoinpointInterceptor();
      assertEquals(1, Interceptions.getProxiedBeanCalls());
      assertEquals(1, Interceptions.getPerInstanceCalls());
      assertEquals(1, Interceptions.getPerJoinpointCalls());
     
      assertSame(bean1hi, bean1bye);
      assertSame(pi1hi, pi1bye);
      assertNotSame(pj1hi, pj1bye);

      reset(true);
      result = proxy.sayHi("Me");
      assertEquals("Hi Me", result);
      ProxiedBean bean2hi = Interceptions.getProxiedBean();
      PerInstanceInterceptor pi2hi = Interceptions.getPerInstanceInterceptor();
      PerJoinpointInterceptor pj2hi = Interceptions.getPerJoinpointInterceptor();
      assertNotSame(bean1hi, bean2hi);
View Full Code Here

Examples of org.jboss.ejb3.test.interceptors.proxyinstanceadvisor.MyInterface

      Thread.currentThread().setContextClassLoader(MyInterface.class.getClassLoader());
     
      ProxyContainerWithPool<ProxiedBean> container = new ProxyContainerWithPool<ProxiedBean>("ProxyInstanceAdvisorTestCase", "InterceptorContainer", ProxiedBean.class);

      Class<?> interfaces[] = { MyInterface.class };
      MyInterface proxy = container.constructProxy(interfaces);

      CallSleepyHelloRunnable sleepyRunner = new CallSleepyHelloRunnable(proxy, 5000);
      Thread thread = new Thread(sleepyRunner);
      System.out.println("My thread " + Thread.currentThread().getName() + " new thread " + thread.getName());
      thread.start();
     
      //Give other thread a chance to start
      Thread.sleep(1000);        
     
      reset(differentInstances);
     
      String result = proxy.sleepyHello(0, "Me");
      assertEquals("Hi Me", result);
      ProxiedBean beanMine = Interceptions.getProxiedBean();
      PerInstanceInterceptor piMine = Interceptions.getPerInstanceInterceptor();
      PerJoinpointInterceptor pjMine = Interceptions.getPerJoinpointInterceptor();
      assertEquals(1, Interceptions.getProxiedBeanCalls());
View Full Code Here

Examples of org.mvel2.tests.core.res.MyInterface

    assertEquals("foo",
        test("list = new java.util.ArrayList(); list.add(new String('foo')); list[0]"));
  }

  public void testEnumSupport() {
    MyInterface myInterface = new MyClass();
    myInterface.setType(MyInterface.MY_ENUM.TWO,
        true);
    boolean isType = MVEL.eval("isType(org.mvel2.tests.core.res.MyInterface$MY_ENUM.ONE)",
        myInterface,
        Boolean.class);
    System.out.println(isType);
View Full Code Here

Examples of test.implementation.util.support.MyInterface

      rmm.setManagedResource(resource, "ObjectReference");
      rmm.setModelMBeanInfo(resource.getMBeanInfo());
   
      server.registerMBean(rmm, oname);
     
      MyInterface mbean  = (MyInterface)MBeanProxy.get(
            MyInterface.class, oname, server
      );
     
      mbean.setAttributeName("foo");
      mbean.setAttributeName2("bar");
     
      assertTrue(mbean.getAttributeName2().equals("bar"));
      assertTrue(mbean.doOperation().equals("tamppi"));
   }
View Full Code Here

Examples of test.implementation.util.support.MyInterface

         }
      });
        
      server.unregisterMBean(oname);
     
      MyInterface mbean = (MyInterface)ctx;
      assertTrue(mbean.doOperation().equals("tamppi"));     
   }
View Full Code Here

Examples of test.implementation.util.support.MyInterface

      rmm.setManagedResource(resource, "ObjectReference");
      rmm.setModelMBeanInfo(resource.getMBeanInfo());
   
      server.registerMBean(rmm, oname);
     
      MyInterface mbean  = (MyInterface)MBeanProxy.get(
            MyInterface.class, oname, server
      );
     
      mbean.setAttributeName("foo");
      mbean.setAttributeName2("bar");
     
      assertTrue(mbean.getAttributeName2().equals("bar"));
      assertTrue(mbean.doOperation().equals("tamppi"));
   }
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.