package com.google.code.morphia.mapping;


import java.util.ArrayList;

import org.bson.types.ObjectId;
import org.junit.Assert;
import org.junit.Test;
import com.google.code.morphia.TestBase;
import com.google.code.morphia.annotations.Id;


/**
 * @author scotthernandez
 */
public class ListOfStringArrayMappingTest extends TestBase {
  private static class ContainsListStringArray {
    @Id ObjectId id;
    final ArrayList<String[]> listOfStrings = new ArrayList<String[]>();
  }

  @Test
  public void testMapping() throws Exception {
    morphia.map(ContainsListStringArray.class);
    final ContainsListStringArray ent = new ContainsListStringArray();
    ent.listOfStrings.add(new String[] { "a", "b" });
    ds.save(ent);
    final ContainsListStringArray loaded = ds.get(ent);
    Assert.assertNotNull(loaded.id);
    Assert.assertArrayEquals(ent.listOfStrings.get(0), loaded.listOfStrings.get(0));
  }
}
@@ -63,16 +63,39 @@
 rayList;
+%0Aimport java.util.List;
 %0A%0Aimport
@@ -433,21 +433,16 @@
   final 
-Array
 List%3CStr
@@ -491,16 +491,64 @@
 g%5B%5D%3E();%0A
+    String%5B%5D arrayOfStrings;%0A    String string;%0A
   %7D%0A%0A  @
@@ -772,16 +772,116 @@
 %22b%22 %7D);%0A
+    ent.arrayOfStrings =  new String%5B%5D %7B %22only%22, %22the%22, %22lonely%22 %7D;%0A    ent.string = %22raw string%22;%0A%0A
     ds.s
@@ -983,16 +983,16 @@
 ed.id);%0A
-
     Asse
@@ -1068,13 +1068,138 @@
 et(0));%0A
+    Assert.assertArrayEquals(ent.arrayOfStrings, loaded.arrayOfStrings);%0A    Assert.assertEquals(ent.string, loaded.string);%0A
   %7D%0A%7D

add support for String[]