@@ -0,0 +1,2409 @@
+/**%0A * %3CLicense%3E%0A */%0Apackage edu.colorado.csdms.wmt.client;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport com.google.gwt.core.client.JsArray;%0Aimport com.google.gwt.junit.client.GWTTestCase;%0A%0Aimport edu.colorado.csdms.wmt.client.data.ModelListJSO;%0A%0A/**%0A * Tests for %7B@link ModelListJSO%7D. JUnit integration is provided by extending%0A * %7B@link GWTTestCase%7D.%0A * %0A * @see http://www.gwtproject.org/doc/latest/DevGuideTesting.html%0A * @see http://www.gwtproject.org/doc/latest/tutorial/JUnit.html%0A * @author Mark Piper (mark.piper@colorado.edu)%0A */%0Apublic class ModelListJSOTest extends GWTTestCase %7B%0A%0A  private ModelListJSO jso;%0A  private String name;%0A  private int id;%0A  private JsArray%3CModelListJSO%3E jsoList;%0A%0A  /**%0A   * The module that sources this class. Must be present.%0A   */%0A  @Override%0A  public String getModuleName() %7B%0A    return %22edu.colorado.csdms.wmt.WMT%22;%0A  %7D%0A%0A  /**%0A   * A JSNI method that defines a fixture for the tests. Returns a%0A   * %7B@link ModelListJSO%7D object for testing.%0A   * %0A   * @param ids%0A   */%0A  private native ModelListJSO testModelListJSO(String name, int id) /*-%7B%0A%09%09return %7B%0A%09%09%09%22name%22 : name,%0A%09%09%09%22id%22 : id%0A%09%09%7D;%0A  %7D-*/;%0A%0A  @SuppressWarnings(%22unchecked%22)%0A  @Before%0A  @Override%0A  protected void gwtSetUp() throws Exception %7B%0A    name = %22HydroTrend and Friends%22;%0A    id = 5;%0A    jso = testModelListJSO(name, id);%0A    %0A    jsoList = (JsArray%3CModelListJSO%3E) ModelListJSO.createObject();%0A    jsoList.setLength(3);%0A    jsoList.push(jso);%0A    jsoList.push(testModelListJSO(%22foo%22, 42));%0A    jsoList.push(testModelListJSO(%22bar%22, 1));%0A  %7D%0A%0A  @After%0A  @Override%0A  protected void gwtTearDown() throws Exception %7B%0A  %7D%0A%0A  // Test getting the name of the model.%0A  @Test%0A  public void testGetName() %7B%0A    assertEquals(name, jso.getName());%0A  %7D%0A%0A  // Test setting the name of the model.%0A  @Test%0A  public void testSetName() %7B%0A    String newName = %22Foo%22;%0A    jso.setName(newName);%0A    assertEquals(newName, jso.getName());%0A  %7D%0A%0A  // Test getting the id of the model.%0A  @Test%0A  public void testGetId() %7B%0A    assertEquals(id, jso.getModelId());%0A  %7D%0A  %0A  // Test the length of the array.%0A  @Test%0A  public void testLength() %7B%0A    int arrayLength = 3;%0A    assertEquals(arrayLength, jsoList.length());%0A  %7D%0A%0A  // Test whether a single model can be retrieved.%0A//  @Test%0A//  public void testGetSingleId() %7B%0A//    int index = 0;%0A//    assertEquals(jso, jsoList.get(index));%0A//  %7D%0A%7D%0A

Add ModelListJSOTest