jtulach@107: package org.apidesign.deadlock.logs; jtulach@107: jtulach@107: import java.util.logging.Level; jtulach@107: import org.junit.After; jtulach@107: import org.junit.AfterClass; jtulach@107: import org.junit.Before; jtulach@107: import org.junit.BeforeClass; jtulach@107: import org.junit.Test; jtulach@107: import org.netbeans.junit.Log; jtulach@107: import static org.junit.Assert.*; jtulach@107: jtulach@107: public class OverrideMePleaseTest { jtulach@107: jtulach@107: public OverrideMePleaseTest() { jtulach@107: } jtulach@107: jtulach@107: @Test jtulach@107: public void overideMePleaseNotOverriden() { jtulach@107: CharSequence log = Log.enable("org.apidesign", Level.WARNING); jtulach@107: OverrideMePlease instance = new OverrideMePlease() { jtulach@107: }; jtulach@107: if (log.length() == 0) { jtulach@107: fail("There should be a warning: " + log); jtulach@107: } jtulach@107: } jtulach@107: jtulach@107: @Test jtulach@107: public void overideMePleaseOverriden() { jtulach@107: // BEGIN: logs.override.test jtulach@107: CharSequence log = Log.enable("org.apidesign", Level.WARNING); jtulach@107: OverrideMePlease instance = new OverrideMePlease() { jtulach@107: @Override jtulach@107: protected boolean overideMePlease() { jtulach@107: return true; jtulach@107: } jtulach@107: }; jtulach@107: if (log.length() != 0) { jtulach@107: fail("There should be no warning: " + log); jtulach@107: } jtulach@107: // END: logs.override.test jtulach@107: } jtulach@107: jtulach@107: }