Package org.springframework.batch.item

Examples of org.springframework.batch.item.WriteFailedException


      dao.writeTrade(trade);

      Assert.notNull(trade.getPrice()); // There must be a price to total

      if (this.failingCustomers.contains(trade.getCustomer())) {
        throw new WriteFailedException("Something unexpected happened!");
      }
    }

  }
View Full Code Here


   *
   * expected: true
   */
  @Test
  public void testSkippableSubset_skippable() {
    assertTrue(getSkippableSubsetSkipPolicy().shouldSkip(new WriteFailedException(""), 0));
  }
View Full Code Here

   *
   * expected: false
   */
  @Test
  public void testFatalSubset_fatal() {
    assertFalse(getFatalSubsetSkipPolicy().shouldSkip(new WriteFailedException(""), 0));
  }
View Full Code Here

    }
    try {
      state.write(lines.toString());
    }
    catch (IOException e) {
      throw new WriteFailedException("Could not write data.  The file may be corrupt.", e);
    }
    state.linesWritten += lineCount;
  }
View Full Code Here

      if (forceSync) {
        channel.force(false);
      }     
    }
    catch (XMLStreamException e) {
      throw new WriteFailedException("Failed to flush the events", e);
    }
    catch (IOException e) {
      throw new WriteFailedException("Failed to flush the events", e);
    }

  }
View Full Code Here

      return 0L;
    }
    try {
      return getCurrentBuffer().toString().getBytes(encoding).length;
    } catch (UnsupportedEncodingException e) {
      throw new WriteFailedException("Could not determine buffer size because of unsupported encoding: " + encoding, e);
    }
  }
View Full Code Here

   *
   * expected: true
   */
  @Test
  public void testSkippableSubset_skippable() throws Exception {
    assertTrue(getSkippableSubsetSkipPolicy().shouldSkip(new WriteFailedException(""), 0));
  }
View Full Code Here

   *
   * expected: false
   */
  @Test
  public void testFatalSubsetFatal() throws Exception {
    assertFalse(getFatalSubsetSkipPolicy().shouldSkip(new WriteFailedException(""), 0));
  }
View Full Code Here

    }
    try {
      return lines.toString().getBytes(this.charset);
    }
    catch (UnsupportedEncodingException e) {
      throw new WriteFailedException("Could not write data.", e);
    }
  }
View Full Code Here

    }
    try {
      return lines.toString().getBytes(this.charset);
    }
    catch (UnsupportedEncodingException e) {
      throw new WriteFailedException("Could not write data.", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.item.WriteFailedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.