use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class GetSchemaTest method testLockedProjects.
@Test
public void testLockedProjects() {
setUser(1);
SchemaDTO schema = execute(new GetSchema());
assertThat(schema.getProjectById(1).getLockedPeriods().size(), equalTo(1));
LockedPeriodSet locks = new LockedPeriodSet(schema);
assertTrue(locks.isProjectLocked(1, new LocalDate(2009, 1, 1)));
assertTrue(locks.isProjectLocked(1, new LocalDate(2009, 1, 6)));
assertTrue(locks.isProjectLocked(1, new LocalDate(2009, 1, 12)));
assertFalse(locks.isProjectLocked(1, new LocalDate(2008, 1, 12)));
assertFalse(locks.isProjectLocked(1, new LocalDate(2010, 1, 12)));
}
use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class GetSchemaTest method toCSV.
@Test
public void toCSV() {
SchemaDTO schema = execute(new GetSchema());
SchemaCsvWriter writer = new SchemaCsvWriter();
writer.write(schema.getDatabaseById(1));
System.out.println(writer.toString());
}
use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class LinkIndicatorTest method setUser.
@Before
public void setUser() {
setUser(DATABASE_OWNER);
/*
* Initial data load
*/
SchemaDTO schema = execute(new GetSchema());
db = schema.getDatabaseById(1);
}
use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class PartnerTest method testAddPartner.
@Test
public void testAddPartner() throws Exception {
PartnerDTO newPartner = new PartnerDTO();
newPartner.setName("Solidarites");
CreateResult cr = execute(new AddPartner(PEAR_PLUS_DB_ID, newPartner));
Assert.assertEquals(SOL_ID, cr.getNewId());
SchemaDTO schema = execute(new GetSchema());
PartnerDTO partner = schema.getDatabaseById(PEAR_PLUS_DB_ID).getPartnerById(SOL_ID);
Assert.assertNotNull(partner);
Assert.assertEquals(newPartner.getName(), partner.getName());
}
use of org.activityinfo.shared.command.GetSchema in project activityinfo by bedatadriven.
the class TargetTest method setUser.
@Before
public void setUser() {
setUser(DATABASE_OWNER);
/*
* Initial data load
*/
SchemaDTO schema = execute(new GetSchema());
db = schema.getDatabaseById(1);
}
Aggregations