Skip to content

Commit

Permalink
Fix some quality flaws
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed Jan 15, 2015
1 parent 5e0d160 commit feaf31f
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 47 deletions.
Expand Up @@ -30,6 +30,7 @@
import java.io.Reader; import java.io.Reader;
import java.io.Writer; import java.io.Writer;
import java.util.Iterator; import java.util.Iterator;
import java.util.NoSuchElementException;


public class PreviousIssueHelper { public class PreviousIssueHelper {


Expand All @@ -47,7 +48,6 @@ public static interface Function<F, T> {
} }


public <G> void streamIssues(Writer out, Iterable<G> issues, Function<G, PreviousIssue> converter) { public <G> void streamIssues(Writer out, Iterable<G> issues, Function<G, PreviousIssue> converter) {
Gson gson = GsonHelper.create();
try { try {
JsonWriter writer = new JsonWriter(out); JsonWriter writer = new JsonWriter(out);
writer.setIndent(" "); writer.setIndent(" ");
Expand Down Expand Up @@ -101,6 +101,13 @@ public boolean hasNext() {


@Override @Override
public PreviousIssue next() { public PreviousIssue next() {
try {
if (!jsonreader.hasNext()) {
throw new NoSuchElementException();
}
} catch (IOException e) {
throw new IllegalStateException("Unable to iterate over JSON file ", e);
}
return gson.fromJson(jsonreader, PreviousIssue.class); return gson.fromJson(jsonreader, PreviousIssue.class);
} }


Expand Down
@@ -0,0 +1,24 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube 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.
*
* SonarQube 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 this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@ParametersAreNonnullByDefault
package org.sonar.batch.protocol.input.issues;

import javax.annotation.ParametersAreNonnullByDefault;

Expand Up @@ -19,14 +19,14 @@
*/ */
package org.sonar.batch.protocol.output; package org.sonar.batch.protocol.output;


import org.sonar.batch.protocol.output.component.ReportComponents;

import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter; import com.google.gson.stream.JsonWriter;
import org.apache.commons.io.Charsets;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.sonar.batch.protocol.GsonHelper; import org.sonar.batch.protocol.GsonHelper;
import org.sonar.batch.protocol.output.component.ReportComponents;
import org.sonar.batch.protocol.output.issue.ReportIssue; import org.sonar.batch.protocol.output.issue.ReportIssue;


import java.io.BufferedInputStream; import java.io.BufferedInputStream;
Expand All @@ -39,6 +39,7 @@
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.util.Iterator; import java.util.Iterator;
import java.util.NoSuchElementException;


public class ReportHelper { public class ReportHelper {


Expand Down Expand Up @@ -71,7 +72,6 @@ public void saveComponents(ReportComponents components) {
} }


public void saveIssues(long componentBatchId, Iterable<ReportIssue> issues) { public void saveIssues(long componentBatchId, Iterable<ReportIssue> issues) {
Gson gson = GsonHelper.create();
File issuesFile = getIssuesFile(componentBatchId); File issuesFile = getIssuesFile(componentBatchId);
try (OutputStreamWriter out = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(issuesFile)), "UTF-8")) { try (OutputStreamWriter out = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(issuesFile)), "UTF-8")) {


Expand Down Expand Up @@ -127,7 +127,7 @@ private final class ReportIssueIterator implements Iterator<ReportIssue> {


public ReportIssueIterator(File issuesFile) { public ReportIssueIterator(File issuesFile) {
try { try {
reader = new JsonReader(new InputStreamReader(new BufferedInputStream(new FileInputStream(issuesFile)))); reader = new JsonReader(new InputStreamReader(new BufferedInputStream(new FileInputStream(issuesFile)), Charsets.UTF_8));
reader.beginArray(); reader.beginArray();
} catch (IOException e) { } catch (IOException e) {
throw new IllegalStateException("Unable to read " + issuesFile, e); throw new IllegalStateException("Unable to read " + issuesFile, e);
Expand All @@ -151,6 +151,13 @@ public boolean hasNext() {


@Override @Override
public ReportIssue next() { public ReportIssue next() {
try {
if (!reader.hasNext()) {
throw new NoSuchElementException();
}
} catch (IOException e) {
throw new IllegalStateException("Unable to iterate over JSON file ", e);
}
return gson.fromJson(reader, ReportIssue.class); return gson.fromJson(reader, ReportIssue.class);
} }


Expand Down
@@ -0,0 +1,24 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube 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.
*
* SonarQube 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 this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@ParametersAreNonnullByDefault
package org.sonar.batch.protocol.output;

import javax.annotation.ParametersAreNonnullByDefault;

Expand Up @@ -25,7 +25,6 @@
import org.sonar.api.BatchExtension; import org.sonar.api.BatchExtension;
import org.sonar.api.database.DatabaseSession; import org.sonar.api.database.DatabaseSession;
import org.sonar.api.database.model.Snapshot; import org.sonar.api.database.model.Snapshot;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Qualifiers; import org.sonar.api.resources.Qualifiers;


import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
Expand All @@ -39,15 +38,13 @@ public class TimeMachineConfiguration implements BatchExtension {
private static final Logger LOG = LoggerFactory.getLogger(TimeMachineConfiguration.class); private static final Logger LOG = LoggerFactory.getLogger(TimeMachineConfiguration.class);


private final DatabaseSession session; private final DatabaseSession session;
private Project project;
private final PeriodsDefinition periodsDefinition; private final PeriodsDefinition periodsDefinition;


private List<Period> periods; private List<Period> periods;
private List<PastSnapshot> modulePastSnapshots; private List<PastSnapshot> modulePastSnapshots;


public TimeMachineConfiguration(DatabaseSession session, Project project, PeriodsDefinition periodsDefinition) { public TimeMachineConfiguration(DatabaseSession session, PeriodsDefinition periodsDefinition) {
this.session = session; this.session = session;
this.project = project;
this.periodsDefinition = periodsDefinition; this.periodsDefinition = periodsDefinition;
initModulePastSnapshots(); initModulePastSnapshots();
} }
Expand Down
Expand Up @@ -93,26 +93,27 @@ private void persist(BatchResource batchResource) {
return; return;
} }
BatchResource parentBatchResource = batchResource.parent(); BatchResource parentBatchResource = batchResource.parent();
Snapshot s;
if (parentBatchResource != null) { if (parentBatchResource != null) {
persist(parentBatchResource); persist(parentBatchResource);
s = persist(findModule(parentBatchResource), batchResource.resource(), parentBatchResource.resource());
} else {
// Root project
s = persistProject((Project) batchResource.resource(), null);
} }
Snapshot s = persist(findParentModule(batchResource), batchResource.resource(), parentBatchResource != null ? parentBatchResource.resource() : null);
batchResource.setSnapshot(s); batchResource.setSnapshot(s);
if (ResourceUtils.isPersistable(batchResource.resource())) { if (ResourceUtils.isPersistable(batchResource.resource())) {
graph.addComponent(batchResource.resource(), batchResource.snapshotId()); graph.addComponent(batchResource.resource(), batchResource.snapshotId());
} }
} }


@CheckForNull @CheckForNull
private Project findParentModule(BatchResource batchResource) { private Project findModule(BatchResource batchResource) {
if (batchResource != null && batchResource.parent() != null) { if (batchResource.resource() instanceof Project) {
if (batchResource.parent().resource() instanceof Project) { return (Project) batchResource.resource();
return (Project) batchResource.parent().resource(); } else {
} else { return findModule(batchResource.parent());
return findParentModule(batchResource.parent());
}
} }
return null;
} }


private Snapshot persistProject(Project project, @Nullable Project parent) { private Snapshot persistProject(Project project, @Nullable Project parent) {
Expand Down Expand Up @@ -158,18 +159,14 @@ Snapshot persist(Project project, Resource resource, @Nullable Resource parent)
if (resource instanceof Project) { if (resource instanceof Project) {
// should not occur, please use the method saveProject() // should not occur, please use the method saveProject()
snapshot = persistProject((Project) resource, (Project) parent); snapshot = persistProject((Project) resource, (Project) parent);

} else if (resource instanceof Library) {
snapshot = persistLibrary(project.getAnalysisDate(), (Library) resource);

} else { } else {
snapshot = persistFileOrDirectory(project, resource, parent); snapshot = persistFileOrDirectory(project, resource, parent);
} }


return snapshot; return snapshot;
} }


private Snapshot persistLibrary(Date analysisDate, Library library) { Snapshot persistLibrary(Date analysisDate, Library library) {
ResourceModel model = findOrCreateModel(library, null); ResourceModel model = findOrCreateModel(library, null);
model = session.save(model); model = session.save(model);
// TODO to be removed // TODO to be removed
Expand Down
Expand Up @@ -46,7 +46,7 @@


public final class DefaultPhaseExecutor implements PhaseExecutor { public final class DefaultPhaseExecutor implements PhaseExecutor {


public static final Logger LOGGER = LoggerFactory.getLogger(DefaultPhaseExecutor.class); private static final Logger LOGGER = LoggerFactory.getLogger(DefaultPhaseExecutor.class);


private final EventBus eventBus; private final EventBus eventBus;
private final Phases phases; private final Phases phases;
Expand Down
Expand Up @@ -23,7 +23,6 @@
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.sonar.api.batch.SensorContext; import org.sonar.api.batch.SensorContext;
import org.sonar.api.resources.Project; import org.sonar.api.resources.Project;
import org.sonar.batch.bootstrap.AnalysisMode;
import org.sonar.batch.events.BatchStepEvent; import org.sonar.batch.events.BatchStepEvent;
import org.sonar.batch.events.EventBus; import org.sonar.batch.events.EventBus;
import org.sonar.batch.index.DefaultIndex; import org.sonar.batch.index.DefaultIndex;
Expand All @@ -36,7 +35,7 @@


public final class PreviewPhaseExecutor implements PhaseExecutor { public final class PreviewPhaseExecutor implements PhaseExecutor {


public static final Logger LOGGER = LoggerFactory.getLogger(PreviewPhaseExecutor.class); private static final Logger LOGGER = LoggerFactory.getLogger(PreviewPhaseExecutor.class);


private final EventBus eventBus; private final EventBus eventBus;
private final Phases phases; private final Phases phases;
Expand All @@ -50,15 +49,14 @@ public final class PreviewPhaseExecutor implements PhaseExecutor {
private final DefaultModuleFileSystem fs; private final DefaultModuleFileSystem fs;
private final QProfileVerifier profileVerifier; private final QProfileVerifier profileVerifier;
private final IssueExclusionsLoader issueExclusionsLoader; private final IssueExclusionsLoader issueExclusionsLoader;
private final AnalysisMode analysisMode;
private final JsonReport jsonReport; private final JsonReport jsonReport;


public PreviewPhaseExecutor(Phases phases, public PreviewPhaseExecutor(Phases phases,
MavenPluginsConfigurator mavenPluginsConfigurator, InitializersExecutor initializersExecutor, MavenPluginsConfigurator mavenPluginsConfigurator, InitializersExecutor initializersExecutor,
SensorsExecutor sensorsExecutor, SensorsExecutor sensorsExecutor,
SensorContext sensorContext, DefaultIndex index, SensorContext sensorContext, DefaultIndex index,
EventBus eventBus, ProjectInitializer pi, FileSystemLogger fsLogger, JsonReport jsonReport, DefaultModuleFileSystem fs, QProfileVerifier profileVerifier, EventBus eventBus, ProjectInitializer pi, FileSystemLogger fsLogger, JsonReport jsonReport, DefaultModuleFileSystem fs, QProfileVerifier profileVerifier,
IssueExclusionsLoader issueExclusionsLoader, AnalysisMode analysisMode) { IssueExclusionsLoader issueExclusionsLoader) {
this.phases = phases; this.phases = phases;
this.mavenPluginsConfigurator = mavenPluginsConfigurator; this.mavenPluginsConfigurator = mavenPluginsConfigurator;
this.initializersExecutor = initializersExecutor; this.initializersExecutor = initializersExecutor;
Expand All @@ -72,7 +70,6 @@ public PreviewPhaseExecutor(Phases phases,
this.fs = fs; this.fs = fs;
this.profileVerifier = profileVerifier; this.profileVerifier = profileVerifier;
this.issueExclusionsLoader = issueExclusionsLoader; this.issueExclusionsLoader = issueExclusionsLoader;
this.analysisMode = analysisMode;
} }


/** /**
Expand Down
Expand Up @@ -76,12 +76,10 @@ public void validate(ProjectReactor reactor) {
} }


private void preventAutomaticProjectCreationIfNeeded(ProjectReactor reactor) { private void preventAutomaticProjectCreationIfNeeded(ProjectReactor reactor) {
if (resourceDao != null) { if (resourceDao != null && settings.getBoolean(CoreProperties.CORE_PREVENT_AUTOMATIC_PROJECT_CREATION)) {
if (settings.getBoolean(CoreProperties.CORE_PREVENT_AUTOMATIC_PROJECT_CREATION)) { String projectKey = reactor.getRoot().getKeyWithBranch();
String projectKey = reactor.getRoot().getKeyWithBranch(); if (resourceDao.findByKey(projectKey) == null) {
if (resourceDao.findByKey(projectKey) == null) { throw new SonarException(String.format("Unable to scan non-existing project \"%s\"", projectKey));
throw new SonarException(String.format("Unable to scan non-existing project \"%s\"", projectKey));
}
} }
} }
} }
Expand Down
Expand Up @@ -37,7 +37,7 @@ class MeasureValueCoder implements ValueCoder {
private final MetricFinder metricFinder; private final MetricFinder metricFinder;
private final TechnicalDebtModel techDebtModel; private final TechnicalDebtModel techDebtModel;


public MeasureValueCoder(MetricFinder metricFinder, TechnicalDebtModel techDebtModel) { public MeasureValueCoder(MetricFinder metricFinder, @Nullable TechnicalDebtModel techDebtModel) {
this.metricFinder = metricFinder; this.metricFinder = metricFinder;
this.techDebtModel = techDebtModel; this.techDebtModel = techDebtModel;
} }
Expand Down
Expand Up @@ -95,14 +95,15 @@ public void store(Measure newMeasure) {
org.sonar.api.measures.Measure measureToSave = new org.sonar.api.measures.Measure(m); org.sonar.api.measures.Measure measureToSave = new org.sonar.api.measures.Measure(m);
setValueAccordingToMetricType(newMeasure, m, measureToSave); setValueAccordingToMetricType(newMeasure, m, measureToSave);
measureToSave.setFromCore(measure.isFromCore()); measureToSave.setFromCore(measure.isFromCore());
if (newMeasure.inputFile() != null) { InputFile inputFile = newMeasure.inputFile();
if (inputFile != null) {
Formula formula = newMeasure.metric() instanceof org.sonar.api.measures.Metric ? Formula formula = newMeasure.metric() instanceof org.sonar.api.measures.Metric ?
((org.sonar.api.measures.Metric) newMeasure.metric()).getFormula() : null; ((org.sonar.api.measures.Metric) newMeasure.metric()).getFormula() : null;
if (formula instanceof SumChildDistributionFormula if (formula instanceof SumChildDistributionFormula
&& !Scopes.isHigherThanOrEquals(Scopes.FILE, ((SumChildDistributionFormula) formula).getMinimumScopeToPersist())) { && !Scopes.isHigherThanOrEquals(Scopes.FILE, ((SumChildDistributionFormula) formula).getMinimumScopeToPersist())) {
measureToSave.setPersistenceMode(PersistenceMode.MEMORY); measureToSave.setPersistenceMode(PersistenceMode.MEMORY);
} }
File sonarFile = getFile(newMeasure.inputFile()); File sonarFile = getFile(inputFile);
if (coverageExclusions.accept(sonarFile, measureToSave)) { if (coverageExclusions.accept(sonarFile, measureToSave)) {
sonarIndex.addMeasure(sonarFile, measureToSave); sonarIndex.addMeasure(sonarFile, measureToSave);
} }
Expand Down
Expand Up @@ -27,6 +27,9 @@


public class CoverageConstants { public class CoverageConstants {


private CoverageConstants() {
}

public static final Collection<Metric> COVERAGE_METRICS = ImmutableList.<Metric>of(CoreMetrics.LINES_TO_COVER, CoreMetrics.UNCOVERED_LINES, CoreMetrics.NEW_LINES_TO_COVER, public static final Collection<Metric> COVERAGE_METRICS = ImmutableList.<Metric>of(CoreMetrics.LINES_TO_COVER, CoreMetrics.UNCOVERED_LINES, CoreMetrics.NEW_LINES_TO_COVER,
CoreMetrics.NEW_UNCOVERED_LINES, CoreMetrics.CONDITIONS_TO_COVER, CoreMetrics.UNCOVERED_CONDITIONS, CoreMetrics.NEW_UNCOVERED_LINES, CoreMetrics.CONDITIONS_TO_COVER, CoreMetrics.UNCOVERED_CONDITIONS,
CoreMetrics.NEW_CONDITIONS_TO_COVER, CoreMetrics.NEW_UNCOVERED_CONDITIONS); CoreMetrics.NEW_CONDITIONS_TO_COVER, CoreMetrics.NEW_UNCOVERED_CONDITIONS);
Expand Down
@@ -0,0 +1,21 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube 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.
*
* SonarQube 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 this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@javax.annotation.ParametersAreNonnullByDefault
package org.sonar.batch.sensor.coverage;
Expand Up @@ -22,7 +22,6 @@
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.sonar.api.database.model.Snapshot; import org.sonar.api.database.model.Snapshot;
import org.sonar.api.resources.Project;
import org.sonar.jpa.test.AbstractDbUnitTestCase; import org.sonar.jpa.test.AbstractDbUnitTestCase;


import java.util.Date; import java.util.Date;
Expand Down Expand Up @@ -51,7 +50,7 @@ public void get_project_past_snapshot() {


when(periodsDefinition.getRootProjectPastSnapshots()).thenReturn(newArrayList(projectPastSnapshot)); when(periodsDefinition.getRootProjectPastSnapshots()).thenReturn(newArrayList(projectPastSnapshot));


TimeMachineConfiguration timeMachineConfiguration = new TimeMachineConfiguration(getSession(), (Project) new Project("my:project"), periodsDefinition); TimeMachineConfiguration timeMachineConfiguration = new TimeMachineConfiguration(getSession(), periodsDefinition);
assertThat(timeMachineConfiguration.periods()).hasSize(1); assertThat(timeMachineConfiguration.periods()).hasSize(1);
assertThat(timeMachineConfiguration.periods().get(0).getDate()).isNotNull(); assertThat(timeMachineConfiguration.periods().get(0).getDate()).isNotNull();
assertThat(timeMachineConfiguration.getProjectPastSnapshots()).hasSize(1); assertThat(timeMachineConfiguration.getProjectPastSnapshots()).hasSize(1);
Expand All @@ -67,7 +66,7 @@ public void get_module_past_snapshot() {


when(periodsDefinition.getRootProjectPastSnapshots()).thenReturn(newArrayList(projectPastSnapshot)); when(periodsDefinition.getRootProjectPastSnapshots()).thenReturn(newArrayList(projectPastSnapshot));


TimeMachineConfiguration timeMachineConfiguration = new TimeMachineConfiguration(getSession(), (Project) new Project("my:module"), periodsDefinition); TimeMachineConfiguration timeMachineConfiguration = new TimeMachineConfiguration(getSession(), periodsDefinition);
assertThat(timeMachineConfiguration.periods()).hasSize(1); assertThat(timeMachineConfiguration.periods()).hasSize(1);
assertThat(timeMachineConfiguration.periods().get(0).getDate()).isNotNull(); assertThat(timeMachineConfiguration.periods().get(0).getDate()).isNotNull();
assertThat(timeMachineConfiguration.getProjectPastSnapshots()).hasSize(1); assertThat(timeMachineConfiguration.getProjectPastSnapshots()).hasSize(1);
Expand All @@ -86,7 +85,7 @@ public void complete_past_snapshot_from_project_past_snapshot() {


when(periodsDefinition.getRootProjectPastSnapshots()).thenReturn(newArrayList(projectPastSnapshot)); when(periodsDefinition.getRootProjectPastSnapshots()).thenReturn(newArrayList(projectPastSnapshot));


TimeMachineConfiguration timeMachineConfiguration = new TimeMachineConfiguration(getSession(), (Project) new Project("my:project").setId(1), periodsDefinition); TimeMachineConfiguration timeMachineConfiguration = new TimeMachineConfiguration(getSession(), periodsDefinition);
assertThat(timeMachineConfiguration.getProjectPastSnapshots()).hasSize(1); assertThat(timeMachineConfiguration.getProjectPastSnapshots()).hasSize(1);
assertThat(timeMachineConfiguration.getProjectPastSnapshots().get(0).getProjectSnapshot().getId()).isEqualTo(1010); assertThat(timeMachineConfiguration.getProjectPastSnapshots().get(0).getProjectSnapshot().getId()).isEqualTo(1010);
assertThat(timeMachineConfiguration.getProjectPastSnapshots().get(0).getIndex()).isEqualTo(1); assertThat(timeMachineConfiguration.getProjectPastSnapshots().get(0).getIndex()).isEqualTo(1);
Expand All @@ -103,7 +102,7 @@ public void get_no_date_on_new_project() {


when(periodsDefinition.getRootProjectPastSnapshots()).thenReturn(newArrayList(projectPastSnapshot)); when(periodsDefinition.getRootProjectPastSnapshots()).thenReturn(newArrayList(projectPastSnapshot));


TimeMachineConfiguration timeMachineConfiguration = new TimeMachineConfiguration(getSession(), new Project("my:project"), periodsDefinition); TimeMachineConfiguration timeMachineConfiguration = new TimeMachineConfiguration(getSession(), periodsDefinition);
assertThat(timeMachineConfiguration.periods()).hasSize(1); assertThat(timeMachineConfiguration.periods()).hasSize(1);
assertThat(timeMachineConfiguration.periods().get(0).getDate()).isNull(); assertThat(timeMachineConfiguration.periods().get(0).getDate()).isNull();
} }
Expand Down

0 comments on commit feaf31f

Please sign in to comment.