Search in sources :

Example 6 with Category

use of cz.metacentrum.perun.cabinet.model.Category in project perun by CESNET.

the class CategoryManagerIntegrationTest method getCategoryByIdTest.

@Test
public void getCategoryByIdTest() throws Exception {
    System.out.println("CategoryManagerIntegrationTest.getCategoryByIdTest");
    Category c2 = getCabinetManager().getCategoryById(c1.getId());
    assertEquals("Original and retrieved Category by ID: " + c1.getId() + " are not same.", c1, c2);
}
Also used : Category(cz.metacentrum.perun.cabinet.model.Category) Test(org.junit.Test)

Example 7 with Category

use of cz.metacentrum.perun.cabinet.model.Category in project perun by CESNET.

the class CategoryManagerIntegrationTest method deleteCategoryWhenNotExistTest.

@Test(expected = CabinetException.class)
public void deleteCategoryWhenNotExistTest() throws Exception {
    System.out.println("CategoryManagerIntegrationTest.deleteCategoryWhenNotExistTest");
    getCabinetManager().deleteCategory(sess, new Category(0, "test", 1.0));
// should throw exception
}
Also used : Category(cz.metacentrum.perun.cabinet.model.Category) Test(org.junit.Test)

Example 8 with Category

use of cz.metacentrum.perun.cabinet.model.Category in project perun by CESNET.

the class CategoryManagerBlImpl method createCategory.

// methods ----------------------
@Override
public Category createCategory(PerunSession sess, Category category) throws CabinetException {
    Category newCategory = getCategoryManagerDao().createCategory(sess, category);
    log.debug("{} created.", newCategory);
    return newCategory;
}
Also used : Category(cz.metacentrum.perun.cabinet.model.Category)

Aggregations

Category (cz.metacentrum.perun.cabinet.model.Category)8 Test (org.junit.Test)4 Publication (cz.metacentrum.perun.cabinet.model.Publication)3 Authorship (cz.metacentrum.perun.cabinet.model.Authorship)2 Author (cz.metacentrum.perun.cabinet.model.Author)1 PublicationSystem (cz.metacentrum.perun.cabinet.model.PublicationSystem)1 Date (java.util.Date)1 HashSet (java.util.HashSet)1 Before (org.junit.Before)1