Examples of Bean


Examples of org.apache.hivemind.schema.rules.Bean

        SchemaProcessor processor = (SchemaProcessor) control.getMock();

        processor.getDefiningModule();
        control.setReturnValue(module);

        processor.push(new Bean());
        control.setMatcher(new AggregateArgumentsMatcher(new ArgumentMatcher()
        {
            public boolean compareArguments(Object expected, Object actual)
            {
                Bean b = (Bean) actual;

                assertEquals("HiveMind", b.getValue());
                assertSame(l, b.getLocation());

                return true;
            }
        }));
View Full Code Here

Examples of org.apache.myfaces.test.mock.data.Bean

    public void testRenderButtonWithValueBinding() throws IOException
    {
        ValueBinding vb = facesContext.getApplication().createValueBinding(
                "#{ bean.name }");

        Bean bean = new Bean();
        bean.setName("Matthias");

        facesContext.getExternalContext().getRequestMap().put("bean", bean);

        assertEquals("Matthias", vb.getValue(facesContext).toString());

        vb = facesContext.getApplication().createValueBinding(
                "#{requestScope['bean']}");

        Bean copy = (Bean) vb.getValue(facesContext);
        assertNotNull(copy);
        assertTrue(bean == copy);

        facesContext.getExternalContext().getRequestMap().put(
                "org.apache.shale.bean", bean);
View Full Code Here

Examples of org.apache.niolex.commons.test.Benchmark.Bean

    public A() {
      map.put(1, "Good");
      smap.put("test", "but");
      smap.put("this.[is].good", "See You!");
      bmap.put("b", new Bean(3, "Bean", 12212, new Date()));
      bmap.put("c", Benchmark.makeBenchmark());
      bmap.put("invoke", new B());
      bmap.put("os", new OSInfo());
      imap.put(new Date(), new Bean(3, "Bean", 12212, new Date()));
      set.add("Goog Morning");
      set.add("This is Good");
      set.add("中文");
    }
View Full Code Here

Examples of org.apache.shale.test.mock.data.Bean

 
  public void testRenderButtonWithValueBinding() throws IOException {
    ValueBinding vb= facesContext.getApplication().
                     createValueBinding("#{ bean.name }");

    Bean bean = new Bean();
    bean.setName("Matthias");
   
    facesContext.getExternalContext().getRequestMap().put("bean",
        bean);
   
    assertEquals("Matthias", vb.getValue(facesContext).toString());
   
    vb = facesContext.getApplication().createValueBinding("#{requestScope['bean']}");
   
    Bean copy = (Bean) vb.getValue(facesContext);
    assertNotNull(copy);
    assertTrue(bean == copy);

    facesContext.getExternalContext().getRequestMap().put("org.apache.shale.bean",
            bean);
View Full Code Here

Examples of org.apache.shale.tiger.managed.Bean

    private void scanClass(Class clazz, FacesConfigConfig config) {

        if (log().isTraceEnabled()) {
            log().trace("Scanning class '" + clazz.getName() + "'");
        }
        Bean bean = (Bean) clazz.getAnnotation(Bean.class);
        if (bean != null) {
            if (log().isDebugEnabled()) {
                log().debug("Class '" + clazz.getName() + "' has an @Bean annotation");
            }
            ManagedBeanConfig mbc = new ManagedBeanConfig();
            mbc.setName(bean.name());
            mbc.setType(clazz.getName());
            switch (bean.scope()) {
                case APPLICATION:
                    mbc.setScope("application");
                    break;
                case REQUEST:
                    mbc.setScope("request");
View Full Code Here

Examples of org.apache.soap.util.Bean

    Iterator it = objects.iterator();

    Object o;
    // assumethat there was one object encoded at most
    if( it.hasNext() )
      return new Bean((o=it.next()).getClass(), o);
    else
      throw new IllegalArgumentException("Unable to unmarshall XMI-encoded " +
                                         "object.");
                           
  }
View Full Code Here

Examples of org.apache.soap.util.Bean

    if (elTypeNS != null && elTypeLP != null) {
      qname = new QName (elTypeNS, elTypeLP);
    }

    return new Bean (TypeMapping.class,
                     new TypeMapping (encodingStyle,
                                      qname,
                                      javaType,
                                      java2XMLClassName, xml2JavaClassName));
  }
View Full Code Here

Examples of org.apache.soap.util.Bean

       throws SOAPException {
    try {
      BSFManager mgr = (BSFManager) target;
      BSFEngine eng = mgr.loadScriptingEngine (dd.getScriptLanguage ());
      Object result = eng.call (null, methodName, args);
      return new Bean ((result != null) ? result.getClass () : Object.class,
                       result);
    } catch (BSFException e) {
      throw new SOAPException (Constants.FAULT_CODE_SERVER,
                               "BSF Error: " + e.getMessage (), e);
    }
View Full Code Here

Examples of org.apache.soap.util.Bean

    String prefix = value.substring(0,idx);
    String uri = DOMUtils.getNamespaceURIFromPrefix(src, prefix);
   
    QName qName = new QName(uri, value.substring(idx + 1));

    return new Bean(QName.class, qName);
 
View Full Code Here

Examples of org.apache.soap.util.Bean

      respEncStyle = Constants.NS_URI_SOAP_ENC;
    }
   
    // invoke the method (directly for Java and via InvokeBSF for script
    // methods)
    Bean result = null;
    try {
      if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
          providerType == DeploymentDescriptor.PROVIDER_USER_DEFINED) {
        Method m = null ;
        try {
          m = MethodUtils.getMethod (targetObject,
                                     call.getMethodName(),
                                     argTypes);
        } catch (NoSuchMethodException e) {
          try {
            int paramsCount = 0 ;
            if ( params != null ) paramsCount = params.size();
            Class[]   tmpArgTypes = new Class[paramsCount+1];
            Object[]  tmpArgs     = new Object[paramsCount+1];
            for ( int i = 0 ; i < paramsCount ; i++ )
              tmpArgTypes[i+1] = argTypes[i] ;
            argTypes = tmpArgTypes ;
            argTypes[0] = SOAPContext.class ;
            m = MethodUtils.getMethod (targetObject,call.getMethodName(),
                                       argTypes);
            for ( int i = 0 ; i < paramsCount ; i++ )
              tmpArgs[i+1] = args[i] ;
            tmpArgs[0] = reqCtx ;
            args = tmpArgs ;
          } catch (NoSuchMethodException e2) {
            /*
              Don't want the "No Signature Match" error message to include
              the SOAPContext argument.
            */
            throw e;
          } catch (Exception e2) {
            throw e2;
          }
        } catch (Exception e) {
          throw e;
        }

        result = new Bean (m.getReturnType (), m.invoke (targetObject, args));
      } else {
        // find the class that provides the BSF services (done
        // this way via reflection to avoid a compile-time dependency on BSF)
        Class bc = Class.forName ("org.apache.soap.server.InvokeBSF");

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.