| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.xtext.entitymock.common; |
| |
| import java.util.List; |
| import java.util.Map; |
| |
| import org.eclipse.osbp.core.api.persistence.IPersistenceService; |
| import org.eclipse.osbp.datainterchange.api.IDataInterchange; |
| import org.eclipse.osbp.runtime.common.event.IEventDispatcher; |
| import org.eclipse.osbp.ui.api.customfields.IBlobService; |
| |
| |
| /** |
| * Interface, that each Entity (DTO) Mock Generator has to implement |
| */ |
| public interface IEntityMockDataGenerator extends Comparable<IEntityMockDataGenerator> { |
| |
| final static int DEFAULT_PRIORITY = 10; |
| |
| /** |
| * The priority can be set in the entitymock model from 1 (highest) to 9 (almost lowest).<br> |
| * If is not explicit set, it's default value is 10 (lowest). |
| * |
| * @return the priority, this generator should run, compared to other generators |
| */ |
| public int getRunWithPriority(); |
| |
| /** |
| * Run any datainterchanges references by the mock generator |
| * |
| * @param persistenceService |
| */ |
| public void runDataInterchanges(IPersistenceService persistenceService, IDataInterchange dataInterchange, IEventDispatcher eventDispatcher, IBlobService blobService, IEntityMockDataDbFiller entityMockDbFiller); |
| |
| /** |
| * Generate entity DTO mock data objects, depending on the base .entitymock DSL instance.<br> |
| * The map key holds a MockedEntityDto instance, which holds both the entity DTO class - for example <code>org.eclipse.osbp.foodmart.dtos.McustomerDto.class</code> - and the |
| * target persistence unit.<br> |
| * The map value is a list with generated entity DTO objects, in the example above instances of <code>org.eclipse.osbp.foodmart.dtos.McustomerDto</code> |
| * |
| * @return the map and list of generated entity DTO objects |
| */ |
| public Map<MockedEntityDto, List<Object>> getMockData(IEntityMockDataDbFiller entityMockDbFiller, IPersistenceService persistenceService, IBlobService blobService); |
| |
| /** |
| * Gets the number of data interchange steps. |
| * |
| * @return the data interchange steps |
| */ |
| public int getDataInterchangeSteps(); |
| |
| /** |
| * Gets the number of entity mock steps. |
| * |
| * @return the entity mock steps |
| */ |
| public int getEntityMockSteps(); |
| } |