Update Commons-IO and refactoring code for JUnit

This commit is contained in:
Bogdan Bodnarjuk 2016-05-06 11:26:18 +03:00 committed by skylow95
parent 6bce8f3f54
commit 577eb6fd41
21 changed files with 48 additions and 61 deletions

View file

@ -49,10 +49,18 @@ Changes
* Update Jfree
* Update JGraphT
* Update DBUnit
* Update JodaTime
* Update Gettext
* Update Jasper Reports
* Update EasyMock
* Update JDBC driver
* Update Сommons-IO
* Update LibrePlan version to 1.6.0
* Remove Ezmorph
* Remove Json-lib
* Code refactoring

View file

@ -97,13 +97,6 @@
<scope>test</scope>
</dependency>
<!-- JSON lib -->
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<classifier>jdk15</classifier>
</dependency>
<!-- Commons Math-->
<dependency>
<groupId>org.apache.commons</groupId>

View file

@ -21,7 +21,7 @@
package org.libreplan.business.test.advance.entities;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

View file

@ -21,7 +21,7 @@
package org.libreplan.business.test.advance.entities;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

View file

@ -19,15 +19,13 @@
package org.libreplan.business.test.externalcompanies.daos;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.libreplan.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.joda.time.LocalDate;
@ -35,18 +33,13 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.libreplan.business.calendars.daos.IBaseCalendarDAO;
import org.libreplan.business.calendars.entities.BaseCalendar;
import org.libreplan.business.common.IAdHocTransactionService;
import org.libreplan.business.common.IOnTransaction;
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.externalcompanies.daos.ICustomerCommunicationDAO;
import org.libreplan.business.externalcompanies.entities.CustomerCommunication;
import org.libreplan.business.externalcompanies.entities.ExternalCompany;
import org.libreplan.business.orders.daos.IOrderDAO;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.scenarios.IScenarioManager;
import org.libreplan.business.test.calendars.entities.BaseCalendarTest;
import org.libreplan.business.workreports.entities.WorkReportLine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

View file

@ -19,7 +19,7 @@
package org.libreplan.business.test.orders.daos;
import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertNotNull;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

View file

@ -21,7 +21,7 @@
package org.libreplan.business.test.orders.daos;
import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertNotNull;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

View file

@ -24,7 +24,7 @@ import static org.easymock.EasyMock.createNiceMock;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.core.AllOf.allOf;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItem;
import static org.hamcrest.CoreMatchers.hasItem;
import java.util.Arrays;
import java.util.HashSet;
@ -132,7 +132,7 @@ public class AggregatedHoursGroupTest {
private Matcher<AggregatedHoursGroup> withCriterions(
Criterion... criterions) {
final HashSet<Criterion> criterionsSet = new HashSet<Criterion>(Arrays
final HashSet<Criterion> criterionsSet = new HashSet<>(Arrays
.asList(criterions));
return new AggregatedHoursGroupMatcher() {
@ -150,7 +150,7 @@ public class AggregatedHoursGroupTest {
private Matcher<AggregatedHoursGroup> withHours(
HoursGroup... hours) {
final HashSet<HoursGroup> hoursSet = new HashSet<HoursGroup>(
final HashSet<HoursGroup> hoursSet = new HashSet<>(
Arrays.asList(hours));
return new AggregatedHoursGroupMatcher() {
@ -161,7 +161,7 @@ public class AggregatedHoursGroupTest {
@Override
public boolean matches(AggregatedHoursGroup aggregated) {
return new HashSet<HoursGroup>(aggregated.getHoursGroup())
return new HashSet<>(aggregated.getHoursGroup())
.equals(hoursSet);
}
};
@ -181,7 +181,7 @@ public class AggregatedHoursGroupTest {
private Set<CriterionRequirement> asCriterionRequirements(
Criterion... criterions) {
Set<CriterionRequirement> result = new HashSet<CriterionRequirement>();
Set<CriterionRequirement> result = new HashSet<>();
for (Criterion each : criterions) {
result.add(new DirectCriterionRequirement(each));
}

View file

@ -21,7 +21,7 @@
package org.libreplan.business.test.planner.daos;
import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

View file

@ -19,7 +19,7 @@
package org.libreplan.business.test.planner.daos;
import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;

View file

@ -27,7 +27,7 @@ import static org.easymock.EasyMock.replay;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.matchers.JUnitMatchers.hasItem;
import static org.hamcrest.CoreMatchers.hasItem;
import java.util.ArrayList;
import java.util.Collection;

View file

@ -32,9 +32,10 @@ import java.util.List;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.CoreMatchers;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.matchers.JUnitMatchers;
import org.libreplan.business.planner.entities.Share;
import org.libreplan.business.planner.entities.ShareDivision;
@ -52,7 +53,7 @@ public class ShareDivisionTest {
Share share2 = createExampleShare();
ShareDivision shareDivision = ShareDivision.create(Arrays.asList(
share1, share2));
assertThat(shareDivision.getShares(), JUnitMatchers.hasItems(share1,
assertThat(shareDivision.getShares(), CoreMatchers.hasItems(share1,
share2));
}

View file

@ -21,10 +21,10 @@
package org.libreplan.business.test.resources.daos;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.libreplan.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;

View file

@ -21,10 +21,10 @@
package org.libreplan.business.test.resources.daos;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.libreplan.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;

View file

@ -21,9 +21,9 @@
package org.libreplan.business.test.resources.daos;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.libreplan.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;

View file

@ -21,7 +21,7 @@
package org.libreplan.business.test.resources.entities;
import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

View file

@ -21,10 +21,10 @@
package org.libreplan.business.test.workreports.daos;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.libreplan.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;

View file

@ -21,9 +21,9 @@
package org.libreplan.business.test.workreports.daos;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.libreplan.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;

View file

@ -21,9 +21,9 @@
package org.libreplan.business.test.workreports.daos;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
import static org.libreplan.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;

View file

@ -21,7 +21,7 @@
package org.libreplan.business.test.workreports.entities;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

10
pom.xml
View file

@ -382,14 +382,6 @@
<scope>test</scope>
</dependency>
<!-- JSON lib -->
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.2.3</version>
<classifier>jdk15</classifier>
</dependency>
<!-- Commons Collections -->
<dependency>
<groupId>org.apache.commons</groupId>
@ -638,7 +630,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<version>2.5</version>
</dependency>
<!-- Quartz framework -->