Source Code Cross Referenced for InvocationTest.java in  » Development » SLF4J » org » slf4j » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » SLF4J » org.slf4j 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Copyright (c) 2004-2007 QOS.CH
003:         * 
004:         * All rights reserved.
005:         * 
006:         * Permission is hereby granted, free of charge, to any person obtaining
007:         * a copy of this software and associated documentation files (the
008:         * "Software"), to  deal in  the Software without  restriction, including
009:         * without limitation  the rights to  use, copy, modify,  merge, publish,
010:         * distribute, and/or sell copies of  the Software, and to permit persons
011:         * to whom  the Software is furnished  to do so, provided  that the above
012:         * copyright notice(s) and this permission notice appear in all copies of
013:         * the  Software and  that both  the above  copyright notice(s)  and this
014:         * permission notice appear in supporting documentation.
015:         * 
016:         * THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
017:         * EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
018:         * MERCHANTABILITY, FITNESS FOR  A PARTICULAR PURPOSE AND NONINFRINGEMENT
019:         * OF  THIRD PARTY  RIGHTS. IN  NO EVENT  SHALL THE  COPYRIGHT  HOLDER OR
020:         * HOLDERS  INCLUDED IN  THIS  NOTICE BE  LIABLE  FOR ANY  CLAIM, OR  ANY
021:         * SPECIAL INDIRECT  OR CONSEQUENTIAL DAMAGES, OR  ANY DAMAGES WHATSOEVER
022:         * RESULTING FROM LOSS  OF USE, DATA OR PROFITS, WHETHER  IN AN ACTION OF
023:         * CONTRACT, NEGLIGENCE  OR OTHER TORTIOUS  ACTION, ARISING OUT OF  OR IN
024:         * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
025:         * 
026:         * Except as  contained in  this notice, the  name of a  copyright holder
027:         * shall not be used in advertising or otherwise to promote the sale, use
028:         * or other dealings in this Software without prior written authorization
029:         * of the copyright holder.
030:         *
031:         */
032:
033:        package org.slf4j;
034:
035:        import junit.framework.TestCase;
036:
037:        /**
038:         * Test whether invoking the SLF4J API causes problems or not.
039:         * 
040:         * @author Ceki Gulcu
041:         *
042:         */
043:        public class InvocationTest extends TestCase {
044:
045:            public InvocationTest(String arg0) {
046:                super (arg0);
047:            }
048:
049:            protected void setUp() throws Exception {
050:                super .setUp();
051:            }
052:
053:            protected void tearDown() throws Exception {
054:                super .tearDown();
055:            }
056:
057:            public void test1() {
058:                Logger logger = LoggerFactory.getLogger("test1");
059:                logger.debug("Hello world.");
060:            }
061:
062:            public void test2() {
063:                Integer i1 = new Integer(1);
064:                Integer i2 = new Integer(2);
065:                Integer i3 = new Integer(3);
066:                Exception e = new Exception("This is a test exception.");
067:                Logger logger = LoggerFactory.getLogger("test2");
068:
069:                logger.debug("Hello world 1.");
070:                logger.debug("Hello world {}", i1);
071:                logger.debug("val={} val={}", i1, i2);
072:                logger.debug("val={} val={} val={}",
073:                        new Object[] { i1, i2, i3 });
074:
075:                logger.debug("Hello world 2", e);
076:                logger.info("Hello world 2.");
077:
078:                logger.warn("Hello world 3.");
079:                logger.warn("Hello world 3", e);
080:
081:                logger.error("Hello world 4.");
082:                logger.error("Hello world {}", new Integer(3));
083:                logger.error("Hello world 4.", e);
084:            }
085:
086:            public void testNull() {
087:                Logger logger = LoggerFactory.getLogger("testNull");
088:                logger.debug(null);
089:                logger.info(null);
090:                logger.warn(null);
091:                logger.error(null);
092:
093:                Exception e = new Exception("This is a test exception.");
094:                logger.debug(null, e);
095:                logger.info(null, e);
096:                logger.warn(null, e);
097:                logger.error(null, e);
098:            }
099:
100:            public void testMarker() {
101:                Logger logger = LoggerFactory.getLogger("testMarker");
102:                Marker blue = MarkerFactory.getMarker("BLUE");
103:                logger.debug(blue, "hello");
104:                logger.info(blue, "hello");
105:                logger.warn(blue, "hello");
106:                logger.error(blue, "hello");
107:
108:                logger.debug(blue, "hello {}", "world");
109:                logger.info(blue, "hello {}", "world");
110:                logger.warn(blue, "hello {}", "world");
111:                logger.error(blue, "hello {}", "world");
112:
113:                logger.debug(blue, "hello {} and {} ", "world", "universe");
114:                logger.info(blue, "hello {} and {} ", "world", "universe");
115:                logger.warn(blue, "hello {} and {} ", "world", "universe");
116:                logger.error(blue, "hello {} and {} ", "world", "universe");
117:            }
118:
119:            public void testMDC() {
120:                MDC.put("k", "v");
121:                assertNull(MDC.get("k"));
122:                MDC.remove("k");
123:                assertNull(MDC.get("k"));
124:                MDC.clear();
125:            }
126:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.