congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
JsrXmlApplicationContext.getBeanDefinition
Code IndexAdd Tabnine to your IDE (free)

How to use
getBeanDefinition
method
in
org.springframework.batch.core.jsr.configuration.xml.JsrXmlApplicationContext

Best Java code snippets using org.springframework.batch.core.jsr.configuration.xml.JsrXmlApplicationContext.getBeanDefinition (Showing top 4 results out of 315)

origin: spring-projects/spring-batch

  @Test
  @SuppressWarnings("resource")
  public void testWithProperties() {
    Properties properties = new Properties();
    properties.put("prop1key", "prop1val");

    JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(properties);

    BeanDefinition beanDefinition = applicationContext.getBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME);
    Properties storedProperties = (Properties) beanDefinition.getConstructorArgumentValues().getGenericArgumentValue(Properties.class).getValue();

    assertNotNull("Properties should not be null", storedProperties);
    assertFalse("Properties not be empty", storedProperties.isEmpty());
    assertEquals("prop1val", storedProperties.getProperty("prop1key"));
  }
}
origin: spring-projects/spring-batch

@Test
@SuppressWarnings("resource")
public void testGetJobParameters() {
  Properties jobParameters = new Properties();
  jobParameters.setProperty("jobParameter1", "jobParameter1Value");
  jobParameters.setProperty("jobParameter2", "jobParameter2Value");
  JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(jobParameters);
  applicationContext.setValidating(false);
  applicationContext.load(new ClassPathResource("jsrBaseContext.xml"),
      new ClassPathResource("/META-INF/batch.xml"),
      new ClassPathResource("/META-INF/batch-jobs/jsrPropertyPreparseTestJob.xml"));
  applicationContext.refresh();
  BeanDefinition beanDefinition = applicationContext.getBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME);
  Properties processedJobParameters = (Properties) beanDefinition.getConstructorArgumentValues().getGenericArgumentValue(Properties.class).getValue();
  assertNotNull(processedJobParameters);
  assertTrue("Wrong number of job parameters", processedJobParameters.size() == 2);
  assertEquals("jobParameter1Value", processedJobParameters.getProperty("jobParameter1"));
  assertEquals("jobParameter2Value", processedJobParameters.getProperty("jobParameter2"));
}
origin: spring-projects/spring-batch

@Test
@SuppressWarnings("resource")
public void testNullProperties() {
  JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(null);
  BeanDefinition beanDefinition = applicationContext.getBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME);
  Properties properties = (Properties) beanDefinition.getConstructorArgumentValues().getGenericArgumentValue(Properties.class).getValue();
  assertNotNull("Properties should not be null", properties);
  assertTrue("Properties should be empty", properties.isEmpty());
}
origin: spring-projects/spring-batch

@Test
@SuppressWarnings("resource")
public void testGenerationOfSpringBeanDefinitionsForMultipleReferences() {
  JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(new Properties());
  applicationContext.setValidating(false);
  applicationContext.load(new ClassPathResource("jsrBaseContext.xml"),
      new ClassPathResource("/META-INF/batch-jobs/jsrSpringInstanceTests.xml"));
  applicationContext.refresh();
  assertTrue("exitStatusSettingStepListener bean definition not found", applicationContext.containsBeanDefinition("exitStatusSettingStepListener"));
  assertTrue("scopedTarget.exitStatusSettingStepListener bean definition not found", applicationContext.containsBeanDefinition("scopedTarget.exitStatusSettingStepListener"));
  BeanDefinition exitStatusSettingStepListenerBeanDefinition = applicationContext.getBeanDefinition("scopedTarget.exitStatusSettingStepListener");
  assertTrue("step".equals(exitStatusSettingStepListenerBeanDefinition.getScope()));
  assertTrue("Should not contain bean definition for exitStatusSettingStepListener1", !applicationContext.containsBeanDefinition("exitStatusSettingStepListener1"));
  assertTrue("Should not contain bean definition for exitStatusSettingStepListener2", !applicationContext.containsBeanDefinition("exitStatusSettingStepListener2"));
  assertTrue("Should not contain bean definition for exitStatusSettingStepListener3", !applicationContext.containsBeanDefinition("exitStatusSettingStepListener3"));
  assertTrue("Should not contain bean definition for testBatchlet1", !applicationContext.containsBeanDefinition("testBatchlet1"));
  assertTrue("Should not contain bean definition for testBatchlet2", !applicationContext.containsBeanDefinition("testBatchlet2"));
  assertTrue("testBatchlet bean definition not found", applicationContext.containsBeanDefinition("testBatchlet"));
  BeanDefinition testBatchletBeanDefinition = applicationContext.getBeanDefinition("testBatchlet");
  assertTrue("singleton".equals(testBatchletBeanDefinition.getScope()));
}
org.springframework.batch.core.jsr.configuration.xmlJsrXmlApplicationContextgetBeanDefinition

Popular methods of JsrXmlApplicationContext

  • <init>
    Create a new context instance using the provided Properties representing job parameters when pre-pr
  • close
  • getBean
  • load
    Load bean definitions from the given XML resources.
  • refresh
  • registerBeanDefinition
  • setValidating
    Set whether to use XML validation. Default is true.
  • getBeanNamesForType
  • isActive
  • setParent
  • getEnvironment
  • storeJobParameters
  • getEnvironment,
  • storeJobParameters,
  • getBeanFactory,
  • containsBeanDefinition

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JButton (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now