Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #255 from junkerm/develop
Browse files Browse the repository at this point in the history
v0.2.3
  • Loading branch information
junkerm authored Aug 21, 2018
2 parents 788f996 + bacbc97 commit 12e0fe9
Show file tree
Hide file tree
Showing 69 changed files with 42,697 additions and 41,837 deletions.
Binary file not shown.
82,106 changes: 41,587 additions & 40,519 deletions bundles/cnf/localrepo/index.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundles/cnf/localrepo/index.xml.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d4e95238dbdcf0608ad506462b622dbd2114f4950853eb4fb6414b724bfa6a34
e69e11017af52961825c2fc277d656b9e167524fcd1644cd2800c540dcc68976
Binary file not shown.
4 changes: 2 additions & 2 deletions bundles/cnf/releaserepo/index.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<repository increment="0" name="Release" xmlns="http://www.osgi.org/xmlns/repository/v1.0.0">
<?xml version="1.0" encoding="utf-8"?>
<repository increment="0" name="Release" xmlns="http://www.osgi.org/xmlns/repository/v1.0.0">
</repository>
2 changes: 1 addition & 1 deletion bundles/cnf/releaserepo/index.xml.sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
262a924c4164db96f2409bfbe8d20793eb0c91a51c3dcd7c2160cde2bac8a492
b699f269b1871b7ef42e54b5ceb7529989f9474ffa4217c696e5ad333ac8936c
5 changes: 3 additions & 2 deletions bundles/specmate-administration/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
specmate-model-gen;version=latest,\
org.eclipse.emf.common,\
specmate-emfrest-api;version=latest,\
org.eclipse.emf.cdo.common
Private-Package: com.specmate.administration.internal.services
org.eclipse.emf.cdo.common,\
specmate-rest;version=latest
Private-Package: com.specmate.administration.internal.services
Export-Package: com.specmate.administration.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

import com.specmate.administration.api.ESpecmateStatus;
import com.specmate.administration.api.IStatusService;
import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.common.SpecmateValidationException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.model.administration.AdministrationFactory;
import com.specmate.model.administration.Status;
import com.specmate.rest.RestResult;

@Component(immediate = true, service = { IRestService.class, IStatusService.class })
public class StatusService extends RestServiceBase implements IStatusService {
Expand Down
3 changes: 2 additions & 1 deletion bundles/specmate-auth-test/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ Test-Cases: \
specmate-emfrest-api;version=snapshot,\
specmate-connectors;version=snapshot,\
specmate-auth-api;version=snapshot,\
org.apache.felix.scr;version='[2.0.8,2.0.9)'
org.apache.felix.scr;version='[2.0.8,2.0.9)',\
specmate-rest;version=snapshot
4 changes: 0 additions & 4 deletions bundles/specmate-common/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ Export-Package: \
specmate-model-gen;version=latest,\
org.eclipse.emf.cdo.common,\
org.eclipse.net4j.util,\
org.glassfish.jersey.core.jersey-client,\
org.glassfish.jersey.core.jersey-common,\
javax.ws.rs-api,\
org.apache.commons.lang3,\
org.json;version=latest,\
org.glassfish.jersey.media.jersey-media-sse,\
specmate-config-api;version=latest
3 changes: 2 additions & 1 deletion bundles/specmate-connectors/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Export-Package: \
org.mockito.mockito-core;version=2.19,\
org.objenesis,\
net.bytebuddy.byte-buddy,\
net.bytebuddy.byte-buddy-agent
net.bytebuddy.byte-buddy-agent,\
specmate-rest;version=latest
Private-Package: \
com.specmate.connectors.internal,\
com.specmate.connectors.internal.config,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.osgi.service.log.LogService;

import com.specmate.auth.api.IAuthenticationService;
import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.common.SpecmateValidationException;
import com.specmate.connectors.api.IProject;
Expand All @@ -16,6 +15,7 @@
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.model.support.util.SpecmateEcoreUtil;
import com.specmate.model.testspecification.TestProcedure;
import com.specmate.rest.RestResult;
import com.specmate.usermodel.AccessRights;

@Component(immediate = true, service = IRestService.class)
Expand Down
3 changes: 2 additions & 1 deletion bundles/specmate-emfrest-api/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
specmate-common;version=latest,\
org.eclipse.emf.common,\
javax.ws.rs-api,\
org.eclipse.emf.ecore
org.eclipse.emf.ecore,\
specmate-rest;version=latest
Export-Package: com.specmate.emfrest.api
Bundle-Version: 0.0.0.${tstamp}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import javax.ws.rs.core.MultivaluedMap;

import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.common.SpecmateValidationException;
import com.specmate.rest.RestResult;

public interface IRestService extends Comparable<IRestService> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import javax.ws.rs.core.MultivaluedMap;

import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.common.SpecmateValidationException;
import com.specmate.rest.RestResult;

public abstract class RestServiceBase implements IRestService {

Expand Down
3 changes: 2 additions & 1 deletion bundles/specmate-emfrest/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Bundle-Version: 0.0.0.${tstamp}
specmate-emfrest-api;version=latest,\
specmate-connectors;version=latest,\
specmate-auth-api;version=latest,\
specmate-metrics;version=latest
specmate-metrics;version=latest,\
specmate-rest;version=latest

-dsannotations: \
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
package com.specmate.emfrest.authentication;

import javax.ws.rs.core.Response;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.log.LogService;

import com.specmate.auth.api.IAuthenticationService;
import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.usermodel.User;
import com.specmate.usermodel.UserSession;

@Component(service = IRestService.class)
public class Login extends RestServiceBase {
public static final String SERVICE_NAME = "login";

private IAuthenticationService authService;
private LogService logService;

@Override
public String getServiceName() {
return SERVICE_NAME;
}

@Override
public boolean canPost(Object object2, Object object) {
return true;
}

@Override
public RestResult<?> post(Object object, Object object2, String token) throws SpecmateException {
if (object2 instanceof User) {
User user = (User) object2;
try {
UserSession session = authService.authenticate(user.getUserName(), user.getPassWord(),
user.getProjectName());
logService.log(LogService.LOG_INFO,
"Session " + session.getId() + " for user " + user.getUserName() + " created.");
return new RestResult<>(Response.Status.OK, session);

} catch (SpecmateException e) {
logService.log(LogService.LOG_INFO, e.getMessage());
return new RestResult<>(Response.Status.FORBIDDEN);
}
} else {
throw new SpecmateException("Invalid login data.");
}
}

@Reference
public void setAuthService(IAuthenticationService authService) {
this.authService = authService;
}

@Reference
public void setLogService(LogService logService) {
this.logService = logService;
}
}
package com.specmate.emfrest.authentication;

import javax.ws.rs.core.Response;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.log.LogService;

import com.specmate.auth.api.IAuthenticationService;
import com.specmate.common.SpecmateException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.rest.RestResult;
import com.specmate.usermodel.User;
import com.specmate.usermodel.UserSession;

@Component(service = IRestService.class)
public class Login extends RestServiceBase {
public static final String SERVICE_NAME = "login";

private IAuthenticationService authService;
private LogService logService;

@Override
public String getServiceName() {
return SERVICE_NAME;
}

@Override
public boolean canPost(Object object2, Object object) {
return true;
}

@Override
public RestResult<?> post(Object object, Object object2, String token) throws SpecmateException {
if (object2 instanceof User) {
User user = (User) object2;
try {
UserSession session = authService.authenticate(user.getUserName(), user.getPassWord(),
user.getProjectName());
logService.log(LogService.LOG_INFO,
"Session " + session.getId() + " for user " + user.getUserName() + " created.");
return new RestResult<>(Response.Status.OK, session);

} catch (SpecmateException e) {
logService.log(LogService.LOG_INFO, e.getMessage());
return new RestResult<>(Response.Status.FORBIDDEN);
}
} else {
throw new SpecmateException("Invalid login data.");
}
}

@Reference
public void setAuthService(IAuthenticationService authService) {
this.authService = authService;
}

@Reference
public void setLogService(LogService logService) {
this.logService = logService;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import org.osgi.service.log.LogService;

import com.specmate.auth.api.IAuthenticationService;
import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.rest.RestResult;

@Component(service = IRestService.class)
public class Logout extends RestServiceBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

import com.specmate.common.RestResult;
import com.specmate.connectors.api.IProjectService;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.rest.RestResult;

@Component(service = IRestService.class)
public class ProjectNames extends RestServiceBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import org.osgi.service.component.annotations.Component;

import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.common.SpecmateValidationException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.model.processes.Process;
import com.specmate.model.requirements.CEGModel;
import com.specmate.model.testspecification.TestSpecification;
import com.specmate.rest.RestResult;

@Component(immediate = true, service = IRestService.class)
public class CopyService extends RestServiceBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;

import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.common.SpecmateValidationException;
import com.specmate.model.base.IContainer;
import com.specmate.model.base.IContentElement;
import com.specmate.model.support.util.SpecmateEcoreUtil;
import com.specmate.rest.RestResult;

public class CrudUtil {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import org.osgi.service.component.annotations.Reference;

import com.specmate.auth.api.IAuthenticationService;
import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.rest.RestResult;

@Component(immediate = true, service = IRestService.class)
public class DeleteService extends RestServiceBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import org.osgi.service.component.annotations.Reference;

import com.specmate.auth.api.IAuthenticationService;
import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.rest.RestResult;

@Component(immediate = true, service = IRestService.class)
public class DetailsService extends RestServiceBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.rest.RestResult;

@Component(immediate = true, service = IRestService.class)
public class ListRecursiveService extends RestServiceBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import org.osgi.service.component.annotations.Reference;

import com.specmate.auth.api.IAuthenticationService;
import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.common.SpecmateValidationException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.rest.RestResult;

@Component(immediate = true, service = IRestService.class)
public class ListService extends RestServiceBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.persistency.IHistoryProvider;
import com.specmate.rest.RestResult;

@Component(immediate = true, service = IRestService.class)
public class HistoryRecursiveRestService extends RestServiceBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

import com.specmate.common.RestResult;
import com.specmate.common.SpecmateException;
import com.specmate.emfrest.api.IRestService;
import com.specmate.emfrest.api.RestServiceBase;
import com.specmate.persistency.IHistoryProvider;
import com.specmate.rest.RestResult;

@Component(immediate = true, service = IRestService.class)
public class HistoryRestService extends RestServiceBase {
Expand Down
Loading

0 comments on commit 12e0fe9

Please sign in to comment.