samples/deadlock/test/org/apidesign/deadlock/startuplock/CLIHandlerBlockingWithNbTestCaseTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:54:32 +0200
changeset 107 907f5d8e343c
child 263 7e8e995065c5
permissions -rw-r--r--
Advanced usage of logging
     1 package org.apidesign.deadlock.startuplock;
     2 
     3 import java.io.File;
     4 import java.util.logging.Handler;
     5 import java.util.logging.Level;
     6 import java.util.logging.LogRecord;
     7 import java.util.logging.Logger;
     8 import org.junit.After;
     9 import org.junit.AfterClass;
    10 import org.junit.Before;
    11 import org.junit.BeforeClass;
    12 import org.junit.Test;
    13 import org.netbeans.junit.NbTestCase;
    14 import static org.junit.Assert.*;
    15 
    16 // BEGIN: test.capture.logs.nbjunit
    17 public class CLIHandlerBlockingWithNbTestCaseTest extends NbTestCase {
    18 
    19     public CLIHandlerBlockingWithNbTestCaseTest(String s) {
    20         super(s);
    21     }
    22 
    23     @Override
    24     protected Level logLevel() {
    25         return Level.ALL;
    26     }
    27     
    28     
    29     public void testStart() throws Exception {
    30         File lockFile = File.createTempFile("pref", ".tmp");
    31         int result = CLIHandlerBlocking.start(lockFile);
    32         assertEquals("Show a failure", -10, result);
    33     }
    34 }
    35 // END: test.capture.logs.nbjunit