use of org.springframework.core.testfixture.EnabledForTestGroups in project spring-framework by spring-projects.
the class EnableSchedulingTests method withTriggerTask.
@Test
@EnabledForTestGroups(LONG_RUNNING)
public void withTriggerTask() throws InterruptedException {
ctx = new AnnotationConfigApplicationContext(TriggerTaskConfig.class);
Thread.sleep(100);
assertThat(ctx.getBean(AtomicInteger.class).get()).isGreaterThan(1);
}
use of org.springframework.core.testfixture.EnabledForTestGroups in project spring-framework by spring-projects.
the class BeanFactoryGenericsTests method testSetBean.
@Test
@EnabledForTestGroups(LONG_RUNNING)
void testSetBean() throws Exception {
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
new XmlBeanDefinitionReader(bf).loadBeanDefinitions(new ClassPathResource("genericBeanTests.xml", getClass()));
UrlSet us = (UrlSet) bf.getBean("setBean");
assertThat(us.size()).isEqualTo(1);
assertThat(us.iterator().next()).isEqualTo(new URL("https://www.springframework.org"));
}
use of org.springframework.core.testfixture.EnabledForTestGroups in project spring-framework by spring-projects.
the class QuartzSupportTests method twoAnonymousMethodInvokingJobDetailFactoryBeans.
@Test
@EnabledForTestGroups(LONG_RUNNING)
void twoAnonymousMethodInvokingJobDetailFactoryBeans() throws Exception {
try (ClassPathXmlApplicationContext ctx = context("multipleAnonymousMethodInvokingJobDetailFB.xml")) {
QuartzTestBean exportService = (QuartzTestBean) ctx.getBean("exportService");
QuartzTestBean importService = (QuartzTestBean) ctx.getBean("importService");
Thread.sleep(400);
assertThat(exportService.getImportCount()).as("doImport called exportService").isEqualTo(0);
assertThat(exportService.getExportCount()).as("doExport not called on exportService").isEqualTo(2);
assertThat(importService.getImportCount()).as("doImport not called on importService").isEqualTo(2);
assertThat(importService.getExportCount()).as("doExport called on importService").isEqualTo(0);
}
}
use of org.springframework.core.testfixture.EnabledForTestGroups in project spring-framework by spring-projects.
the class QuartzSupportTests method schedulerWithSpringBeanJobFactoryAndParamMismatchNotIgnored.
@Test
@EnabledForTestGroups(LONG_RUNNING)
void schedulerWithSpringBeanJobFactoryAndParamMismatchNotIgnored() throws Exception {
DummyJob.param = 0;
DummyJob.count = 0;
JobDetailImpl jobDetail = new JobDetailImpl();
jobDetail.setDurability(true);
jobDetail.setJobClass(DummyJob.class);
jobDetail.setName("myJob");
jobDetail.getJobDataMap().put("para", "10");
jobDetail.getJobDataMap().put("ignoredParam", "10");
SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
trigger.setName("myTrigger");
trigger.setJobDetail(jobDetail);
trigger.setStartDelay(1);
trigger.setRepeatInterval(500);
trigger.setRepeatCount(1);
trigger.afterPropertiesSet();
SchedulerFactoryBean bean = new SchedulerFactoryBean();
SpringBeanJobFactory jobFactory = new SpringBeanJobFactory();
jobFactory.setIgnoredUnknownProperties("ignoredParam");
bean.setJobFactory(jobFactory);
bean.setTriggers(trigger.getObject());
bean.setJobDetails(jobDetail);
bean.afterPropertiesSet();
Thread.sleep(500);
assertThat(DummyJob.param).isEqualTo(0);
assertThat(DummyJob.count == 0).isTrue();
bean.destroy();
}
use of org.springframework.core.testfixture.EnabledForTestGroups in project spring-framework by spring-projects.
the class DelegatingWebConnectionTests method verifyExampleInClassLevelJavadoc.
@Test
@EnabledForTestGroups(LONG_RUNNING)
public void verifyExampleInClassLevelJavadoc() throws Exception {
WebClient webClient = new WebClient();
MockMvc mockMvc = MockMvcBuilders.standaloneSetup().build();
MockMvcWebConnection mockConnection = new MockMvcWebConnection(mockMvc, webClient);
WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
WebConnection httpConnection = new HttpWebConnection(webClient);
webClient.setWebConnection(new DelegatingWebConnection(mockConnection, new DelegateWebConnection(cdnMatcher, httpConnection)));
Page page = webClient.getPage("https://code.jquery.com/jquery-1.11.0.min.js");
assertThat(page.getWebResponse().getStatusCode()).isEqualTo(200);
assertThat(page.getWebResponse().getContentAsString()).isNotEmpty();
}
Aggregations