/**
 * <License>
 */
package edu.colorado.csdms.wmt.client;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.google.gwt.core.client.JsArrayInteger;
import com.google.gwt.junit.client.GWTTestCase;

import edu.colorado.csdms.wmt.client.data.LabelQueryJSO;

/**
 * Tests for {@link LabelQueryJSO}. JUnit integration is provided by
 * extending {@link GWTTestCase}.
 * 
 * @see http://www.gwtproject.org/doc/latest/DevGuideTesting.html
 * @see http://www.gwtproject.org/doc/latest/tutorial/JUnit.html
 * @see http
 *      ://blog.danielwellman.com/2008/08/testing-json-parsing-using-javascript
 *      -overlay-types-in-gwt-15.html
 * @author Mark Piper (mark.piper@colorado.edu)
 */
public class LabelQueryJSOTest extends GWTTestCase {

  private LabelQueryJSO jso;
  private JsArrayInteger ids;
  
  /**
   * The module that sources this class. Must be present.
   */
  @Override
  public String getModuleName() {
     return "edu.colorado.csdms.wmt.WMT";
  }
  
  /**
   * A JSNI method that defines a fixture for the tests. Returns a
   * {@link LabelQueryJSO} object for testing.
   * 
   * @param ids
   */
  private native LabelQueryJSO testLabelModelQueryJSO(JsArrayInteger ids) /*-{
		return {
			"ids" : ids
		}
  }-*/;  
  
  @Before
  @Override
  protected void gwtSetUp() throws Exception {
    ids = (JsArrayInteger) JsArrayInteger.createArray();
    ids.push(4);
    ids.push(3);
    ids.push(12);
    jso = testLabelModelQueryJSO(ids);
  }

  @After
  @Override
  protected void gwtTearDown() throws Exception {
  }

  @Test
  public void testLength() {
    int arrayLength = 3;
    assertEquals(arrayLength, jso.getIds().length());
  }
  
  @Test
  public void testGetModelIds() {
    assertEquals(ids, jso.getIds());
  }
}

@@ -1230,28 +1230,12 @@
 urn 
-%7B%0A%09%09%09%22ids%22 : ids%0A%09%09%7D
+ids;
 %0A  %7D
@@ -1365,14 +1365,37 @@
 eate
-Array(
+Object();%0A    ids.setLength(3
 );%0A 
@@ -1565,16 +1565,51 @@
  %7B%0A  %7D%0A%0A
+  // Test the length of the array.%0A
   @Test%0A
@@ -1720,18 +1720,59 @@
 ));%0A  %7D%0A
+%0A
   
+// Test whether all ids can be accessed.
 %0A  @Test
@@ -1793,21 +1793,16 @@
  testGet
-Model
 Ids() %7B%0A

Fix LabelQueryJSO tests