-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatible old ReportUtil usage and supply test cases #14
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
11c52ee
Merge pull request #1 from alipay/master
guanchao-yang 64bc68d
readme update
a26b6aa
readme
f4c0ff5
README Content and Format
35918b7
readme updated
8be5b8a
README.md Modify
9393b3a
readme.md
a402b02
readme.md
0f21d19
Merge pull request #2 from alipay/master
guanchao-yang bd0fe4b
Compatible for sofa-commont-utils
7674207
compatible
485aab2
test
48197e4
test cases
1a20030
English comment
da31feb
Conversion
db5d771
conversion
9adf381
Deprecated tag
7ddb0a3
Merge branch 'master' into master
khotyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Ask Question | ||
about: Ask a question about usage or feature | ||
|
||
--- | ||
|
||
### Your question | ||
|
||
describe your question clearly | ||
|
||
### Your scenes | ||
|
||
describe your use scenes (why need this feature) | ||
|
||
### Your advice | ||
|
||
describe the advice or solution you'd like | ||
|
||
### Environment | ||
|
||
- sofa-common-tools version: | ||
- JVM version (e.g. `java -version`): | ||
- OS version (e.g. `uname -a`): | ||
- Maven version: | ||
- IDE version: | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
name: Bug Report | ||
about: Create a report to help us improve | ||
|
||
--- | ||
|
||
### Describe the bug | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
### Expected behavior | ||
|
||
### Actual behavior | ||
|
||
### Steps to reproduce | ||
|
||
### Minimal yet complete reproducer code (or GitHub URL to code) | ||
|
||
### Environment | ||
|
||
- sofa-common-tools version: | ||
- JVM version (e.g. `java -version`): | ||
- OS version (e.g. `uname -a`): | ||
- Maven version: | ||
- IDE version: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### Motivation: | ||
|
||
Explain the context, and why you're making that change. | ||
To make others understand what is the problem you're trying to solve. | ||
|
||
### Modification: | ||
|
||
Describe the idea and modifications you've done. | ||
|
||
### Result: | ||
|
||
Fixes #<GitHub issue number>. | ||
|
||
If there is no issue then describe the changes introduced by this PR. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.alipay.sofa.common.log; | ||
|
||
/** | ||
* ReportUtil Compatible history usage | ||
* <p> | ||
* Output logs to console and default logger | ||
* <p> | ||
* Created by yangguanchao on 18/06/04. | ||
*/ | ||
@Deprecated | ||
public class ReportUtil extends com.alipay.sofa.common.utils.ReportUtil{ | ||
|
||
} | ||
|
||
|
40 changes: 40 additions & 0 deletions
40
src/test/java/com/alipay/sofa/common/utils/AssertUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.alipay.sofa.common.utils; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* AssertUtil Tester. | ||
* | ||
* @author <guanchao.ygc> | ||
* @version 1.0 | ||
* @since 18/06/04 | ||
*/ | ||
public class AssertUtilTest { | ||
|
||
|
||
/** | ||
* Method: isTrue(boolean expression, String message) | ||
*/ | ||
@Test | ||
public void testIsTrueForExpressionMessage() throws Exception { | ||
boolean isSuccess = false; | ||
AssertUtil.isTrue(!isSuccess, "isTrue"); | ||
boolean isException = false; | ||
try { | ||
AssertUtil.isTrue(isSuccess, "isTrue"); | ||
} catch (Exception ex) { | ||
isException = true; | ||
} | ||
AssertUtil.isTrue(isException); | ||
} | ||
|
||
/** | ||
* Method: isNull(Object object, String message) | ||
*/ | ||
@Test | ||
public void testIsNullForObjectMessage() throws Exception { | ||
Object object = null; | ||
AssertUtil.isNull(object, "null"); | ||
AssertUtil.isNull(object); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/test/java/com/alipay/sofa/common/utils/ReportUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.alipay.sofa.common.utils; | ||
|
||
import com.alipay.sofa.common.log.ReportUtil; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
|
||
/** | ||
* ReportUtil Tester. | ||
* | ||
* @author <guanchao.ygc> | ||
* @version 1.0 | ||
* @since 18/06/04 | ||
*/ | ||
public class ReportUtilTest { | ||
|
||
@Test | ||
public void testUtils() { | ||
String errMsg = "Some Error Msg"; | ||
boolean isException = false; | ||
try { | ||
ReportUtil.reportError("RuntimeException", new RuntimeException()); | ||
} catch (Exception ex) { | ||
isException = true; | ||
} | ||
assertFalse(isException); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this test case? It seems that it is not related to this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#16 only litte cases and should provide more test cases after 。 PR additional remarks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please only do one thing in on PR next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok