-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support serialize jdbc struct, for issue #2205
- Loading branch information
Showing
4 changed files
with
49 additions
and
1 deletion.
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
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
21 changes: 21 additions & 0 deletions
21
core/src/test/java/com/alibaba/fastjson2/issues_2200/Issue2205.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,21 @@ | ||
package com.alibaba.fastjson2.issues_2200; | ||
|
||
import com.alibaba.fastjson2.JSONFactory; | ||
import com.alibaba.fastjson2.writer.ObjectWriterAdapter; | ||
import com.alibaba.fastjson2.writer.ObjectWriterProvider; | ||
import dm.jdbc.driver.DmdbStruct; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
public class Issue2205 { | ||
@Test | ||
public void test() { | ||
ObjectWriterProvider provider = JSONFactory.getDefaultObjectWriterProvider(); | ||
ObjectWriterAdapter objectWriter = (ObjectWriterAdapter) provider.getObjectWriter(DmdbStruct.class); | ||
assertEquals(2, objectWriter.getFieldWriters().size()); | ||
assertNotNull(objectWriter.getFieldWriter("attributes")); | ||
assertNotNull(objectWriter.getFieldWriter("SQLTypeName")); | ||
} | ||
} |