Tabnine Logo
JsrXmlApplicationContext.setValidating
Code IndexAdd Tabnine to your IDE (free)

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

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

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
public void testJobParametersResolution() {
  Properties jobParameters = new Properties();
  jobParameters.setProperty("jobParameter1", "myfile.txt");
  jobParameters.setProperty("jobParameter2", "#{jobProperties['jobProperty2']}");
  jobParameters.setProperty("jobParameter3", "#{jobParameters['jobParameter1']}");
  @SuppressWarnings("resource")
  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();
  Document document = getDocument("/META-INF/batch-jobs/jsrPropertyPreparseTestJob.xml");
  JsrBeanDefinitionDocumentReader documentReader = new JsrBeanDefinitionDocumentReader(applicationContext);
  documentReader.initProperties(document.getDocumentElement());
  Properties resolvedParameters = documentReader.getJobParameters();
  assertNotNull(resolvedParameters);
  assertTrue("Wrong number of job parameters", resolvedParameters.size() == 3);
  assertEquals("myfile.txt", resolvedParameters.getProperty("jobParameter1"));
  assertEquals("jobProperty1Value", resolvedParameters.getProperty("jobParameter2"));
  assertEquals("myfile.txt", resolvedParameters.getProperty("jobParameter3"));
}
origin: spring-projects/spring-batch

JobSecurityException {
  final JsrXmlApplicationContext batchContext = new JsrXmlApplicationContext(params);
  batchContext.setValidating(false);
origin: spring-projects/spring-batch

@Test
public void testJobPropertyResolution() {
  Properties jobParameters = new Properties();
  jobParameters.setProperty("file.name", "myfile.txt");
  @SuppressWarnings("resource")
  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();
  Document document = getDocument("/META-INF/batch-jobs/jsrPropertyPreparseTestJob.xml");
  JsrBeanDefinitionDocumentReader documentReader = new JsrBeanDefinitionDocumentReader(applicationContext);
  documentReader.initProperties(document.getDocumentElement());
  Properties resolvedProperties = documentReader.getJobProperties();
  assertNotNull(resolvedProperties);
  assertTrue("Wrong number of job properties", resolvedProperties.size() == 3);
  assertEquals("jobProperty1Value", resolvedProperties.getProperty("jobProperty1"));
  assertEquals("jobProperty1Value", resolvedProperties.getProperty("jobProperty2"));
  assertEquals("myfile.txt", resolvedProperties.getProperty("jobProperty3"));
}
origin: spring-projects/spring-batch

  @Test
  @SuppressWarnings({"resource", "rawtypes"})
  public void testOverrideBeansLast() {
    JsrXmlApplicationContext context = new JsrXmlApplicationContext();
    Resource overrideXml = new ClassPathResource("/org/springframework/batch/core/jsr/configuration/xml/override_batch.xml");
    Resource batchXml = new ClassPathResource("/org/springframework/batch/core/jsr/configuration/xml/batch.xml");

    context.setValidating(false);
    context.load(batchXml, overrideXml);
    context.refresh();

    ItemProcessor processor = (ItemProcessor) context.getBean("itemProcessor");

    assertNotNull(processor);
    assertTrue(processor instanceof DummyItemProcessor);
    context.close();
  }
}
origin: spring-projects/spring-batch

batchContext.setValidating(false);
origin: spring-projects/spring-batch

@Test
@SuppressWarnings("unchecked")
public void testOverrideBeansFirst() throws Exception {
  JsrXmlApplicationContext context = new JsrXmlApplicationContext();
  Resource overrideXml = new ClassPathResource("/org/springframework/batch/core/jsr/configuration/xml/override_batch.xml");
  Resource batchXml = new ClassPathResource("/org/springframework/batch/core/jsr/configuration/xml/batch.xml");
  context.setValidating(false);
  context.load(overrideXml, batchXml);
  context.refresh();
  ItemProcessor<String, String> itemProcessor = context.getBean("itemProcessor", ItemProcessor.class);
  assertNotNull(itemProcessor);
  StepSynchronizationManager.register(new StepExecution("step1", new JobExecution(5l)));
  assertEquals("Test", itemProcessor.process("Test"));
  StepSynchronizationManager.close();
  context.close();
}
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()));
}
origin: spring-projects/spring-batch

@SuppressWarnings("resource")
@Test
public void testGenerationOfBeanDefinitionsForMultipleReferences() throws Exception {
  JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(new Properties());
  applicationContext.setValidating(false);
  applicationContext.load(new ClassPathResource("jsrBaseContext.xml"),
      new ClassPathResource("/META-INF/batch.xml"),
      new ClassPathResource("/META-INF/batch-jobs/jsrUniqueInstanceTests.xml"));
  applicationContext.refresh();
  assertTrue("exitStatusSettingStepListener bean definition not found", applicationContext.containsBeanDefinition("exitStatusSettingStepListener"));
  assertTrue("exitStatusSettingStepListener1 bean definition not found", applicationContext.containsBeanDefinition("exitStatusSettingStepListener1"));
  assertTrue("exitStatusSettingStepListener2 bean definition not found", applicationContext.containsBeanDefinition("exitStatusSettingStepListener2"));
  assertTrue("exitStatusSettingStepListener3 bean definition not found", applicationContext.containsBeanDefinition("exitStatusSettingStepListener3"));
  assertTrue("exitStatusSettingStepListenerClassBeanDefinition bean definition not found", applicationContext.containsBeanDefinition("org.springframework.batch.core.jsr.step.listener.ExitStatusSettingStepListener"));
  assertTrue("exitStatusSettingStepListener1ClassBeanDefinition bean definition not found", applicationContext.containsBeanDefinition("org.springframework.batch.core.jsr.step.listener.ExitStatusSettingStepListener1"));
  assertTrue("exitStatusSettingStepListener2ClassBeanDefinition bean definition not found", applicationContext.containsBeanDefinition("org.springframework.batch.core.jsr.step.listener.ExitStatusSettingStepListener2"));
  assertTrue("exitStatusSettingStepListener3ClassBeanDefinition bean definition not found", applicationContext.containsBeanDefinition("org.springframework.batch.core.jsr.step.listener.ExitStatusSettingStepListener3"));
  assertTrue("testBatchlet bean definition not found", applicationContext.containsBeanDefinition("testBatchlet"));
  assertTrue("testBatchlet1 bean definition not found", applicationContext.containsBeanDefinition("testBatchlet1"));
}
origin: spring-projects/spring-batch

@Test
@SuppressWarnings("unchecked")
public void testRoseyScenario() throws Exception {
  JsrXmlApplicationContext context = new JsrXmlApplicationContext();
  Resource batchXml = new ClassPathResource("/org/springframework/batch/core/jsr/configuration/xml/batch.xml");
  context.setValidating(false);
  context.load(batchXml);
  GenericBeanDefinition stepScope = new GenericBeanDefinition();
  stepScope.setBeanClass(StepScope.class);
  context.registerBeanDefinition("stepScope", stepScope);
  GenericBeanDefinition bd = new GenericBeanDefinition();
  bd.setBeanClass(AutowiredAnnotationBeanPostProcessor.class);
  context.registerBeanDefinition("postProcessor", bd);
  context.refresh();
  ItemProcessor<String, String> itemProcessor = context.getBean(ItemProcessor.class);
  assertNotNull(itemProcessor);
  StepSynchronizationManager.register(new StepExecution("step1", new JobExecution(5l)));
  assertEquals("Test", itemProcessor.process("Test"));
  StepSynchronizationManager.close();
  context.close();
}
origin: org.springframework.batch/spring-batch-core

JobSecurityException {
  final JsrXmlApplicationContext batchContext = new JsrXmlApplicationContext(params);
  batchContext.setValidating(false);
origin: de.codecentric/batch-web-spring-boot-autoconfigure

@Override
public long start(String jobName, Properties params) throws JobStartException, JobSecurityException {
  final JsrXmlApplicationContext batchContext = new JsrXmlApplicationContext(params);
  batchContext.setValidating(false);
origin: apache/servicemix-bundles

JobSecurityException {
  final JsrXmlApplicationContext batchContext = new JsrXmlApplicationContext(params);
  batchContext.setValidating(false);
origin: codecentric/spring-boot-starter-batch-web

@Override
public long start(String jobName, Properties params) throws JobStartException, JobSecurityException {
  final JsrXmlApplicationContext batchContext = new JsrXmlApplicationContext(params);
  batchContext.setValidating(false);
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

JobSecurityException {
  final JsrXmlApplicationContext batchContext = new JsrXmlApplicationContext(params);
  batchContext.setValidating(false);
origin: org.springframework.batch/spring-batch-core

batchContext.setValidating(false);
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

batchContext.setValidating(false);
origin: apache/servicemix-bundles

batchContext.setValidating(false);
org.springframework.batch.core.jsr.configuration.xmlJsrXmlApplicationContextsetValidating

Javadoc

Set whether to use XML validation. Default is true.

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
  • getBeanNamesForType
  • isActive
  • setParent
  • getEnvironment
  • storeJobParameters
  • getBeanFactory
  • storeJobParameters,
  • getBeanFactory,
  • containsBeanDefinition,
  • getBeanDefinition

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • 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