OpenJPA
  1. OpenJPA
  2. OPENJPA-1525

TestCacheMarshallerEndToEnd.Log requires to implement warn() method

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta
    • Fix Version/s: 2.0.0-beta2
    • Component/s: jpa
    • Labels:
      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)

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Albert Lee
            Reporter:
            Albert Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development