Tabnine Logo
IntegerBodyMarshaller
Code IndexAdd Tabnine to your IDE (free)

How to use
IntegerBodyMarshaller
in
com.novoda.sexp.marshaller

Best Java code snippets using com.novoda.sexp.marshaller.IntegerBodyMarshaller (Showing top 7 results out of 315)

origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of an XML tag into an {@link Integer}
 *
 * @return {@link ElementFinder}
 */
public ElementFinder<Integer> getIntegerFinder() {
  return getTypeFinder(new IntegerBodyMarshaller());
}
origin: novoda/simple-easy-xml-parser

@Test(expected = IllegalArgumentException.class)
public void throw_exception_when_input_is_float() throws Exception {
  String invalidInput = "0.5f";
  integerBodyMarshaller.marshal(invalidInput);
}
origin: novoda/simple-easy-xml-parser

  @Test(expected = IllegalArgumentException.class)
  public void throw_exception_when_input_is_null() throws Exception {
    integerBodyMarshaller.marshal(null);
  }
}
origin: novoda/simple-easy-xml-parser

@Before
public void setUp() throws Exception {
  integerBodyMarshaller = new IntegerBodyMarshaller();
}
origin: novoda/simple-easy-xml-parser

@Test(expected = IllegalArgumentException.class)
public void throw_exception_when_input_is_invalid() throws Exception {
  String invalidInput = "invalid";
  integerBodyMarshaller.marshal(invalidInput);
}
origin: novoda/simple-easy-xml-parser

@Test(expected = java.lang.NumberFormatException.class)
public void throw_exception_when_input_is_double() throws Exception {
  String invalidInput = "3.5d";
  integerBodyMarshaller.marshal(invalidInput);
}
origin: novoda/simple-easy-xml-parser

@Test
public void marshal_strings_to_integers() throws Exception {
  String validInput = "5";
  int expectedOutput = 5;
  assertThat(integerBodyMarshaller.marshal(validInput)).isEqualTo(expectedOutput);
}
com.novoda.sexp.marshallerIntegerBodyMarshaller

Most used methods

  • <init>
  • marshal

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JFrame (javax.swing)
  • JOptionPane (javax.swing)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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