Code example for XmlSerializer

Methods: attribute

0
    } 
 
    private void recordTestTime() throws IOException { 
        if (!mTimeAlreadyWritten) {
            mTimeAlreadyWritten = true;
            mSerializer.attribute("", ATTRIBUTE_TIME, String.format(Locale.ENGLISH, "%.3f",
                    (System.currentTimeMillis() - mTestStartTime) / 1000.));
        } 
    } 
 
    @Override 
    public void endTest(Test test) {
        try { 
            if (test instanceof TestCase) {
                recordTestTime(); 
                mSerializer.endTag("", TAG_CASE);
            } 
        } catch (IOException e) {
            Log.e(LOG_TAG, safeMessage(e));
        } 
Experience pair programming with AI  Get Codota for Java