Examples of ComponentDefinition


Examples of org.apache.tiles.definition.ComponentDefinition

    private DefinitionManager mgr = new DefinitionManager();

    public void register(TileDefinition definition)
        throws TilesException {
        ComponentDefinition def = new ComponentDefinition(definition);
        mgr.addDefinition(def);
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ComponentDefinition

        EasyMock.expect(mockRegistry.load(EasyMock.isA(CompositeComponent.class),
            EasyMock.eq(mockReader),
            EasyMock.isA(DeploymentContext.class))).andReturn(IMPL);
        EasyMock.replay(mockRegistry);
        ComponentDefinition component = loader.load(EasyMock.createNiceMock(CompositeComponent.class),
            mockReader,
            EasyMock.createNiceMock(DeploymentContext.class));
        assertEquals(NAME, component.getName());
        assertNull(component.getInitLevel());
    }
View Full Code Here

Examples of org.glassfish.apf.impl.ComponentDefinition

        Set<LifecycleCallbackDescriptor> postActivateDescriptors =
            new HashSet<LifecycleCallbackDescriptor>();
        Set<LifecycleCallbackDescriptor> prePassivateDescriptors =
            new HashSet<LifecycleCallbackDescriptor>();
       
        ComponentDefinition cdef = new ComponentDefinition(interceptorClass);
        for(Method m : cdef.getMethods()) {
            if( m.getAnnotation(AroundInvoke.class) != null ) {
                aroundInvokeDescriptors.add(getLifecycleCallbackDescriptor(m));
            }
            if( m.getAnnotation(AroundTimeout.class) != null ) {
                aroundTimeoutDescriptors.add(getLifecycleCallbackDescriptor(m));
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ComponentDefinition

    assertEquals("true", defaults.getMerge());
    assertTrue(defaults.getSource() instanceof Element);
  }

  public void testBeanEventReceived() throws Exception {
    ComponentDefinition componentDefinition1 = this.eventListener.getComponentDefinition("testBean");
    assertTrue(componentDefinition1 instanceof BeanComponentDefinition);
    assertEquals(1, componentDefinition1.getBeanDefinitions().length);
    BeanDefinition beanDefinition1 = componentDefinition1.getBeanDefinitions()[0];
    assertEquals(new TypedStringValue("Rob Harrop"),
        beanDefinition1.getConstructorArgumentValues().getGenericArgumentValue(String.class).getValue());
    assertEquals(1, componentDefinition1.getBeanReferences().length);
    assertEquals("testBean2", componentDefinition1.getBeanReferences()[0].getBeanName());
    assertEquals(1, componentDefinition1.getInnerBeanDefinitions().length);
    BeanDefinition innerBd1 = componentDefinition1.getInnerBeanDefinitions()[0];
    assertEquals(new TypedStringValue("ACME"),
        innerBd1.getConstructorArgumentValues().getGenericArgumentValue(String.class).getValue());
    assertTrue(componentDefinition1.getSource() instanceof Element);

    ComponentDefinition componentDefinition2 = this.eventListener.getComponentDefinition("testBean2");
    assertTrue(componentDefinition2 instanceof BeanComponentDefinition);
    assertEquals(1, componentDefinition1.getBeanDefinitions().length);
    BeanDefinition beanDefinition2 = componentDefinition2.getBeanDefinitions()[0];
    assertEquals(new TypedStringValue("Juergen Hoeller"),
        beanDefinition2.getPropertyValues().getPropertyValue("name").getValue());
    assertEquals(0, componentDefinition2.getBeanReferences().length);
    assertEquals(1, componentDefinition2.getInnerBeanDefinitions().length);
    BeanDefinition innerBd2 = componentDefinition2.getInnerBeanDefinitions()[0];
    assertEquals(new TypedStringValue("Eva Schallmeiner"),
        innerBd2.getPropertyValues().getPropertyValue("name").getValue());
    assertTrue(componentDefinition2.getSource() instanceof Element);
  }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ComponentDefinition

    Integer max = (Integer) this.beanFactory.getBean("java.lang.Integer.MAX_VALUE");
    assertEquals(Integer.MAX_VALUE, max.intValue());
  }

  public void testEvents() throws Exception {
    ComponentDefinition propertiesComponent = this.listener.getComponentDefinition("myProperties");
    assertNotNull("Event for 'myProperties' not sent", propertiesComponent);
    AbstractBeanDefinition propertiesBean = (AbstractBeanDefinition) propertiesComponent.getBeanDefinitions()[0];
    assertEquals("Incorrect BeanDefinition", PropertiesFactoryBean.class, propertiesBean.getBeanClass());

    ComponentDefinition constantComponent = this.listener.getComponentDefinition("min");
    assertNotNull("Event for 'min' not sent", propertiesComponent);
    AbstractBeanDefinition constantBean = (AbstractBeanDefinition) constantComponent.getBeanDefinitions()[0];
    assertEquals("Incorrect BeanDefinition", FieldRetrievingFactoryBean.class, constantBean.getBeanClass());
  }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ComponentDefinition

  }

  public void testSourceExtraction() {
    Iterator iterator = context.getRegisteredComponents();
    while (iterator.hasNext()) {
      ComponentDefinition compDef = (ComponentDefinition) iterator.next();
      if (compDef instanceof CompositeComponentDefinition) {
        assertNotNull("CompositeComponentDefinition '" + compDef.getName()+ "' has no source attachment", ((CompositeComponentDefinition) compDef).getSource());
      }
      validateComponentDefinition(compDef);
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ComponentDefinition

    reader.setEventListener(this.eventListener);
    reader.loadBeanDefinitions(new ClassPathResource("txNamespaceHandlerTests.xml", getClass()));
  }

  public void testComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("txAdvice");
    assertTrue(component instanceof BeanComponentDefinition);
  }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ComponentDefinition

    }
   
    public boolean containsComponentDefinition(String name) {
      Iterator iterator = REGISTERED_COMPONENTS.iterator();
      while (iterator.hasNext()) {
        ComponentDefinition cd = (ComponentDefinition) iterator.next();
        if (cd instanceof CompositeComponentDefinition) {
          ComponentDefinition[] innerCds = ((CompositeComponentDefinition) cd)
              .getNestedComponents();
          for (int i = 0; i < innerCds.length; i++) {
            if (innerCds[i].getName().equals(name)) {
              return true;
            }
          }
        }
        else {
          if (cd.getName().equals(name)) {
            return true;
          }
        }
      }
      return false;
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ComponentDefinition

    this.reader.setEventListener(this.eventListener);
    this.reader.loadBeanDefinitions(new ClassPathResource("jeeNamespaceHandlerTests.xml", getClass()));
  }

  public void testJndiLookupComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("simple");
    assertTrue(component instanceof BeanComponentDefinition);
  }
View Full Code Here

Examples of org.springframework.beans.factory.parsing.ComponentDefinition

    ComponentDefinition component = this.eventListener.getComponentDefinition("simple");
    assertTrue(component instanceof BeanComponentDefinition);
  }

  public void testLocalSlsbComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("simpleLocalEjb");
    assertTrue(component instanceof BeanComponentDefinition);
  }
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.