< prev index next >

test/javax/xml/jaxp/unittest/datatype/XMLGregorianCalendarTest.java

Print this page


   1 /*
   2  * Copyright (c) 2014, 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 datatype;
  25 
  26 import javax.xml.datatype.DatatypeConfigurationException;
  27 import javax.xml.datatype.DatatypeConstants;
  28 import javax.xml.datatype.DatatypeFactory;
  29 import javax.xml.datatype.XMLGregorianCalendar;
  30 
  31 import org.testng.Assert;
  32 import org.testng.annotations.BeforeMethod;

  33 import org.testng.annotations.Test;
  34 
  35 /*
  36  * @summary Test XMLGregorianCalendar.
  37  */

  38 public class XMLGregorianCalendarTest {
  39 
  40     private static final boolean DEBUG = false;
  41 
  42     private static final int TEST_VALUE_FAIL = 0;
  43 
  44     private static final int TEST_VALUE_PASS = 1;
  45 
  46     private XMLGregorianCalendar calendar;
  47 
  48     @BeforeMethod
  49     protected void setUp() {
  50         try {
  51             calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar();
  52         } catch (DatatypeConfigurationException dce) {
  53             dce.printStackTrace();
  54             Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage());
  55         }
  56     }
  57 


   1 /*
   2  * Copyright (c) 2014, 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 datatype;
  25 
  26 import javax.xml.datatype.DatatypeConfigurationException;
  27 import javax.xml.datatype.DatatypeConstants;
  28 import javax.xml.datatype.DatatypeFactory;
  29 import javax.xml.datatype.XMLGregorianCalendar;
  30 
  31 import org.testng.Assert;
  32 import org.testng.annotations.BeforeMethod;
  33 import org.testng.annotations.Listeners;
  34 import org.testng.annotations.Test;
  35 
  36 /*
  37  * @summary Test XMLGregorianCalendar.
  38  */
  39 @Listeners({jaxp.library.BasePolicy.class})
  40 public class XMLGregorianCalendarTest {
  41 
  42     private static final boolean DEBUG = false;
  43 
  44     private static final int TEST_VALUE_FAIL = 0;
  45 
  46     private static final int TEST_VALUE_PASS = 1;
  47 
  48     private XMLGregorianCalendar calendar;
  49 
  50     @BeforeMethod
  51     protected void setUp() {
  52         try {
  53             calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar();
  54         } catch (DatatypeConfigurationException dce) {
  55             dce.printStackTrace();
  56             Assert.fail("Failed to create instance of DatatypeFactory " + dce.getMessage());
  57         }
  58     }
  59 


< prev index next >