Skip to content

Commit

Permalink
JobExecutionService should not be configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Mezzasalma <claudio.mezzasalma@eurotech.com>
  • Loading branch information
Claudio Mezzasalma authored and Coduz committed Dec 1, 2020
1 parent 16f4664 commit 2bd3f0f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ Scenario: Regular job execution creation
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job execution service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job execution item
Then No exception was thrown
Expand All @@ -43,10 +39,6 @@ Scenario: Update job id of an existing execution item
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job execution service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job execution item
Then I create a job with the name "TestJob2"
Expand All @@ -60,10 +52,6 @@ Scenario: Update the end time of an existing execution item
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job execution service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job execution item
When I update the end time of the execution item
Expand All @@ -78,10 +66,6 @@ Scenario: Delete a job execution item
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job execution service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job execution item
Then I delete the last job execution in the database
Expand All @@ -95,10 +79,6 @@ Scenario: Delete a job execution item twice
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job execution service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job execution item
Then I delete the last job execution in the database
Expand All @@ -113,10 +93,6 @@ Scenario: Create and count several execution items for a job
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job execution service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob"
And A regular job execution item
And A regular job execution item
Expand All @@ -133,10 +109,6 @@ Scenario: Query for executions of a specific job
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I configure the job execution service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
Given I create a job with the name "TestJob1"
And A regular job execution item
And A regular job execution item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.eclipse.kapua.model.query.KapuaQuery;
import org.eclipse.kapua.service.KapuaEntityService;
import org.eclipse.kapua.service.KapuaUpdatableEntityService;
import org.eclipse.kapua.service.config.KapuaConfigurableService;

/**
* {@link JobExecutionService} exposes APIs to manage JobExecution objects.<br>
Expand All @@ -25,8 +24,7 @@
* @since 1.0
*/
public interface JobExecutionService extends KapuaEntityService<JobExecution, JobExecutionCreator>,
KapuaUpdatableEntityService<JobExecution>,
KapuaConfigurableService {
KapuaUpdatableEntityService<JobExecution> {

/**
* Returns the {@link JobExecutionListResult} with elements matching the provided query.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import org.eclipse.kapua.KapuaEntityNotFoundException;
import org.eclipse.kapua.KapuaException;
import org.eclipse.kapua.commons.configuration.AbstractKapuaConfigurableResourceLimitedService;
import org.eclipse.kapua.commons.service.internal.AbstractKapuaService;
import org.eclipse.kapua.commons.util.ArgumentValidator;
import org.eclipse.kapua.locator.KapuaLocator;
import org.eclipse.kapua.locator.KapuaProvider;
Expand All @@ -25,9 +25,7 @@
import org.eclipse.kapua.service.job.JobDomains;
import org.eclipse.kapua.service.job.execution.JobExecution;
import org.eclipse.kapua.service.job.execution.JobExecutionCreator;
import org.eclipse.kapua.service.job.execution.JobExecutionFactory;
import org.eclipse.kapua.service.job.execution.JobExecutionListResult;
import org.eclipse.kapua.service.job.execution.JobExecutionQuery;
import org.eclipse.kapua.service.job.execution.JobExecutionService;
import org.eclipse.kapua.service.job.internal.JobEntityManagerFactory;

Expand All @@ -37,17 +35,15 @@
* @since 1.0.0
*/
@KapuaProvider
public class JobExecutionServiceImpl
extends AbstractKapuaConfigurableResourceLimitedService<JobExecution, JobExecutionCreator, JobExecutionService, JobExecutionListResult, JobExecutionQuery, JobExecutionFactory>
implements JobExecutionService {
public class JobExecutionServiceImpl extends AbstractKapuaService implements JobExecutionService {

private static final KapuaLocator LOCATOR = KapuaLocator.getInstance();

private static final AuthorizationService AUTHORIZATION_SERVICE = LOCATOR.getService(AuthorizationService.class);
private static final PermissionFactory PERMISSION_FACTORY = LOCATOR.getFactory(PermissionFactory.class);

public JobExecutionServiceImpl() {
super(JobExecutionService.class.getName(), JobDomains.JOB_DOMAIN, JobEntityManagerFactory.getInstance(), JobExecutionService.class, JobExecutionFactory.class);
super(JobEntityManagerFactory.getInstance(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1355,30 +1355,6 @@ public void testTheJobTargetFactory() {
// * Job Execution Service Test steps *
// ************************************************************************************

@When("^I configure the job execution service$")
public void setJobExecutionConfigurationValue(List<CucConfig> cucConfigs) throws Exception {

Map<String, Object> valueMap = new HashMap<>();
KapuaId accId = getCurrentScopeId();
KapuaId scopeId = getCurrentParentId();

for (CucConfig config : cucConfigs) {
config.addConfigToMap(valueMap);
if (config.getParentId() != null) {
scopeId = getKapuaId(config.getParentId());
}
if (config.getScopeId() != null) {
accId = getKapuaId(config.getScopeId());
}
}
try {
primeException();
jobExecutionService.setConfigValues(accId, scopeId, valueMap);
} catch (KapuaException ke) {
verifyException(ke);
}
}

@Given("^A regular job execution item$")
public void createARegularExecution() throws Exception {

Expand Down

0 comments on commit 2bd3f0f

Please sign in to comment.