Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1525

TestCacheMarshallerEndToEnd.Log requires to implement warn() method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0-beta
    • 2.0.0-beta2
    • jpa
    • None

    Description

      In TestCacheMarshallerEndToEnd test, it set its own Log implementation to the MetaDataCacheMaintenance class. However it does not implement the warn() method required in

      private void loadQuery(Broker broker, QueryMetaData qmd) {
      try

      { Query q = broker.newQuery(qmd.getLanguage(), null); qmd.setInto(q); q.compile(); }

      catch (Exception e) {
      if (log.isTraceEnabled())

      { log.warn("Skipping named query " + qmd.getName() + ": " + e.getMessage(), e); }

      else

      { log.warn("Skipping named query " + qmd.getName() + ": " + e.getMessage()); }

      }
      }

      In a specific test scenario, it will failed with an exception as shown below:

      [11:38:50]: [junit] org.apache.openjpa.conf.TestCacheMarshallerEndToEnd (13m:37s)
      [11:38:50]: [org.apache.openjpa.conf.TestCacheMarshallerEndToEnd] testCacheMarshallerEndToEnd (13m:32s)
      [11:52:21]: [testCacheMarshallerEndToEnd] java.lang.UnsupportedOperationException
      [11:52:21]: [testCacheMarshallerEndToEnd] java.lang.UnsupportedOperationException
      at org.apache.openjpa.conf.TestCacheMarshallerEndToEnd$LogImpl.warn(TestCacheMarshallerEndToEnd.java:153)
      at org.apache.openjpa.conf.MetaDataCacheMaintenance.loadQuery(MetaDataCacheMaintenance.java:152)
      at org.apache.openjpa.conf.MetaDataCacheMaintenance.loadQueries(MetaDataCacheMaintenance.java:139)
      at org.apache.openjpa.conf.MetaDataCacheMaintenance.store(MetaDataCacheMaintenance.java:122)
      at org.apache.openjpa.conf.TestCacheMarshallerEndToEnd.testCacheMarshallerEndToEnd(TestCacheMarshallerEndToEnd.java:83)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

      Attachments

        Activity

          People

            allee8285 Albert Lee
            allee8285 Albert Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: