Skip to content

Commit

Permalink
[ISSUE alibaba#11967] Can not aquire the specific config
Browse files Browse the repository at this point in the history
  • Loading branch information
syshenyao authored and [email protected] committed May 6, 2024
1 parent 5228a88 commit 8ec3d26
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class ConfigRawDiskServiceTest extends TestCase {
@Before
public void setUp() throws Exception {
cachedOsName = System.getProperty("os.name");
System.setProperty("os.name", "window");
}

@After
Expand All @@ -41,10 +42,9 @@ public void tearDown() throws Exception {
}

/**
* 测试获取beta文件路径.
* 测试获取文件路径.
*/
public void testTargetFile() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
System.setProperty("os.name", "window");
Method method = ConfigRawDiskService.class.getDeclaredMethod("targetFile", String.class, String.class, String.class);
method.setAccessible(true);
File result = (File) method.invoke(null, "aaaa\\dsaknkf", "aaaa/dsaknkf", "aaaa:dsaknkf");
Expand All @@ -65,7 +65,6 @@ public void testTargetFile() throws NoSuchMethodException, IllegalAccessExceptio
* 测试获取beta文件路径.
*/
public void testTargetBetaFile() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
System.setProperty("os.name", "window");
Method method = ConfigRawDiskService.class.getDeclaredMethod("targetBetaFile", String.class, String.class, String.class);
method.setAccessible(true);
File result = (File) method.invoke(null, "aaaa\\dsaknkf", "aaaa/dsaknkf", "aaaa:dsaknkf");
Expand All @@ -90,7 +89,6 @@ public void testTargetBetaFile() throws NoSuchMethodException, IllegalAccessExce
* @throws InvocationTargetException 目标异常
*/
public void testTargetTagFile() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
System.setProperty("os.name", "window");
Method method = ConfigRawDiskService.class.getDeclaredMethod("targetTagFile", String.class, String.class, String.class, String.class);
method.setAccessible(true);
File result = (File) method.invoke(null, "aaaa\\dsaknkf", "aaaa/dsaknkf", "aaaa:dsaknkf", "aaaadsaknkf");
Expand Down

0 comments on commit 8ec3d26

Please sign in to comment.