Package com.level3.meanwhile

Source Code of com.level3.meanwhile.TaskStatusTest

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.level3.meanwhile;

import com.level3.meanwhile.state.TaskStatus;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.*;

/**
*
* @author boatmeme
*/
public class TaskStatusTest extends MeanwhileTest{
   
    public TaskStatusTest() {
    }

    /**
     * Test of values method, of class TaskStatus.
     */
    @Test
    public void testValues() {
        TaskStatus[] eResult = {TaskStatus.CANCELED,
            TaskStatus.DEQUEUED,
            TaskStatus.FAILED,
            TaskStatus.QUEUED,
            TaskStatus.RETRY,
            TaskStatus.SUCCESS,
            TaskStatus.WORKING};
        List<TaskStatus> expResult = Arrays.asList(eResult);
        List<TaskStatus> result = Arrays.asList(TaskStatus.values());
        assertTrue("expectedResult containsAll result",result.containsAll(expResult));
        assertTrue("result containsAll expectedResult",expResult.containsAll(result));
    }

    /**
     * Test of valueOf method, of class TaskStatus.
     */
    @Test
    public void testValueOf() {
        String name = "CANCELED";
        TaskStatus expResult = TaskStatus.CANCELED;
        TaskStatus result = TaskStatus.valueOf(name);
        assertEquals(expResult, result);
    }
}
TOP

Related Classes of com.level3.meanwhile.TaskStatusTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.