@@ -0,0 +1,3214 @@
+/*%0A *%0A *  * Copyright (C) 2016 Singular Studios (a.k.a Atom Tecnologia) - www.opensingular.com%0A *  *%0A *  * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *  *  you may not use this file except in compliance with the License.%0A *  * You may obtain a copy of the License at%0A *  *%0A *  * http://www.apache.org/licenses/LICENSE-2.0%0A *  *%0A *  * Unless required by applicable law or agreed to in writing, software%0A *  * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  * See the License for the specific language governing permissions and%0A *  * limitations under the License.%0A *%0A */%0A%0Apackage org.opensingular.form.wicket.mapper.datetime;%0A%0Aimport org.apache.wicket.markup.html.form.TextField;%0Aimport org.apache.wicket.util.tester.FormTester;%0Aimport org.apache.wicket.util.visit.IVisit;%0Aimport org.apache.wicket.util.visit.IVisitor;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.opensingular.form.SIComposite;%0Aimport org.opensingular.form.STypeComposite;%0Aimport org.opensingular.form.type.core.STypeDateTime;%0Aimport org.opensingular.form.view.SViewDateTime;%0Aimport org.opensingular.form.wicket.helpers.SingularFormDummyPageTester;%0A%0Aimport java.io.Serializable;%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0Aimport java.util.GregorianCalendar;%0A%0Apublic class DateTimeContainerTest implements Serializable %7B%0A%0A%0A    private transient FormTester                  formTester;%0A    private transient SingularFormDummyPageTester tester;%0A%0A    @Before%0A    public void newTestPage() %7B%0A        tester = new SingularFormDummyPageTester();%0A        tester.getDummyPage().setTypeBuilder(this::buildSType);%0A%0A        tester.getDummyPage().setAsEditView();%0A        tester.startDummyPage();%0A%0A        formTester = tester.newFormTester();%0A    %7D%0A%0A    private SIComposite getRootInstance() %7B%0A        return (SIComposite) tester.getDummyPage().getSingularFormPanel().getInstance();%0A    %7D%0A%0A    public void buildSType(STypeComposite%3CSIComposite%3E composite) %7B%0A        STypeDateTime dateTime = composite.addFieldDateTime(%22teste%22);%0A        dateTime.withView(SViewDateTime::new);%0A    %7D%0A%0A%0A    @Test%0A    public void dateTimeContainerMapper() %7B%0A        formTester.getForm().visitChildren(TextField.class, new IVisitor%3CTextField, Object%3E() %7B%0A            @Override%0A            public void component(TextField object, IVisit%3CObject%3E visit) %7B%0A                if (%22date%22.equals(object.getId())) %7B%0A                    formTester.setValue(object, %2212/12/2012%22);%0A%0A                %7D else if (%22time%22.equals(object.getId())) %7B%0A                    formTester.setValue(object, %228:00%22);%0A                %7D%0A            %7D%0A        %7D);%0A        formTester.submit();%0A%0A        Calendar calendar = GregorianCalendar.getInstance();%0A        calendar.clear();%0A        calendar.set(Calendar.YEAR, 2012);%0A        calendar.set(Calendar.MONTH, 12);%0A        calendar.set(Calendar.DAY_OF_MONTH, 12);%0A        calendar.set(Calendar.HOUR, 8);%0A        calendar.set(Calendar.MINUTE, 0);%0A%0A        Date expectedDate = calendar.getTime();%0A%0A        Assert.assertEquals(expectedDate, getRootInstance().getField(%22teste%22).getValue());%0A    %7D%0A%0A%7D%0A

teste para exemplificar o problema