// Path: ali-plugin-main/src/test/java/com/hp/alm/ali/idea/MultiTest.java
// @RunWith(MultiTestRunner.class)
// public abstract class MultiTest extends IntellijTest {
// 
//     public MultiTest() {
//         super(null);
//     }
// 
//     public void setServerVersion(ServerVersion version) {
//         this.version = version;
//     }
// }


import com.hp.alm.ali.idea.MultiTest;
import com.hp.alm.ali.idea.RestInvocations;
import com.hp.alm.ali.idea.model.Entity;
import com.hp.alm.ali.idea.model.parser.RequirementTypeList;
import com.hp.alm.ali.idea.rest.ServerType;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
            @Override
            public void evaluate(RequirementTypeList types) {
                checkTypes(types);
            }
        });
    }

    @Test
    public void testLoadRequirementTypeList_dispatch() throws InterruptedException {
        RestInvocations.loadRequirementTypes(handler);
        handler.async();
        requirementTypeService.loadRequirementTypeListAsync(new DispatchTestCallback<RequirementTypeList>(handler) {
            @Override
            public void evaluate(RequirementTypeList types) {
                checkTypes(types);
            }
        });
    }

    private void checkTypes(RequirementTypeList types) {
        List<String> names = new LinkedList<String>();
        for(Entity entity: types) {
            names.add(entity.getPropertyValue("name"));
        }

        switch (version) {
            case AGM:
                Assert.assertEquals(Arrays.asList("Theme", "Folder", "User Story", "Group Story", "Feature"), names);
                break;

// Path: ali-plugin-main/src/test/java/com/hp/alm/ali/idea/MultiTest.java
// @RunWith(MultiTestRunner.class)
// public abstract class MultiTest extends IntellijTest {
// 
//     public MultiTest() {
//         super(null);
//     }
// 
//     public void setServerVersion(ServerVersion version) {
//         this.version = version;
//     }
// }


// Path: ali-plugin-main/src/test/java/com/hp/alm/ali/idea/services/RequirementTypeServiceTest.java
import com.hp.alm.ali.idea.MultiTest;
import com.hp.alm.ali.idea.RestInvocations;
import com.hp.alm.ali.idea.model.Entity;
import com.hp.alm.ali.idea.model.parser.RequirementTypeList;
import com.hp.alm.ali.idea.rest.ServerType;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

            @Override
            public void evaluate(RequirementTypeList types) {
                checkTypes(types);
            }
        });
    }

    @Test
    public void testLoadRequirementTypeList_dispatch() throws InterruptedException {
        RestInvocations.loadRequirementTypes(handler);
        handler.async();
        requirementTypeService.loadRequirementTypeListAsync(new DispatchTestCallback<RequirementTypeList>(handler) {
            @Override
            public void evaluate(RequirementTypeList types) {
                checkTypes(types);
            }
        });
    }

    private void checkTypes(RequirementTypeList types) {
        List<String> names = new LinkedList<String>();
        for(Entity entity: types) {
            names.add(entity.getPropertyValue("name"));
        }

        switch (version) {
            case AGM:
                Assert.assertEquals(Arrays.asList("Theme", "Folder", "User Story", "Group Story", "Feature"), names);
                break;

            case ALI11_5: