This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 215375
Collapse All | Expand All

(-)a/db/test/unit/src/org/netbeans/modules/db/test/DBTestBase.java (+34 lines)
Lines 43-48 Link Here
43
import java.util.Collection;
43
import java.util.Collection;
44
import java.util.Properties;
44
import java.util.Properties;
45
import java.util.logging.Filter;
45
import java.util.logging.Filter;
46
import java.util.logging.Handler;
46
import java.util.logging.Level;
47
import java.util.logging.Level;
47
import java.util.logging.LogRecord;
48
import java.util.logging.LogRecord;
48
import java.util.logging.Logger;
49
import java.util.logging.Logger;
Lines 119-124 Link Here
119
120
120
    @Override
121
    @Override
121
    protected void setUp() throws Exception {
122
    protected void setUp() throws Exception {
123
        suppressSuperfluousLogging();
122
        super.setUp();
124
        super.setUp();
123
        getProperties();
125
        getProperties();
124
        createDBProvider();
126
        createDBProvider();
Lines 793-796 Link Here
793
            quotedCaseRule = QUOTE_RETAINS_CASE;
795
            quotedCaseRule = QUOTE_RETAINS_CASE;
794
        }
796
        }
795
    }
797
    }
798
    
799
   /**
800
     * Disable logging of logging messages from DatabaseUILogger.
801
     *
802
     * Usefulness of the whole logger seems to be doubtful
803
     */
804
    public static void suppressSuperfluousLogging() {
805
        for (Handler h : Logger.getLogger("").getHandlers()) {
806
            h.setFilter(new Filter() {
807
808
                @Override
809
                public boolean isLoggable(LogRecord lr) {
810
                    if (lr.getSourceClassName().equals("org.netbeans.modules.db.explorer.DatabaseUILogger")) {
811
                        return false;
812
                    } else if (lr.getSourceClassName().equals("org.netbeans.api.db.sql.support.SQLIdentifiers$DatabaseMetaDataQuoter")) {
813
                        if (lr.getSourceMethodName().equals("getExtraNameChars")
814
                                && lr.getLevel() == Level.WARNING
815
                                && lr.getMessage().startsWith("DatabaseMetaData.getExtraNameCharacters() failed")) {
816
                            return false;
817
                        } else if (lr.getSourceMethodName().equals("needToQuote")
818
                                && lr.getLevel().intValue() <= Level.INFO.intValue()) {
819
                            return false;
820
                        } else {
821
                            return true;
822
                        }
823
                    } else {
824
                        return true;
825
                    }
826
                }
827
            });
828
        }
829
    }
796
}
830
}

Return to bug 215375