< prev index next >
test/javax/xml/jaxp/functional/test/auctionportal/AuctionController.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -20,22 +20,27 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package test.auctionportal;
-import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_LANGUAGE;
-import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_SOURCE;
+import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI;
+import static jaxp.library.JAXPTestUtilities.bomStream;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_LANGUAGE;
+import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_SOURCE;
+import static test.auctionportal.HiBidConstants.PORTAL_ACCOUNT_NS;
+import static test.auctionportal.HiBidConstants.XML_DIR;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.math.BigInteger;
import java.nio.file.Paths;
import java.util.GregorianCalendar;
-import static javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI;
+
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -44,36 +49,35 @@
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
-import jaxp.library.JAXPFileReadOnlyBaseTest;
-import static jaxp.library.JAXPTestUtilities.bomStream;
+
+import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMConfiguration;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.TypeInfo;
import org.w3c.dom.bootstrap.DOMImplementationRegistry;
import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSSerializer;
-import static test.auctionportal.HiBidConstants.PORTAL_ACCOUNT_NS;
-import static test.auctionportal.HiBidConstants.XML_DIR;
/**
* This is the user controller class for the Auction portal HiBid.com.
*/
-public class AuctionController extends JAXPFileReadOnlyBaseTest {
+@Listeners({jaxp.library.FilePolicy.class})
+public class AuctionController {
/**
* Check for DOMErrorHandler handling DOMError. Before fix of bug 4890927
* DOMConfiguration.setParameter("well-formed",true) throws an exception.
*
* @throws Exception If any errors occur.
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testCreateNewItem2Sell() throws Exception {
String xmlFile = XML_DIR + "novelsInvalid.xml";
Document document = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().parse(xmlFile);
@@ -92,11 +96,11 @@
* Check for DOMErrorHandler handling DOMError. Before fix of bug 4896132
* test throws DOM Level 1 node error.
*
* @throws Exception If any errors occur.
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testCreateNewItem2SellRetry() throws Exception {
String xmlFile = XML_DIR + "accountInfo.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
@@ -124,11 +128,11 @@
* Check if setting the attribute to be of type ID works. This will affect
* the Attr.isID method according to the spec.
*
* @throws Exception If any errors occur.
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testCreateID() throws Exception {
String xmlFile = XML_DIR + "accountInfo.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
@@ -145,11 +149,11 @@
/**
* Check the user data on the node.
*
* @throws Exception If any errors occur.
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testCheckingUserData() throws Exception {
String xmlFile = XML_DIR + "accountInfo.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
@@ -182,11 +186,11 @@
* Check the UTF-16 XMLEncoding xml file.
*
* @throws Exception If any errors occur.
* @see <a href="content/movies.xml">movies.xml</a>
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testCheckingEncoding() throws Exception {
// Note since movies.xml is UTF-16 encoding. We're not using stanard XML
// file suffix.
String xmlFile = XML_DIR + "movies.xml.data";
@@ -204,11 +208,11 @@
* used to be testing for the functionalities.
*
* @throws Exception If any errors occur.
* @see <a href="content/userDetails.xsd">userDetails.xsd</a>
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testGetOwnerInfo() throws Exception {
String schemaFile = XML_DIR + "userDetails.xsd";
String xmlFile = XML_DIR + "userDetails.xml";
try(FileInputStream fis = new FileInputStream(xmlFile)) {
@@ -239,11 +243,11 @@
*
* @throws Exception If any errors occur.
* @see <a href="content/coins.xsd">coins.xsd</a>
* @see <a href="content/coinsImportMe.xsd">coinsImportMe.xsd</a>
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testGetOwnerItemList() throws Exception {
String xsdFile = XML_DIR + "coins.xsd";
String xmlFile = XML_DIR + "coins.xml";
try(FileInputStream fis = new FileInputStream(xmlFile)) {
@@ -275,11 +279,11 @@
* @throws Exception If any errors occur.
* @see <a href="content/coins.xsd">coins.xsd</a>
* @see <a href="content/coinsImportMe.xsd">coinsImportMe.xsd</a>
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testGetOwnerItemList1() throws Exception {
String xsdFile = XML_DIR + "coins.xsd";
String xmlFile = XML_DIR + "coins.xml";
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
@@ -297,11 +301,11 @@
/**
* Check usage of javax.xml.datatype.Duration class.
*
* @throws Exception If any errors occur.
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testGetItemDuration() throws Exception {
String xmlFile = XML_DIR + "itemsDuration.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
@@ -330,11 +334,11 @@
/**
* Check usage of TypeInfo interface introduced in DOM L3.
*
* @throws Exception If any errors occur.
*/
- @Test(groups = {"readLocalFiles"})
+ @Test
public void testGetTypeInfo() throws Exception {
String xmlFile = XML_DIR + "accountInfo.xml";
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
< prev index next >