Search in sources :

Example 1 with AbstractRefreshableTargetSource

use of org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource in project spring-framework by spring-projects.

the class ScriptingDefaultsTests method defaultRefreshCheckDelay.

@Test
public void defaultRefreshCheckDelay() throws Exception {
    ApplicationContext context = new ClassPathXmlApplicationContext(CONFIG);
    Advised advised = (Advised) context.getBean("testBean");
    AbstractRefreshableTargetSource targetSource = ((AbstractRefreshableTargetSource) advised.getTargetSource());
    Field field = AbstractRefreshableTargetSource.class.getDeclaredField("refreshCheckDelay");
    field.setAccessible(true);
    long delay = ((Long) field.get(targetSource)).longValue();
    assertEquals(5000L, delay);
}
Also used : Field(java.lang.reflect.Field) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ApplicationContext(org.springframework.context.ApplicationContext) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) Advised(org.springframework.aop.framework.Advised) AbstractRefreshableTargetSource(org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource) Test(org.junit.Test)

Aggregations

Field (java.lang.reflect.Field)1 Test (org.junit.Test)1 Advised (org.springframework.aop.framework.Advised)1 AbstractRefreshableTargetSource (org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource)1 ApplicationContext (org.springframework.context.ApplicationContext)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1