Update Commons-IO and refactoring code for JUnit
This commit is contained in:
parent
6bce8f3f54
commit
577eb6fd41
21 changed files with 48 additions and 61 deletions
8
NEWS.rst
8
NEWS.rst
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
10
pom.xml
|
|
@ -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 -->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue