View Javadoc

1   package org.apache.maven.plugin.dependency.utils;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import junit.framework.TestCase;
23  
24  import org.apache.maven.plugin.logging.Log;
25  import org.codehaus.plexus.logging.Logger;
26  
27  public class TestSilentLog
28      extends TestCase
29  {
30  
31      public void testLog()
32      {
33          Log log = new DependencySilentLog();
34          String text = new String( "Text" );
35          Throwable e = new RuntimeException();
36          log.debug( text );
37          log.debug( text, e );
38          log.debug( e );
39          log.info( text );
40          log.info( text, e );
41          log.info( e );
42          log.warn( text );
43          log.warn( text, e );
44          log.warn( e );
45          log.error( text );
46          log.error( text, e );
47          log.error( e );
48          log.isDebugEnabled();
49          log.isErrorEnabled();
50          log.isWarnEnabled();
51          log.isInfoEnabled();
52      }
53  
54      public void testLogger()
55      {
56          Logger log = new DependencySilentLog();
57          String text = new String( "Text" );
58          Throwable e = new RuntimeException();
59  
60          log.debug( text );
61          log.debug( text, e );
62          log.error( text );
63          log.error( text, e );
64          log.warn( text );
65          log.warn( text, e );
66          log.info( text );
67          log.info( text, e );
68  
69          log.fatalError( text );
70          log.fatalError( text, e );
71          log.getChildLogger( text );
72          log.getName();
73          log.getThreshold();
74          log.isDebugEnabled();
75          log.isErrorEnabled();
76          log.isFatalErrorEnabled();
77          log.isInfoEnabled();
78          log.isWarnEnabled();
79      }
80  
81  }