|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AuditEvent | Line # 39 | 92.3% |
0.9230769
|
11.06 | 13 | 11 | 11 | 0.85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ( 10 of 459) | |||
| Result | |||
|
0.88461536
|
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testCheckC
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testCheckC
|
1 PASS | |
|
0.88461536
|
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testCheckCPP
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testCheckCPP
|
1 PASS | |
|
0.88461536
|
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testOffFormat
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testOffFormat
|
1 PASS | |
|
0.88461536
|
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testMessage
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testMessage
|
1 PASS | |
|
0.88461536
|
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testDefault
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testDefault
|
1 PASS | |
|
0.88461536
|
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testExpansion
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testExpansion
|
1 PASS | |
|
0.88461536
|
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testOffFormatCheck
com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilterTest.testOffFormatCheck
|
1 PASS | |
|
0.7307692
|
com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheckTest.testDefault
com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheckTest.testDefault
|
1 PASS | |
|
0.7307692
|
com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheckTest.testExcludeScope
com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheckTest.testExcludeScope
|
1 PASS | |
|
0.7307692
|
com.puppycrawl.tools.checkstyle.checks.FinalParametersCheckTest.testDefaultTokens
com.puppycrawl.tools.checkstyle.checks.FinalParametersCheckTest.testDefaultTokens
|
1 PASS | |
| 449 tests are not displayed. This report was configured to show the top 10 tests that covered this file. | |||
| 1 | //////////////////////////////////////////////////////////////////////////////// | |
| 2 | // checkstyle: Checks Java source code for adherence to a set of rules. | |
| 3 | // Copyright (C) 2001-2005 Oliver Burn | |
| 4 | // | |
| 5 | // This library is free software; you can redistribute it and/or | |
| 6 | // modify it under the terms of the GNU Lesser General Public | |
| 7 | // License as published by the Free Software Foundation; either | |
| 8 | // version 2.1 of the License, or (at your option) any later version. | |
| 9 | // | |
| 10 | // This library is distributed in the hope that it will be useful, | |
| 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | // Lesser General Public License for more details. | |
| 14 | // | |
| 15 | // You should have received a copy of the GNU Lesser General Public | |
| 16 | // License along with this library; if not, write to the Free Software | |
| 17 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 18 | //////////////////////////////////////////////////////////////////////////////// | |
| 19 | package com.puppycrawl.tools.checkstyle.api; | |
| 20 | ||
| 21 | import java.util.EventObject; | |
| 22 | ||
| 23 | ||
| 24 | /** | |
| 25 | * Raw event for audit. | |
| 26 | * <p> | |
| 27 | * <i> | |
| 28 | * I'm not very satisfied about the design of this event since there are | |
| 29 | * optional methods that will return null in most of the case. This will | |
| 30 | * need some work to clean it up especially if we want to introduce | |
| 31 | * a more sequential reporting action rather than a packet error | |
| 32 | * reporting. This will allow for example to follow the process quickly | |
| 33 | * in an interface or a servlet (yep, that's cool to run a check via | |
| 34 | * a web interface in a source repository ;-) | |
| 35 | * </i> | |
| 36 | * @author <a href="mailto:stephane.bailliez@wanadoo.fr">Stephane Bailliez</a> | |
| 37 | * @see AuditListener | |
| 38 | */ | |
| 39 | public final class AuditEvent | |
| 40 | extends EventObject | |
| 41 | { | |
| 42 | /** filename event associated with **/ | |
| 43 | private final String mFileName; | |
| 44 | /** message associated with the event **/ | |
| 45 | private final LocalizedMessage mMessage; | |
| 46 | ||
| 47 | /** | |
| 48 | * Creates a new instance. | |
| 49 | * @param aSource the object that created the event | |
| 50 | */ | |
| 51 | 902 |
public AuditEvent(Object aSource) |
| 52 | { | |
| 53 | 902 | this(aSource, null); |
| 54 | } | |
| 55 | ||
| 56 | /** | |
| 57 | * Creates a new <code>AuditEvent</code> instance. | |
| 58 | * @param aSrc source of the event | |
| 59 | * @param aFileName file associated with the event | |
| 60 | */ | |
| 61 | 1832 |
public AuditEvent(Object aSrc, String aFileName) |
| 62 | { | |
| 63 | 1832 | this(aSrc, aFileName, null); |
| 64 | } | |
| 65 | ||
| 66 | /** | |
| 67 | * Creates a new <code>AuditEvent</code> instance. | |
| 68 | * | |
| 69 | * @param aSrc source of the event | |
| 70 | * @param aFileName file associated with the event | |
| 71 | * @param aMessage the actual message | |
| 72 | */ | |
| 73 | 4193 |
public AuditEvent(Object aSrc, String aFileName, LocalizedMessage aMessage) |
| 74 | { | |
| 75 | 4193 | super(aSrc); |
| 76 | 4193 | mFileName = aFileName; |
| 77 | 4193 | mMessage = aMessage; |
| 78 | } | |
| 79 | ||
| 80 | /** | |
| 81 | * @return the file name currently being audited or null if there is | |
| 82 | * no relation to a file. | |
| 83 | */ | |
| 84 | 2341 |
public String getFileName() |
| 85 | { | |
| 86 | 2341 | return mFileName; |
| 87 | } | |
| 88 | ||
| 89 | /** | |
| 90 | * return the line number on the source file where the event occurred. | |
| 91 | * This may be 0 if there is no relation to a file content. | |
| 92 | * @return an integer representing the line number in the file source code. | |
| 93 | */ | |
| 94 | 2683 |
public int getLine() |
| 95 | { | |
| 96 | 2683 | return mMessage.getLineNo(); |
| 97 | } | |
| 98 | ||
| 99 | /** | |
| 100 | * return the message associated to the event. | |
| 101 | * @return the event message | |
| 102 | */ | |
| 103 | 2332 |
public String getMessage() |
| 104 | { | |
| 105 | 2332 | return mMessage.getMessage(); |
| 106 | } | |
| 107 | ||
| 108 | /** @return the column associated with the message **/ | |
| 109 | 4070 |
public int getColumn() |
| 110 | { | |
| 111 | 4070 | return mMessage.getColumnNo(); |
| 112 | } | |
| 113 | ||
| 114 | /** @return the audit event severity level **/ | |
| 115 | 4675 |
public SeverityLevel getSeverityLevel() |
| 116 | { | |
| 117 | 4675 | return (mMessage == null) |
| 118 | ? SeverityLevel.INFO | |
| 119 | : mMessage.getSeverityLevel(); | |
| 120 | } | |
| 121 | ||
| 122 | /** | |
| 123 | * @return the identifier of the module that generated the event. Can return | |
| 124 | * null. | |
| 125 | */ | |
| 126 | 0 |
public String getModuleId() |
| 127 | { | |
| 128 | 0 | return mMessage.getModuleId(); |
| 129 | } | |
| 130 | ||
| 131 | /** @return the name of the source for the message **/ | |
| 132 | 147 |
public String getSourceName() |
| 133 | { | |
| 134 | 147 | return mMessage.getSourceName(); |
| 135 | } | |
| 136 | ||
| 137 | ||