Package com.foreach.across.test.modules.properties

Examples of com.foreach.across.test.modules.properties.SetPropertyConfig


  @Autowired
  private AcrossContextInfo contextInfo;

  @Test
  public void checkPropertiesSet() {
    SetPropertyConfig config = contextBeanRegistry.getBeanOfTypeFromModule( "onlyFromContext",
                                                                            SetPropertyConfig.class );

    assertNotNull( config );
    assertEquals( "acrossContext", config.contextValue );
    assertEquals( "acrossContext", config.moduleSourceValue );
    assertEquals( "acrossContext", config.moduleDirectValue );
    assertEquals( 777, config.contextDirectValue );
    assertEquals( 50, config.unresolvable );
    assertEquals( "acrossContext", config.getProperty( "contextValue" ) );
    assertEquals( "acrossContext", config.getProperty( "moduleSourceValue" ) );
    assertEquals( "acrossContext", config.getProperty( "moduleDirectValue" ) );
    assertEquals( new Integer( 777 ), config.getProperty( "contextDirectValue", Integer.class ) );

    config = contextBeanRegistry.getBeanOfTypeFromModule( "sourceOnModule", SetPropertyConfig.class );

    assertNotNull( config );
    assertEquals( "acrossContext", config.contextValue );
    assertEquals( "acrossModule", config.moduleSourceValue );
    assertEquals( "acrossModule", config.moduleDirectValue );
    assertEquals( 777, config.contextDirectValue );
    assertEquals( 50, config.unresolvable );
    assertEquals( "acrossContext", config.getProperty( "contextValue" ) );
    assertEquals( "acrossModule", config.getProperty( "moduleSourceValue" ) );
    assertEquals( "acrossModule", config.getProperty( "moduleDirectValue" ) );
    assertEquals( new Integer( 777 ), config.getProperty( "contextDirectValue", Integer.class ) );

    config = contextBeanRegistry.getBeanOfTypeFromModule( "directOnModule", SetPropertyConfig.class );

    assertNotNull( config );

    assertEquals( "acrossContext", config.contextValue );
    assertEquals( "acrossModule", config.moduleSourceValue );
    assertEquals( "directValue", config.moduleDirectValue );
    assertEquals( 777, config.contextDirectValue );
    assertEquals( 100, config.unresolvable );
    assertEquals( "acrossContext", config.getProperty( "contextValue" ) );
    assertEquals( "acrossModule", config.getProperty( "moduleSourceValue" ) );
    assertEquals( "directValue", config.getProperty( "moduleDirectValue" ) );
    assertEquals( new Integer( 777 ), config.getProperty( "contextDirectValue", Integer.class ) );

    assertEquals( "default", config.getProperty( "defaultOnlyValue" ) );
    assertEquals( "applicationContext", config.getProperty( "parentContextValue" ) );
  }
View Full Code Here

TOP

Related Classes of com.foreach.across.test.modules.properties.SetPropertyConfig

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.