-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
‘niuerzhuang’
committed
Jun 6, 2022
1 parent
fe94971
commit 521ba64
Showing
18 changed files
with
411 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* @author [email protected] | ||
*/ | ||
public class Constant { | ||
public static final String AGENT_VERSION_VALUE = "v1.7.2"; | ||
public static final String AGENT_VERSION_VALUE = "v1.7.0"; | ||
public static final String LANGUAGE = "JAVA"; | ||
|
||
public final static String API_AGENT_REGISTER = "/api/v1/agent/register"; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* @author [email protected] | ||
*/ | ||
public class Constants { | ||
public static final String AGENT_VERSION_VALUE = "v1.7.2"; | ||
public static final String AGENT_VERSION_VALUE = "v1.7.0"; | ||
public final static String API_REPORT_UPLOAD = "/api/v1/report/upload"; | ||
public final static String SERVER_ADDRESS = "/api/v1/agent/update"; | ||
public final static String API_HOOK_PROFILE = "/api/v1/profiles"; | ||
|
36 changes: 26 additions & 10 deletions
36
dongtai-core/src/test/java/com/secnium/iast/core/AgentEngineTest.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 |
---|---|---|
@@ -1,27 +1,43 @@ | ||
package com.secnium.iast.core; | ||
|
||
import io.dongtai.iast.core.utils.threadlocal.BooleanThreadLocal; | ||
import io.dongtai.log.DongTaiLog; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
import org.junit.Test; | ||
|
||
public class AgentEngineTest { | ||
|
||
public static void main(String[] args) { | ||
new AgentEngineTest().a(); | ||
|
||
} | ||
|
||
public AgentEngineTest(){ | ||
public AgentEngineTest() { | ||
|
||
} | ||
|
||
public void a(){ | ||
@Test | ||
public void a() { | ||
BooleanThreadLocal booleanThreadLocal = new BooleanThreadLocal(false); | ||
System.out.println(booleanThreadLocal.isEnterEntry()); | ||
booleanThreadLocal.set(true); | ||
System.out.println(booleanThreadLocal.isEnterEntry()); | ||
booleanThreadLocal.remove(); | ||
System.out.println(booleanThreadLocal.isEnterEntry()); | ||
} | ||
|
||
@Test | ||
public void b(boolean a) { | ||
try { | ||
System.out.println("b"); | ||
TimeUnit.SECONDS.sleep(10); | ||
System.out.println("a"); | ||
} catch (InterruptedException e) { | ||
DongTaiLog.error(e); | ||
if (a){ | ||
try { | ||
throw new IllegalStateException("DongTai agent request replay"); | ||
}catch (RuntimeException e){ | ||
System.out.println("DongTai agent request replay, please ignore"); | ||
} | ||
} | ||
} catch (NullPointerException e) { | ||
DongTaiLog.info("DongTai agent request replay, please ignore"); | ||
} | ||
} | ||
|
||
|
||
} |
24 changes: 24 additions & 0 deletions
24
dongtai-core/src/test/java/com/secnium/iast/core/Test.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,24 @@ | ||
package com.secnium.iast.core; | ||
|
||
import java.util.concurrent.atomic.AtomicLong; | ||
|
||
public class Test { | ||
|
||
private static final ThreadLocal<Long> responseTime = new ThreadLocal<>(); | ||
|
||
public void execute(int count){ | ||
for (int i = 0; i < count; i++) { | ||
responseTime.set(System.currentTimeMillis()); | ||
String testLine = "response time:"+(System.currentTimeMillis()-responseTime.get())+"ms"; | ||
} | ||
} | ||
|
||
@org.junit.Test | ||
public void test(){ | ||
Long start = System.currentTimeMillis(); | ||
execute(10000); | ||
Long end = System.currentTimeMillis(); | ||
System.out.println(end-start); | ||
} | ||
|
||
} |
Oops, something went wrong.