Examples of DefaultObjectFactory


Examples of net.sourceforge.stripes.controller.DefaultObjectFactory

                this.debugMode = false;
            }

            this.objectFactory = initObjectFactory();
            if (this.objectFactory == null) {
                this.objectFactory = new DefaultObjectFactory();
                this.objectFactory.init(this);
            }
            if (this.objectFactory instanceof DefaultObjectFactory) {
                List<Class<? extends ObjectPostProcessor>> classes = getBootstrapPropertyResolver()
                        .getClassPropertyList(ObjectPostProcessor.class);
View Full Code Here

Examples of net.sourceforge.stripes.controller.DefaultObjectFactory

    @Test(groups = "fast", dependsOnMethods = "testExplicitSetterInjection")
    public void testInjectionViaObjectPostProcessor() throws Exception {
        Configuration configuration = StripesTestFixture.getDefaultConfiguration();
        ServletContext sc = configuration.getServletContext();
        sc.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.ctx);
        DefaultObjectFactory factory = new DefaultObjectFactory();
        factory.init(configuration);
        factory.addPostProcessor(new SpringInjectionPostProcessor());
        PostProcessorTarget target = factory.newInstance(PostProcessorTarget.class);
        Assert.assertNotNull(target.getBean());
    }
View Full Code Here

Examples of org.apache.ibatis.reflection.factory.DefaultObjectFactory

   
  private Author author = new Author(999, "someone", "!@#@!#!@#", "someone@somewhere.com", "blah", Section.NEWS);

  @Test
  public void shouldSerializeAProxyForABeanWithDefaultConstructor() throws Exception {
    Object proxy = ResultObjectProxy.createProxy(author, new ResultLoaderMap(), true, new DefaultObjectFactory(), new ArrayList<Class>(), new ArrayList<Object>());
    Object proxy2 = deserialize(serialize((Serializable) proxy));
    assertEquals(author, proxy2);
  }
View Full Code Here

Examples of org.apache.ibatis.reflection.factory.DefaultObjectFactory

    argValues.add("someone");
    argValues.add("!@#@!#!@#");
    argValues.add("someone@somewhere.com");
    argValues.add("blah");
    argValues.add(Section.NEWS);
    Object proxy = ResultObjectProxy.createProxy(author, new ResultLoaderMap(), true, new DefaultObjectFactory(), argTypes, argValues);
    Object proxy2 = deserialize(serialize((Serializable) proxy));
    assertEquals(author, proxy2);
  }
View Full Code Here

Examples of org.apache.ibatis.reflection.factory.DefaultObjectFactory

    argValues.add("someone@somewhere.com");
    argValues.add("blah");
    argValues.add(Section.NEWS);
    ResultLoaderMap loader = new ResultLoaderMap();
    loader.addLoader("id", null, null);
    Object proxy = ResultObjectProxy.createProxy(author, loader, true, new DefaultObjectFactory(), argTypes, argValues);
    Object proxy2 = deserialize(serialize((Serializable) proxy));
    assertEquals(author, proxy2);
  }
View Full Code Here

Examples of org.apache.ibatis.reflection.factory.DefaultObjectFactory

    assertEquals(author, proxy2);
  }

  @Test
  public void shouldSerizaliceAFullLoadedObjectToOriginalClass() throws Exception {
    Object proxy = ResultObjectProxy.createProxy(author, new ResultLoaderMap(), true, new DefaultObjectFactory(), new ArrayList<Class>(), new ArrayList<Object>());
    Object proxy2 = deserialize(serialize((Serializable) proxy));
    assertEquals(author.getClass(), proxy2.getClass());
  }
View Full Code Here

Examples of org.apache.ibatis.reflection.factory.DefaultObjectFactory

  @Test(expected=ExecutorException.class)
  public void shouldFailCallingAnUnloadedProperty() throws Exception {
    // yes, it must go in uppercase
    HashSet<String> unloadedProperties = new HashSet<String>();
    unloadedProperties.add("ID");
    Author author2 = (Author) ResultObjectProxy.createDeserializationProxy(author, unloadedProperties, new DefaultObjectFactory(), new ArrayList<Class>(), new ArrayList<Object>());
    author2.getId();
  }
View Full Code Here

Examples of org.apache.ibatis.reflection.factory.DefaultObjectFactory

    author2.getId();
  }

  @Test
  public void shouldLetCallALoadedProperty() throws Exception {
    Author author2 = (Author) ResultObjectProxy.createDeserializationProxy(author, new HashSet<String>(), new DefaultObjectFactory(), new ArrayList<Class>(), new ArrayList<Object>());
    assertEquals(999, author2.getId());
  }
View Full Code Here

Examples of org.apache.ibatis.reflection.factory.DefaultObjectFactory

    assertEquals(999, author2.getId());
  }

  @Test
  public void shouldSerizalizeADeserlizaliedProxy() throws Exception {
    Object proxy = ResultObjectProxy.createDeserializationProxy(author, new HashSet<String>(), new DefaultObjectFactory(), new ArrayList<Class>(), new ArrayList<Object>());
    Author author2 = (Author) deserialize(serialize((Serializable) proxy));
    assertEquals(author, author2);
    assertFalse(author.getClass().equals(author2.getClass()));
  }
View Full Code Here

Examples of org.apache.ibatis.reflection.factory.DefaultObjectFactory

      author.getClass().getDeclaredMethod("writeReplace");
      fail("Author should not have a writeReplace method");
    } catch (NoSuchMethodException e) {
      // ok
    }
    Object proxy = ResultObjectProxy.createProxy(author, new ResultLoaderMap(), true, new DefaultObjectFactory(), new ArrayList<Class>(), new ArrayList<Object>());
    Method m = proxy.getClass().getDeclaredMethod("writeReplace");
  }
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.