Example usage for org.springframework.batch.core.jsr.configuration.xml JsrXmlApplicationContext JsrXmlApplicationContext

List of usage examples for org.springframework.batch.core.jsr.configuration.xml JsrXmlApplicationContext JsrXmlApplicationContext

Introduction

In this page you can find the example usage for org.springframework.batch.core.jsr.configuration.xml JsrXmlApplicationContext JsrXmlApplicationContext.

Prototype

public JsrXmlApplicationContext() 

Source Link

Document

Create a new context instance with no job parameters.

Usage

From source file:org.springframework.batch.core.jsr.configuration.xml.JsrBeanDefinitionDocumentReaderTests.java

@Test
public void testGetJobProperties() {
    Document document = getDocument("/META-INF/batch-jobs/jsrPropertyPreparseTestJob.xml");

    @SuppressWarnings("resource")
    JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext();
    JsrBeanDefinitionDocumentReader documentReader = new JsrBeanDefinitionDocumentReader(applicationContext);
    documentReader.initProperties(document.getDocumentElement());

    Properties documentJobProperties = documentReader.getJobProperties();
    assertNotNull(documentJobProperties);
    assertTrue("Wrong number of job properties", documentJobProperties.size() == 3);
    assertEquals("jobProperty1Value", documentJobProperties.getProperty("jobProperty1"));
    assertEquals("jobProperty1Value", documentJobProperties.getProperty("jobProperty2"));
    assertEquals("", documentJobProperties.getProperty("jobProperty3"));
}