private void createCategoryForImages() { ContentCategory newCategory = new ContentCategory(); newCategory.setContentTypeName(IMAGE_CONTENTTYPE_NAME); newCategory.setName("importCategory"); ContentRepository repository = (ContentRepository) getTestSession().get(TEST_REPOSITORY_KEY); String[] parentNames = {repository.getName()}; newCategory.setParentNames(parentNames); getTestSession().put(IMAGE_CATEGORY_KEY, newCategory); repositoryService.addCategory(getTestSession(), newCategory); }
@Test( dependsOnMethods = "setup", description = "Go to an image archive and click import. Add a zip-file with images, and verify that all images are imported to the archive. ") public void importZipImagesTest() throws IOException { ContentCategory categoryForImport = (ContentCategory) getTestSession().get(IMAGE_CATEGORY_KEY); String[] pathToCategory = new String[] {categoryForImport.getParentNames()[0], categoryForImport.getName()}; ContentsTableFrame tableUI = contentService.doImportZipFile(getTestSession(), IMPORT_IMAGES_ZIP, false, pathToCategory); ZipFile zipfile = getZipFile(IMPORT_IMAGES_ZIP); Assert.assertTrue( isExistsOnUI(zipfile, tableUI), "expected content names and actual names are not equal!"); logger.info("file: " + IMPORT_IMAGES_ZIP + "has imported"); }