-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from stelin/main
Fixed bug
- Loading branch information
Showing
37 changed files
with
581 additions
and
135 deletions.
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
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
package io.openjob.common.util; | ||
|
||
import org.checkerframework.checker.units.qual.A; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.net.InetAddress; | ||
import java.net.UnknownHostException; | ||
|
||
/** | ||
* @author stelin [email protected] | ||
* @since 1.0.0 | ||
|
@@ -16,4 +20,22 @@ public void testGetLocalIp() { | |
String formatAddress = IpUtil.getFormatAddress(); | ||
Assertions.assertNotNull(formatAddress); | ||
} | ||
|
||
@Test | ||
public void testGetIpByHost() throws UnknownHostException { | ||
String ip = IpUtil.getIpByHost("localhost"); | ||
Assertions.assertEquals(ip, "127.0.0.1"); | ||
|
||
String ip2 = IpUtil.getIpByHost("127.0.0.1"); | ||
Assertions.assertEquals(ip2, "127.0.0.1"); | ||
|
||
String ip3 = IpUtil.getIpByHost("github.com"); | ||
Assertions.assertNotNull(ip3); | ||
|
||
String ip4 = IpUtil.getIpByHost("20.205.243.166"); | ||
Assertions.assertEquals(ip4, "20.205.243.166"); | ||
|
||
String ip5 = IpUtil.getIpByHost("172.20.1.166"); | ||
Assertions.assertEquals(ip5, "172.20.1.166"); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -5,25 +5,37 @@ | |
import lombok.Getter; | ||
|
||
/** | ||
* user: 100+ | ||
* namespace: 200+ | ||
* application: 300+ | ||
* job: 400+ | ||
* delay: 500+ | ||
* User: 100+ | ||
* Namespace: 200+ | ||
* Application: 300+ | ||
* Job: 400+ | ||
* Delay: 500+ | ||
* | ||
* @author stelin [email protected] | ||
* @since 1.0.0 | ||
*/ | ||
@Getter | ||
@AllArgsConstructor | ||
public enum CodeEnum implements CodeExceptionAssert { | ||
// Code list | ||
USER_EXIST(100, "User is exist!"), | ||
|
||
/** | ||
* App name not exist | ||
*/ | ||
NAME_EXIST(100, "App name must be globally unique!"), | ||
// Namespace | ||
NAMESPACE_DELETE_INVALID(200, "Namespace can not be delete!"), | ||
|
||
// Application | ||
APP_NAME_EXIST(300, "App name must be globally unique!"), | ||
APP_DELETE_INVALID(301, "Application can not be deleted!"), | ||
|
||
// Job | ||
TIME_EXPRESSION_INVALID(400, "Time expression is invalid"), | ||
JOB_DELETE_INVALID(401, "Job can not be deleted!"), | ||
|
||
// Delay | ||
DELAY_TOPIC_EXIST(500, "Topic is exist!"), | ||
DELAY_DELETE_INVALID(501, "Delay can not be deleted!"), | ||
; | ||
|
||
TIME_EXPRESSION_INVALID(400, "Time expression is invalid"); | ||
|
||
/** | ||
* Value | ||
|
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
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
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
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
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
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
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
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
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
Oops, something went wrong.