use of org.mycore.frontend.classeditor.MCRLabelSetTypeAdapter in project mycore by MyCoRe-Org.
the class MCRClassificationListener method contextInitialized.
@Override
public void contextInitialized(ServletContextEvent arg0) {
MCRJSONManager mg = MCRJSONManager.instance();
mg.registerAdapter(new MCRCategoryTypeAdapter());
mg.registerAdapter(new MCRCategoryIDTypeAdapter());
mg.registerAdapter(new MCRLabelSetTypeAdapter());
mg.registerAdapter(new MCRCategoryListTypeAdapter());
}
use of org.mycore.frontend.classeditor.MCRLabelSetTypeAdapter in project mycore by MyCoRe-Org.
the class MCRClassificationEditorResourceTest method init.
@Before
public void init() {
MCRJSONManager mg = MCRJSONManager.instance();
mg.registerAdapter(new MCRCategoryTypeAdapter());
mg.registerAdapter(new MCRCategoryIDTypeAdapter());
mg.registerAdapter(new MCRLabelSetTypeAdapter());
mg.registerAdapter(new MCRCategoryListTypeAdapter());
try {
MCRStoreManager.createStore("jportal_jpclassi", MCRMetadataStore.class);
} catch (ReflectiveOperationException e) {
LOGGER.error("while creating store jportal_jpclassi", e);
}
try {
/* its important to set the daomock via this method because the factory could be called
* by a previous test. In this case a class cast exception occur because MCRCategoryDAOImpl
* was loaded. */
MCRCategoryDAOFactory.set(CategoryDAOMock.class);
categDAO = (CategoryDAOMock) MCRCategoryDAOFactory.getInstance();
categDAO.init();
} catch (Exception exc) {
assertTrue(false);
}
}
Aggregations