From c13f38b5de0c507a8d1bfb50117471b450a650f8 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Mon, 18 Sep 2017 16:20:51 +0300 Subject: [PATCH] add the missing class --- .../rm/community/base/DataProviderClass.java | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/DataProviderClass.java diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/DataProviderClass.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/DataProviderClass.java new file mode 100644 index 0000000000..c15fb6da96 --- /dev/null +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/DataProviderClass.java @@ -0,0 +1,149 @@ +/* + * #%L + * Alfresco Records Management Module + * %% + * Copyright (C) 2005 - 2017 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * - + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * - + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * - + * Alfresco is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * - + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ +package org.alfresco.rest.rm.community.base; + +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.TRANSFERS_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.FILE_PLAN_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.TRANSFER_CONTAINER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.TRANSFER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_CONTAINER_TYPE; +import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE; +import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; + +import org.testng.annotations.DataProvider; + +/** + * Data Provider class used in tests + * + * @author Rodica Sutu + * @since 2.6 + */ +public class DataProviderClass +{ + /** + * Data Provider with the special file plan components alias + * @return file plan component alias + */ + @DataProvider + public static Object[][] getContainers() + { + return new String[][] { + { FILE_PLAN_ALIAS }, + { TRANSFERS_ALIAS }, + { UNFILED_RECORDS_CONTAINER_ALIAS }, + }; + } + + /** + * Data Provider with: + * with the object types not allowed as children for a record category + * + * @return file plan component alias + */ + @DataProvider + public static Object[][] childrenNotAllowedForCategory() + { + return new String[][] { + { FILE_PLAN_TYPE }, + { TRANSFER_CONTAINER_TYPE }, + { UNFILED_CONTAINER_TYPE }, + { UNFILED_RECORD_FOLDER_TYPE }, + { TRANSFER_TYPE }, + { CONTENT_TYPE } + }; + } + + /** + * Data Provider with: + * with the object types for creating a Record Folder + * + * @return file plan component alias + */ + @DataProvider + public static Object[][] folderTypes() + { + return new String[][] { + { RECORD_FOLDER_TYPE }, + { FOLDER_TYPE } + }; + } + + /** + * Data Provider with: + * with the object types for creating a Record Category + * + * @return file plan component alias + */ + @DataProvider + public static String[][] categoryTypes() + { + return new String[][] { + { FOLDER_TYPE }, + { RECORD_CATEGORY_TYPE } + }; + } + + /** + * Data Provider with: + * with the object types for creating a Record Category Child + * + * @return record category child type + */ + @DataProvider + public static Object[][] categoryChild() + { + return new String[][] { + { RECORD_FOLDER_TYPE }, + { FOLDER_TYPE }, + { RECORD_CATEGORY_TYPE } + }; + } + + /** + * Invalid root level types, at unfiled record folder/unfiled containers container level that shouldn't be possible to create + */ + @DataProvider (name = "invalidRootTypes") + public static Object[][] getInvalidRootTypes() + { + return new String[][] + { + { FILE_PLAN_TYPE }, + { RECORD_CATEGORY_TYPE }, + { RECORD_FOLDER_TYPE }, + { TRANSFER_CONTAINER_TYPE }, + { TRANSFER_TYPE }, + { UNFILED_CONTAINER_TYPE }, + + }; + } +}