package org.jugile.daims;
import org.jugile.proto2.domain.Domain;
import org.jugile.proto2.domain.Person;
import org.jugile.util.JugileTestCase;
import org.jugile.util.Time;
public class ExamplesTest extends JugileTestCase {
public void testDemo1() {
Domain d = Domain.getDomain();
Person p1 = d.createPerson().setName("Bart Simpson").setAge(12).setTs(new Time("21.06.1971"));
long id = p1.id();
d.commit();
p1 = d.getPerson(id);
assertNotNull(p1);
String name = p1.getName();
assertEquals("Bart Simpson", name);
d.rollback();
}
public void testDelete() {
Domain d = Domain.getDomain();
for (Person p : d.getPersons()) p.delete();
d.commit();
}
}