本文整理汇总了Java中com.arjuna.common.internal.util.propertyservice.BeanPopulator类的典型用法代码示例。如果您正苦于以下问题:Java BeanPopulator类的具体用法?Java BeanPopulator怎么用?Java BeanPopulator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BeanPopulator类属于com.arjuna.common.internal.util.propertyservice包,在下文中一共展示了BeanPopulator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPopulator
import com.arjuna.common.internal.util.propertyservice.BeanPopulator; //导入依赖的package包/类
private <T> T getPopulator(Class<T> beanClass) {
return BeanPopulator.getDefaultInstance(beanClass);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:NarayanaConfigurationBean.java
示例2: cleanup
import com.arjuna.common.internal.util.propertyservice.BeanPopulator; //导入依赖的package包/类
@After
@SuppressWarnings("unchecked")
public void cleanup() {
((Map<String, Object>) ReflectionTestUtils.getField(BeanPopulator.class,
"beanInstances")).clear();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:NarayanaConfigurationBeanTests.java
示例3: shouldSetDefaultProperties
import com.arjuna.common.internal.util.propertyservice.BeanPopulator; //导入依赖的package包/类
@Test
public void shouldSetDefaultProperties() throws Exception {
NarayanaProperties narayanaProperties = new NarayanaProperties();
NarayanaConfigurationBean narayanaConfigurationBean = new NarayanaConfigurationBean(
narayanaProperties);
narayanaConfigurationBean.afterPropertiesSet();
assertThat(BeanPopulator.getDefaultInstance(CoreEnvironmentBean.class)
.getNodeIdentifier()).isEqualTo("1");
assertThat(BeanPopulator.getDefaultInstance(ObjectStoreEnvironmentBean.class)
.getObjectStoreDir()).endsWith("ObjectStore");
assertThat(BeanPopulator
.getNamedInstance(ObjectStoreEnvironmentBean.class, "communicationStore")
.getObjectStoreDir()).endsWith("ObjectStore");
assertThat(BeanPopulator
.getNamedInstance(ObjectStoreEnvironmentBean.class, "stateStore")
.getObjectStoreDir()).endsWith("ObjectStore");
assertThat(BeanPopulator.getDefaultInstance(CoordinatorEnvironmentBean.class)
.isCommitOnePhase()).isTrue();
assertThat(BeanPopulator.getDefaultInstance(CoordinatorEnvironmentBean.class)
.getDefaultTimeout()).isEqualTo(60);
assertThat(BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class)
.getPeriodicRecoveryPeriod()).isEqualTo(120);
assertThat(BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class)
.getRecoveryBackoffPeriod()).isEqualTo(10);
List<String> xaResourceOrphanFilters = Arrays.asList(
"com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter",
"com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter");
assertThat(BeanPopulator.getDefaultInstance(JTAEnvironmentBean.class)
.getXaResourceOrphanFilterClassNames())
.isEqualTo(xaResourceOrphanFilters);
List<String> recoveryModules = Arrays.asList(
"com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule",
"com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule");
assertThat(BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class)
.getRecoveryModuleClassNames()).isEqualTo(recoveryModules);
List<String> expiryScanners = Arrays.asList(
"com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner");
assertThat(BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class)
.getExpiryScannerClassNames()).isEqualTo(expiryScanners);
assertThat(BeanPopulator.getDefaultInstance(JTAEnvironmentBean.class)
.getXaResourceRecoveryClassNames()).isEmpty();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:48,代码来源:NarayanaConfigurationBeanTests.java
示例4: shouldSetModifiedProperties
import com.arjuna.common.internal.util.propertyservice.BeanPopulator; //导入依赖的package包/类
@Test
public void shouldSetModifiedProperties() throws Exception {
NarayanaProperties narayanaProperties = new NarayanaProperties();
narayanaProperties.setTransactionManagerId("test-id");
narayanaProperties.setLogDir("test-dir");
narayanaProperties.setDefaultTimeout(1);
narayanaProperties.setPeriodicRecoveryPeriod(2);
narayanaProperties.setRecoveryBackoffPeriod(3);
narayanaProperties.setOnePhaseCommit(false);
narayanaProperties.setXaResourceOrphanFilters(
Arrays.asList("test-filter-1", "test-filter-2"));
narayanaProperties
.setRecoveryModules(Arrays.asList("test-module-1", "test-module-2"));
narayanaProperties
.setExpiryScanners(Arrays.asList("test-scanner-1", "test-scanner-2"));
NarayanaConfigurationBean narayanaConfigurationBean = new NarayanaConfigurationBean(
narayanaProperties);
narayanaConfigurationBean.afterPropertiesSet();
assertThat(BeanPopulator.getDefaultInstance(CoreEnvironmentBean.class)
.getNodeIdentifier()).isEqualTo("test-id");
assertThat(BeanPopulator.getDefaultInstance(ObjectStoreEnvironmentBean.class)
.getObjectStoreDir()).isEqualTo("test-dir");
assertThat(BeanPopulator
.getNamedInstance(ObjectStoreEnvironmentBean.class, "communicationStore")
.getObjectStoreDir()).isEqualTo("test-dir");
assertThat(BeanPopulator
.getNamedInstance(ObjectStoreEnvironmentBean.class, "stateStore")
.getObjectStoreDir()).isEqualTo("test-dir");
assertThat(BeanPopulator.getDefaultInstance(CoordinatorEnvironmentBean.class)
.isCommitOnePhase()).isFalse();
assertThat(BeanPopulator.getDefaultInstance(CoordinatorEnvironmentBean.class)
.getDefaultTimeout()).isEqualTo(1);
assertThat(BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class)
.getPeriodicRecoveryPeriod()).isEqualTo(2);
assertThat(BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class)
.getRecoveryBackoffPeriod()).isEqualTo(3);
assertThat(BeanPopulator.getDefaultInstance(JTAEnvironmentBean.class)
.getXaResourceOrphanFilterClassNames())
.isEqualTo(Arrays.asList("test-filter-1", "test-filter-2"));
assertThat(BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class)
.getRecoveryModuleClassNames())
.isEqualTo(Arrays.asList("test-module-1", "test-module-2"));
assertThat(BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class)
.getExpiryScannerClassNames())
.isEqualTo(Arrays.asList("test-scanner-1", "test-scanner-2"));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:49,代码来源:NarayanaConfigurationBeanTests.java
示例5: setUp
import com.arjuna.common.internal.util.propertyservice.BeanPopulator; //导入依赖的package包/类
@BeforeClass
public static void setUp() throws Exception {
Hashtable props = JndiProvider.start();
initialContext = new InitialContext(props);
initEnv();
BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class).setRecoveryBackoffPeriod(1);
}