package com.alibaba.json.bvt.issue_2700;

import com.alibaba.fastjson.JSON;
import junit.framework.TestCase;

import java.util.Date;

public class Issue2772 extends TestCase {
    public void test_for_issue() throws Exception {
        java.sql.Time time = java.sql.Time.valueOf("12:13:14");
        assertEquals("15194", JSON.toJSONStringWithDateFormat(time, "unixtime"));
        assertEquals("15194000", JSON.toJSONStringWithDateFormat(time, "millis"));

        long millis = System.currentTimeMillis();
        assertEquals(Long.toString(millis), JSON.toJSONStringWithDateFormat(new Date(millis), "millis"));
        assertEquals(Long.toString(millis/1000), JSON.toJSONStringWithDateFormat(new Date(millis), "unixtime"));
    }
}

@@ -221,16 +221,30 @@
 ption %7B%0A
+        %7B%0A    
         
@@ -311,28 +311,93 @@
     
-assertEquals(%2215194%22
+    long millis = time.getTime();%0A            assertEquals(Long.toString(millis/1000)
 , JS
@@ -446,32 +446,36 @@
 ime%22));%0A        
+    
 assertEquals(%2215
@@ -475,18 +475,29 @@
 als(
-%2215194000%22
+Long.toString(millis)
 , JS
@@ -543,16 +543,26 @@
 llis%22));
+%0A        %7D
 %0A%0A      

fix testcase