Skip to content

Commit

Permalink
Comment out java 8 date tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskleeh committed Oct 5, 2016
1 parent 4fd6c13 commit 8eead34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
*/
package org.grails.plugins.databinding

import grails.internal.JavaVersion
import grails.plugins.Plugin
import grails.util.GrailsUtil
import grails.web.databinding.DataBindingUtils
import grails.web.databinding.GrailsWebDataBinder
import org.grails.databinding.converters.web.Jsr310ConvertersConfiguration
import org.grails.web.databinding.bindingsource.DataBindingSourceRegistry
import org.grails.web.databinding.bindingsource.DefaultDataBindingSourceRegistry
import org.grails.web.databinding.bindingsource.HalJsonDataBindingSourceCreator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package org.grails.web.taglib

import org.junit.Ignore

import java.text.DateFormat
import org.w3c.dom.Document

import java.time.*
import java.time.temporal.TemporalAccessor

/**
* Tests for the FormTagLib.groovy file which contains tags to help with the
* creation of HTML forms
Expand Down Expand Up @@ -52,18 +48,15 @@ class FormTagLib2Tests extends AbstractGrailsTagTests {
void testDatePickerTagWithCustomDate() {
testDatePickerTag(new Date(0), null)
}

@Ignore
/*
void testDatePickerTagWithLocalDateTime() {
testDatePickerTag(LocalDateTime.now(), null)
}
@Ignore
void testDatePickerTagWithLocalDate() {
testDatePickerTag(LocalDate.now(), null)
}
@Ignore
void testDatePickerTagWithLocalTime() {
try {
testDatePickerTag(LocalTime.now(), null)
Expand All @@ -72,12 +65,10 @@ class FormTagLib2Tests extends AbstractGrailsTagTests {
}
}
@Ignore
void testDatePickerTagWithOffsetDateTime() {
testDatePickerTag(OffsetDateTime.now(), null)
}
@Ignore
void testDatePickerTagWithOffsetTime() {
try {
testDatePickerTag(OffsetTime.now(), null)
Expand All @@ -87,12 +78,10 @@ class FormTagLib2Tests extends AbstractGrailsTagTests {
}
@Ignore
void testDatePickerTagWithZonedDateTime() {
testDatePickerTag(ZonedDateTime.now(), null)
}
}*/

@Ignore
void testDatePickerTagWithDefault() {
def defaultDate = Calendar.getInstance()
defaultDate.add(Calendar.DAY_OF_MONTH, 7)
Expand Down Expand Up @@ -161,7 +150,7 @@ class FormTagLib2Tests extends AbstractGrailsTagTests {
if (date != null) {
if (date instanceof Date) {
calendar.setTime(date)
} else if (date instanceof TemporalAccessor) {
} /*else if (date instanceof TemporalAccessor) {
ZonedDateTime zonedDateTime
if (date instanceof LocalDateTime) {
zonedDateTime = ZonedDateTime.of(date, ZoneId.systemDefault())
Expand All @@ -171,7 +160,7 @@ class FormTagLib2Tests extends AbstractGrailsTagTests {
zonedDateTime = ZonedDateTime.from(date)
}
calendar = GregorianCalendar.from(zonedDateTime)
}
}*/
}

// validate id attributes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package org.grails.web.taglib

import org.grails.buffer.StreamCharBuffer
import org.junit.Ignore
import spock.lang.Issue

import java.text.DecimalFormatSymbols

import org.grails.taglib.GrailsTagException

import java.time.*

/**
* Tests for the FormatTagLib.
*
Expand Down Expand Up @@ -59,117 +54,102 @@ class FormatTagLibTests extends AbstractGrailsTagTests {
assertOutputEquals("1980-02-03", template, [date:calender.getTime()])
}

@Ignore
/*
void testFormatLocalDate() {
def date = LocalDate.of(1980, 2, 3)
def template = '<g:formatDate format="yyyy-MM-dd" date="${date}"/>'
assertOutputEquals("1980-02-03", template, [date: date])
}
@Ignore
void testFormatLocalTime() {
def date = LocalTime.of(22, 2, 3)
def template = '<g:formatDate format="HH:mm:ss" date="${date}"/>'
assertOutputEquals("22:02:03", template, [date: date])
}
@Ignore
void testFormatLocalDateTime() {
def date = LocalDateTime.of(1980, 2, 3, 22, 2, 3)
def template = '<g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${date}"/>'
assertOutputEquals("1980-02-03 22:02:03", template, [date: date])
}
@Ignore
void testFormatOffsetTime() {
def date = OffsetTime.of(22, 2, 3, 0, ZoneOffset.MIN)
def template = '<g:formatDate format="HH:mm:ss:SS" date="${date}"/>'
assertOutputEquals("22:02:03:00", template, [date: date])
}
@Ignore
void testFormatOffsetDateTime() {
def date = OffsetDateTime.of(1980, 2, 3, 22, 2, 3, 0, ZoneOffset.MIN)
def template = '<g:formatDate format="yyyy-MM-dd HH:mm:ss:SS" date="${date}"/>'
assertOutputEquals("1980-02-04 11:02:03:00", template, [date: date])
}
@Ignore
void testFormatZonedDateTime() {
def date = ZonedDateTime.of(1980, 2, 3, 22, 2, 3, 0, ZoneOffset.MIN)
def template = '<g:formatDate format="yyyy-MM-dd HH:mm:ss:SS" date="${date}"/>'
assertOutputEquals("1980-02-04 11:02:03:00", template, [date: date])
}
@Ignore
void testFormatDateWithStyle() {
def calender = new GregorianCalendar(1980,1,3)
def template = '<g:formatDate date="${date}" type="date" style="LONG" locale="en_US"/>'
assertOutputEquals("February 3, 1980", template, [date:calender.getTime()])
}
@Ignore
void testFormatLocalDateWithStyle() {
def date = LocalDate.of(1980, 2, 3)
def template = '<g:formatDate date="${date}" type="date" style="LONG" locale="en_US"/>'
assertOutputEquals("February 3, 1980", template, [date: date])
}
@Ignore
void testFormatLocalDateTimeWithStyle() {
def date = LocalDateTime.of(1980, 2, 3, 22, 2, 3)
def template = '<g:formatDate date="${date}" type="date" style="LONG" locale="en_US"/>'
assertOutputEquals("February 3, 1980", template, [date: date])
}
@Ignore
void testFormatOffsetDateTimeWithStyle() {
def date = OffsetDateTime.of(1980, 2, 3, 22, 2, 3, 0, ZoneOffset.MIN)
def template = '<g:formatDate date="${date}" type="date" style="LONG" locale="en_US"/>'
assertOutputEquals("February 4, 1980", template, [date: date])
}
@Ignore
void testFormatZonedDateTimeWithStyle() {
def date = ZonedDateTime.of(1980, 2, 3, 22, 2, 3, 0, ZoneOffset.MIN)
def template = '<g:formatDate date="${date}" type="date" style="LONG" locale="en_US"/>'
assertOutputEquals("February 4, 1980", template, [date: date])
}
@Ignore
void testFormatDateTimeWithStyle() {
def calender = new GregorianCalendar(1980,1,3)
def template = '<g:formatDate date="${date}" type="datetime" style="LONG" timeStyle="SHORT" locale="en_US"/>'
assertOutputEquals("February 3, 1980 12:00 AM", template, [date:calender.getTime()])
}
@Ignore
void testFormatLocalDateWithTimeStyle() {
def date = LocalDate.of(1980, 2, 3)
def template = '<g:formatDate date="${date}" type="datetime" style="LONG" timeStyle="SHORT" locale="en_US"/>'
assertOutputEquals("February 3, 1980 12:00 AM", template, [date: date])
}
@Ignore
void testFormatLocalDateTimeWithTimeStyle() {
def date = LocalDateTime.of(1980, 2, 3, 22, 2, 3)
def template = '<g:formatDate date="${date}" type="datetime" style="LONG" timeStyle="SHORT" locale="en_US"/>'
assertOutputEquals("February 3, 1980 10:02 PM", template, [date: date])
}
@Ignore
void testFormatOffsetDateTimeWithTimeStyle() {
def date = OffsetDateTime.of(1980, 2, 3, 22, 2, 3, 0, ZoneOffset.MIN)
def template = '<g:formatDate date="${date}" type="datetime" style="LONG" timeStyle="SHORT" locale="en_US"/>'
assertOutputEquals("February 4, 1980 11:02 AM", template, [date: date])
}
@Ignore
void testFormatZonedDateTimeWithTimeStyle() {
def date = ZonedDateTime.of(1980, 2, 3, 22, 2, 3, 0, ZoneOffset.MIN)
def template = '<g:formatDate date="${date}" type="datetime" style="LONG" timeStyle="SHORT" locale="en_US"/>'
assertOutputEquals("February 4, 1980 11:02 AM", template, [date: date])
}
}*/

void testFormatDateNullDate() {
def template = '<g:formatDate format="yyyy-MM-dd" date="${date}"/>'
Expand Down

0 comments on commit 8eead34

Please sign in to comment.