stevedlawrence commented on a change in pull request #446:
URL: https://github.com/apache/incubator-daffodil/pull/446#discussion_r512131773



##########
File path: 
daffodil-test/src/test/scala/org/apache/daffodil/xml/test/unit/TestDaffodilXMLLoader.scala
##########
@@ -1,382 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.daffodil.xml.test.unit
-
-import scala.xml._
-import org.apache.daffodil.xml.XMLUtils
-import org.apache.daffodil.xml.DaffodilXMLLoader
-import org.junit.Assert._
-import org.junit.Test
-import java.io.File
-import org.apache.daffodil.Implicits._
-import org.apache.daffodil.util.Misc
-import org.apache.daffodil.api.URISchemaSource
-
-/**
- * This unit test cannot be in the regular daffodil-core library due
- * to needing to populate a file into a directory that is on the
- * classpath.
- *
- * In daffodil-test there is no problem with us creating such a
- * directory dynamically, and having it be on the classpath of the
- * project. At least under Eclipse anyway.
- *
- * TODO: is the above a security hole? If so, is there a better way
- * to test this? Do we have to make a whole separate project just
- * to test this?
- */
-class TestDaffodilXMLLoader {
-
-  /**
-   * This test makes sure that a CatalogManager.properties file
-   * will be read and catalogs it specifies will be loaded and used.
-   *
-   * It tests this by validating some data that is invalid with respect
-   * to a schema supplied by way of the CatalogManager.properties file.
-   *
-   * If the error is detected, then it must have found and used the
-   * user-specified catalog.
-   */
-  @Test def testThisTestRig(): Unit = {
-
-    // LoggingDefaults.setLoggingLevel(LogLevel.Debug)
-
-    val test = new CatalogTestBase {
-
-      override val testCatalog = <catalog 
xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
-                                   <uri name="foobar" uri={ 
tmpSchemaFileName.getAbsolutePath }/>
-                                 </catalog>
-
-      // The '5' for line should cause a validation error because it doesn't 
match
-      // the 'A' enum in the schema.
-      val testData =
-        <onlyAnAWillDo xmlns="foobar">5</onlyAnAWillDo>
-
-      val testSchema =
-        <schema xmlns={ xsd } targetNamespace="foobar" xmlns:xsd={ xsd }>
-          <!-- in our internal schema line is an int, in this schema it is a 
string.
-             So if our internal schema is being used, a validation against 
that will cause an error
-             for anything that doesn't obey the syntax of an int. So we want 
to demonstrate
-             that we get that error.
-          -->
-          <xsd:element name="onlyAnAWillDo">
-            <xsd:simpleType>
-              <xsd:restriction base="xsd:string">
-                <xsd:enumeration value="A"/>
-              </xsd:restriction>
-            </xsd:simpleType>
-          </xsd:element>
-        </schema>
-
-      override def runTest(): Boolean = {
-        if (!super.runTest()) {
-          System.err.println("test skipped.")
-          return false
-        }
-        // but when it has to resolve our dafint namespace, we don't want it 
to take the 
-        // one we created here, rather we want it to take our internal one.
-        val excs = exceptionList
-
-        println(excs)
-        //
-        // Now, our internal dafint schema requires the line attribute to be a 
-        // xs:int, so using 'A' above means we should get an error on the line 
attribute.
-        //
-        // these checks pass if we got an error complaining about the 'line'
-        //
-        assertTrue(excs.length >= 1)
-        // check that we got an error message complaining about the element.
-        val hasError = excs.exists { _.getMessage().contains("onlyAnAWillDo") }
-        assertTrue(hasError)
-        true
-      }
-    }
-
-    test.runTest
-  }
-
-  /**
-   * This test insures that a user catalog doesn't get priority over
-   * our internal catalog by defining a catalog and schema that uses
-   * one of our namespaces.
-   *
-   * Our dafint.xsd defines testElement and the line and col attributes
-   * must be type xs:int. The data here has dafint:line with value 'A',
-   * so if the built-in schema is used, it will find this error. So the
-   * test passes if the error is detected.
-   */
-  @Test def testThatUserCatalogCannotOverrideDaffodilInternalCatalog1(): Unit 
= {

Review comment:
       Created 
[DAFFODIL-2424](https://issues.apache.org/jira/browse/DAFFODIL-2424) to track 
the issue of adding back tests.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to