use of org.jbei.ice.storage.model.Account in project ice by JBEI.
the class CollectionEntriesTest method testGetEntriesByVisibility.
@Test
public void testGetEntriesByVisibility() throws Exception {
Account account = AccountCreator.createTestAccount("CollectionEntriesTest.testGetEntriesByVisibility", false);
Assert.assertNotNull(account);
long id = TestEntryCreator.createTestPart(account.getEmail());
Entry entry = DAOFactory.getEntryDAO().get(id);
entry.setVisibility(Visibility.DRAFT.getValue());
DAOFactory.getEntryDAO().update(entry);
CollectionEntries collectionEntries = new CollectionEntries(account.getEmail(), CollectionType.DRAFTS);
Results<PartData> results = collectionEntries.getEntries(ColumnField.CREATED, true, 0, 13);
Assert.assertNotNull(results);
Assert.assertEquals(1, results.getData().size());
Assert.assertEquals(1, results.getResultCount());
}
use of org.jbei.ice.storage.model.Account in project ice by JBEI.
the class GroupControllerTest method testCreate.
@Test
public void testCreate() throws Exception {
Account account = AccountCreator.createTestAccount("testCreate", false);
UserGroup userGroup = new UserGroup();
userGroup.setLabel("test Group");
userGroup.setDescription("test");
userGroup = controller.createGroup(account.getEmail(), userGroup);
Assert.assertNotNull(userGroup);
}
use of org.jbei.ice.storage.model.Account in project ice by JBEI.
the class PartSequenceTest method testGet.
@Test
public void testGet() throws Exception {
Account account = AccountCreator.createTestAccount("PartSequenceTest.testGet", false);
Strain strain = TestEntryCreator.createTestStrain(account);
PartSequence partSequence = new PartSequence(account.getEmail(), strain.getRecordId());
FeaturedDNASequence sequence = partSequence.get();
Assert.assertNull(sequence);
ByteArrayInputStream inputStream = new ByteArrayInputStream(genbank.getBytes());
SequenceInfo sequenceInfo = partSequence.parseSequenceFile(inputStream, "testFile.gb");
Assert.assertNotNull(sequenceInfo);
FeaturedDNASequence featuredDNASequence = (FeaturedDNASequence) sequenceInfo.getSequence();
Assert.assertNotNull(featuredDNASequence);
Assert.assertEquals(1, featuredDNASequence.getFeatures().size());
sequence = partSequence.get();
Assert.assertNotNull(sequence);
Assert.assertEquals(234, sequence.getSequence().length());
Assert.assertEquals(1, sequence.getFeatures().size());
}
use of org.jbei.ice.storage.model.Account in project ice by JBEI.
the class GroupControllerTest method testSetGroupMembers.
@Test
public void testSetGroupMembers() throws Exception {
Account a1 = AccountCreator.createTestAccount("testSetGroupMembers1", false);
AccountCreator.createTestAccount("testSetGroupMembers2", false);
AccountCreator.createTestAccount("testSetGroupMembers3", false);
UserGroup user = new UserGroup();
user.setDescription("desc");
user.setLabel("label");
user.setType(GroupType.PRIVATE);
// create group
user = controller.createGroup(a1.getEmail(), user);
Assert.assertNotNull(user);
}
use of org.jbei.ice.storage.model.Account in project ice by JBEI.
the class GroupControllerTest method testSave.
@Test
public void testSave() throws Exception {
Account account = AccountCreator.createTestAccount("testSave", false);
Group group = new Group();
group.setOwner(account);
group.setLabel("group label");
group.setDescription("group description");
Assert.assertNotNull(controller.save(group));
}
Aggregations