Package com.google.code.gaeom.test

Source Code of com.google.code.gaeom.test.TestMultiListNesting$C

package com.google.code.gaeom.test;

import java.util.List;

import org.junit.Test;

import com.google.code.gaeom.ObjectStore;
import com.google.code.gaeom.ObjectStoreSession;
import com.google.code.gaeom.annotation.Embedded;
import com.google.common.collect.Lists;

public class TestMultiListNesting extends AbstractLocalTest
{
  public static class A
  {
    @Embedded
    List<B> bs = Lists.newArrayList();
    String blah;
  }

  public static class B
  {
    @Embedded
    List<C> cs = Lists.newArrayList();
    String blah;
  }

  public static class C
  {
    String blah;
  }

  @Test(expected = IllegalArgumentException.class)
  public void testMultiNestingFailure()
  {
    A a = new A();

    a.bs.add(new B());
    a.bs.add(new B());

    a.bs.get(0).cs.add(new C());
    a.bs.get(0).cs.add(new C());
    a.bs.get(0).cs.add(new C());

    a.bs.get(1).cs.add(new C());
    a.bs.get(1).cs.add(new C());
    a.bs.get(1).cs.add(new C());
    a.bs.get(1).cs.add(new C());

    ObjectStoreSession oss = ObjectStore.Factory.create().beginSession();

    oss.store(a).now();

    a.bs = null;

    oss.refresh(a).now();

  }
}
TOP

Related Classes of com.google.code.gaeom.test.TestMultiListNesting$C

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.