#78 - Add Dummy
This commit is contained in:
parent
4de0e37902
commit
33e426e7f5
@ -1,19 +1,24 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class AuthorsCommitTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public AuthorsCommitTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public AuthorsCommitTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -23,7 +28,14 @@ public class AuthorsCommitTS extends AbstractTimeSeriesCreator {
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<TimeSeries>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,24 +1,37 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class AuthorsCompletedIssueTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public AuthorsCompletedIssueTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public AuthorsCompletedIssueTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,24 +1,36 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class AuthorsIssueTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public AuthorsIssueTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public AuthorsIssueTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<TimeSeries>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,19 +1,24 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class BranchTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public BranchTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public BranchTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -23,7 +28,14 @@ public class BranchTS extends AbstractTimeSeriesCreator {
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,24 +1,36 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ClassTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public ClassTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public ClassTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<TimeSeries>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,24 +1,36 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class DependenceTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public DependenceTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public DependenceTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<TimeSeries>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,24 +1,36 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class InterfaceTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public InterfaceTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public InterfaceTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<TimeSeries>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,24 +1,36 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class IssuesTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public IssuesTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public IssuesTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,24 +1,36 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ProcessTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public ProcessTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public ProcessTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,24 +1,37 @@
|
||||
package ru.ulstu.extractor.ts.creator;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.extractor.gitrepository.service.GitRepositoryService;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeries;
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesType;
|
||||
import ru.ulstu.extractor.ts.service.TimeSeriesService;
|
||||
import ru.ulstu.extractor.ts.util.Dummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class StarTS extends AbstractTimeSeriesCreator {
|
||||
private final TimeSeriesService timeSeriesService;
|
||||
|
||||
public StarTS(TimeSeriesService timeSeriesService) {
|
||||
private final GitRepositoryService gitRepositoryService;
|
||||
|
||||
public StarTS(TimeSeriesService timeSeriesService, GitRepositoryService gitRepositoryService) {
|
||||
this.timeSeriesService = timeSeriesService;
|
||||
this.gitRepositoryService = gitRepositoryService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TimeSeries> getTimeSeries(Integer repositoryId, String branchName) {
|
||||
return new ArrayList<>();
|
||||
return Collections.singletonList(
|
||||
new TimeSeries(
|
||||
String.format("%s %s %s",
|
||||
gitRepositoryService.findById(repositoryId).getName(),
|
||||
branchName,
|
||||
getTimeSeriesType().getDescription()),
|
||||
getTimeSeriesType(),
|
||||
Dummy.getDefaultTimeSeries()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
13
src/main/java/ru/ulstu/extractor/ts/util/DateUtils.java
Normal file
13
src/main/java/ru/ulstu/extractor/ts/util/DateUtils.java
Normal file
@ -0,0 +1,13 @@
|
||||
package ru.ulstu.extractor.ts.util;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
public class DateUtils {
|
||||
public static Date addMonths(int amount) {
|
||||
Calendar c = GregorianCalendar.getInstance();
|
||||
c.add(Calendar.DAY_OF_MONTH, amount);
|
||||
return c.getTime();
|
||||
}
|
||||
}
|
15
src/main/java/ru/ulstu/extractor/ts/util/Dummy.java
Normal file
15
src/main/java/ru/ulstu/extractor/ts/util/Dummy.java
Normal file
@ -0,0 +1,15 @@
|
||||
package ru.ulstu.extractor.ts.util;
|
||||
|
||||
import ru.ulstu.extractor.ts.model.TimeSeriesValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Dummy {
|
||||
public static List<TimeSeriesValue> getDefaultTimeSeries (){
|
||||
return List.of(new TimeSeriesValue(DateUtils.addMonths(-5), 1.0),
|
||||
new TimeSeriesValue(DateUtils.addMonths(-4), 2.0),
|
||||
new TimeSeriesValue(DateUtils.addMonths(-3), 3.0),
|
||||
new TimeSeriesValue(DateUtils.addMonths(-2), 4.0),
|
||||
new TimeSeriesValue(DateUtils.addMonths(-1), 5.0));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user