use of cucumber.runtime.java.spring.beans.BellyBean in project cucumber-jvm by cucumber.
the class SpringFactoryTest method shouldRespectDirtiesContextAnnotationsInStepDefsUsingMetaConfiguration.
@Test
public void shouldRespectDirtiesContextAnnotationsInStepDefsUsingMetaConfiguration() {
final ObjectFactory factory = new SpringFactory();
factory.addClass(DirtiesContextBellyMetaStepDefs.class);
// Scenario 1
factory.start();
final BellyBean o1 = factory.getInstance(DirtiesContextBellyMetaStepDefs.class).getBellyBean();
factory.stop();
// Scenario 2
factory.start();
final BellyBean o2 = factory.getInstance(DirtiesContextBellyMetaStepDefs.class).getBellyBean();
factory.stop();
assertNotNull(o1);
assertNotNull(o2);
assertNotSame(o1, o2);
}
use of cucumber.runtime.java.spring.beans.BellyBean in project cucumber-jvm by cucumber.
the class SpringFactoryTest method shouldRespectDirtiesContextAnnotationsInStepDefs.
@Test
public void shouldRespectDirtiesContextAnnotationsInStepDefs() {
final ObjectFactory factory = new SpringFactory();
factory.addClass(DirtiesContextBellyStepDefs.class);
// Scenario 1
factory.start();
final BellyBean o1 = factory.getInstance(DirtiesContextBellyStepDefs.class).getBellyBean();
factory.stop();
// Scenario 2
factory.start();
final BellyBean o2 = factory.getInstance(DirtiesContextBellyStepDefs.class).getBellyBean();
factory.stop();
assertNotNull(o1);
assertNotNull(o2);
assertNotSame(o1, o2);
}
use of cucumber.runtime.java.spring.beans.BellyBean in project cucumber-jvm by cucumber.
the class SpringFactoryTest method shouldNeverCreateNewApplicationBeanInstancesUsingMetaConfiguration.
@Test
public void shouldNeverCreateNewApplicationBeanInstancesUsingMetaConfiguration() {
// Feature 1
final ObjectFactory factory1 = new SpringFactory();
factory1.addClass(BellyMetaStepdefs.class);
factory1.start();
final BellyBean o1 = factory1.getInstance(BellyMetaStepdefs.class).getBellyBean();
factory1.stop();
// Feature 2
final ObjectFactory factory2 = new SpringFactory();
factory2.addClass(BellyMetaStepdefs.class);
factory2.start();
final BellyBean o2 = factory2.getInstance(BellyMetaStepdefs.class).getBellyBean();
factory2.stop();
assertNotNull(o1);
assertNotNull(o2);
assertSame(o1, o2);
}
use of cucumber.runtime.java.spring.beans.BellyBean in project cucumber-jvm by cucumber.
the class SpringFactoryTest method shouldNeverCreateNewApplicationBeanInstances.
@Test
public void shouldNeverCreateNewApplicationBeanInstances() {
// Feature 1
final ObjectFactory factory1 = new SpringFactory();
factory1.addClass(BellyStepdefs.class);
factory1.start();
final BellyBean o1 = factory1.getInstance(BellyStepdefs.class).getBellyBean();
factory1.stop();
// Feature 2
final ObjectFactory factory2 = new SpringFactory();
factory2.addClass(BellyStepdefs.class);
factory2.start();
final BellyBean o2 = factory2.getInstance(BellyStepdefs.class).getBellyBean();
factory2.stop();
assertNotNull(o1);
assertNotNull(o2);
assertSame(o1, o2);
}
Aggregations