< prev index next >

test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/XMLGregorianCalendarTest.java

Print this page


   1 /*
   2  * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package javax.xml.datatype.ptests;
  25 
  26 import static java.util.Calendar.HOUR;
  27 import static java.util.Calendar.MINUTE;
  28 import static java.util.Calendar.YEAR;
  29 import static org.testng.Assert.assertEquals;
  30 import static org.testng.Assert.assertTrue;
  31 
  32 import java.util.GregorianCalendar;
  33 import java.util.Locale;
  34 import java.util.TimeZone;
  35 
  36 import javax.xml.datatype.DatatypeConfigurationException;
  37 import javax.xml.datatype.DatatypeConstants;
  38 import javax.xml.datatype.DatatypeFactory;
  39 import javax.xml.datatype.Duration;
  40 import javax.xml.datatype.XMLGregorianCalendar;
  41 
  42 import jaxp.library.JAXPBaseTest;
  43 
  44 import org.testng.Assert;
  45 import org.testng.annotations.BeforeClass;
  46 import org.testng.annotations.DataProvider;

  47 import org.testng.annotations.Test;
  48 
  49 /*
  50  * @bug 5049592 5041845 5048932 5064587 5040542 5049531 5049528
  51  * @summary Class containing the test cases for XMLGregorianCalendar
  52  */
  53 public class XMLGregorianCalendarTest extends JAXPBaseTest {

  54 
  55     private DatatypeFactory datatypeFactory;
  56 
  57     @BeforeClass
  58     public void setup() throws DatatypeConfigurationException {
  59         datatypeFactory = DatatypeFactory.newInstance();
  60     }
  61 
  62     @DataProvider(name = "valid-milliseconds")
  63     public Object[][] getValidMilliSeconds() {
  64         return new Object[][] { { 0 }, { 1 }, { 2 }, { 16 }, { 1000 }   };
  65     }
  66 
  67     /*
  68      * Test DatatypeFactory.newXMLGregorianCalendar(..) with milliseconds > 1.
  69      *
  70      * Bug # 5049592
  71      *
  72      */
  73     @Test(dataProvider = "valid-milliseconds")


   1 /*
   2  * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package javax.xml.datatype.ptests;
  25 
  26 import static java.util.Calendar.HOUR;
  27 import static java.util.Calendar.MINUTE;
  28 import static java.util.Calendar.YEAR;
  29 import static org.testng.Assert.assertEquals;
  30 import static org.testng.Assert.assertTrue;
  31 
  32 import java.util.GregorianCalendar;
  33 import java.util.Locale;
  34 import java.util.TimeZone;
  35 
  36 import javax.xml.datatype.DatatypeConfigurationException;
  37 import javax.xml.datatype.DatatypeConstants;
  38 import javax.xml.datatype.DatatypeFactory;
  39 import javax.xml.datatype.Duration;
  40 import javax.xml.datatype.XMLGregorianCalendar;
  41 


  42 import org.testng.Assert;
  43 import org.testng.annotations.BeforeClass;
  44 import org.testng.annotations.DataProvider;
  45 import org.testng.annotations.Listeners;
  46 import org.testng.annotations.Test;
  47 
  48 /*
  49  * @bug 5049592 5041845 5048932 5064587 5040542 5049531 5049528
  50  * @summary Class containing the test cases for XMLGregorianCalendar
  51  */
  52 @Listeners({jaxp.library.BasePolicy.class})
  53 public class XMLGregorianCalendarTest {
  54 
  55     private DatatypeFactory datatypeFactory;
  56 
  57     @BeforeClass
  58     public void setup() throws DatatypeConfigurationException {
  59         datatypeFactory = DatatypeFactory.newInstance();
  60     }
  61 
  62     @DataProvider(name = "valid-milliseconds")
  63     public Object[][] getValidMilliSeconds() {
  64         return new Object[][] { { 0 }, { 1 }, { 2 }, { 16 }, { 1000 }   };
  65     }
  66 
  67     /*
  68      * Test DatatypeFactory.newXMLGregorianCalendar(..) with milliseconds > 1.
  69      *
  70      * Bug # 5049592
  71      *
  72      */
  73     @Test(dataProvider = "valid-milliseconds")


< prev index next >