test/java/time/test/java/time/format/TestSettingsParser.java

Print this page

        

*** 57,72 **** * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package test.java.time.format; - import java.time.format.*; - import static org.testng.Assert.assertEquals; import java.text.ParsePosition; - import java.time.ZoneOffset; import org.testng.annotations.Test; /** * Test SettingsParser. --- 57,69 ----
*** 75,127 **** public class TestSettingsParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- public void test_print_sensitive() throws Exception { setCaseSensitive(true); ! getFormatter().printTo(dta, buf); assertEquals(buf.toString(), ""); } public void test_print_strict() throws Exception { setStrict(true); ! getFormatter().printTo(dta, buf); assertEquals(buf.toString(), ""); } /* public void test_print_nulls() throws Exception { setCaseSensitive(true); ! getFormatter().printTo(null, null); } */ //----------------------------------------------------------------------- public void test_parse_changeStyle_sensitive() throws Exception { setCaseSensitive(true); ParsePosition pos = new ParsePosition(0); ! getFormatter().parseToBuilder("a", pos); assertEquals(pos.getIndex(), 0); } public void test_parse_changeStyle_insensitive() throws Exception { setCaseSensitive(false); ParsePosition pos = new ParsePosition(0); ! getFormatter().parseToBuilder("a", pos); assertEquals(pos.getIndex(), 0); } public void test_parse_changeStyle_strict() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); ! getFormatter().parseToBuilder("a", pos); assertEquals(pos.getIndex(), 0); } public void test_parse_changeStyle_lenient() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); ! getFormatter().parseToBuilder("a", pos); assertEquals(pos.getIndex(), 0); } //----------------------------------------------------------------------- public void test_toString_sensitive() throws Exception { --- 72,124 ---- public class TestSettingsParser extends AbstractTestPrinterParser { //----------------------------------------------------------------------- public void test_print_sensitive() throws Exception { setCaseSensitive(true); ! getFormatter().formatTo(dta, buf); assertEquals(buf.toString(), ""); } public void test_print_strict() throws Exception { setStrict(true); ! getFormatter().formatTo(dta, buf); assertEquals(buf.toString(), ""); } /* public void test_print_nulls() throws Exception { setCaseSensitive(true); ! getFormatter().formatTo(null, null); } */ //----------------------------------------------------------------------- public void test_parse_changeStyle_sensitive() throws Exception { setCaseSensitive(true); ParsePosition pos = new ParsePosition(0); ! getFormatter().parseUnresolved("a", pos); assertEquals(pos.getIndex(), 0); } public void test_parse_changeStyle_insensitive() throws Exception { setCaseSensitive(false); ParsePosition pos = new ParsePosition(0); ! getFormatter().parseUnresolved("a", pos); assertEquals(pos.getIndex(), 0); } public void test_parse_changeStyle_strict() throws Exception { setStrict(true); ParsePosition pos = new ParsePosition(0); ! getFormatter().parseUnresolved("a", pos); assertEquals(pos.getIndex(), 0); } public void test_parse_changeStyle_lenient() throws Exception { setStrict(false); ParsePosition pos = new ParsePosition(0); ! getFormatter().parseUnresolved("a", pos); assertEquals(pos.getIndex(), 0); } //----------------------------------------------------------------------- public void test_toString_sensitive() throws Exception {