Skip to content

Commit

Permalink
Merge pull request #140 from box/drop-folder-format
Browse files Browse the repository at this point in the history
drop name format changed to HH.mm.ss
jeeyi authored Jan 11, 2017
2 parents dbcda48 + 7beff08 commit 588583a
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -25,17 +25,17 @@
import com.box.l10n.mojito.service.tm.TMService;
import com.box.l10n.mojito.service.tm.UpdateTMWithXLIFFResult;
import com.box.l10n.mojito.service.translationkit.TranslationKitService;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import net.sf.okapi.common.exceptions.OkapiBadFilterInputException;
import net.sf.okapi.common.exceptions.OkapiIOException;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
* Service to generate {@link Drop}s.
@@ -345,7 +345,7 @@ String getDropName(Date uploadTime) {
currentWeek.setTime(uploadTime);
currentWeek.set(Calendar.WEEK_OF_YEAR, currentWeek.get(Calendar.WEEK_OF_YEAR) - dropServiceConfig.getDropNameWeekOffset());

return "Week " + currentWeek.get(Calendar.WEEK_OF_YEAR) + new SimpleDateFormat(" (EEEE) - dd MMMM YYYY - HH:mm:ss").format(uploadTime);
return "Week " + currentWeek.get(Calendar.WEEK_OF_YEAR) + new SimpleDateFormat(" (EEEE) - dd MMMM YYYY - HH.mm.ss").format(uploadTime);
}


Original file line number Diff line number Diff line change
@@ -33,10 +33,10 @@
import com.box.l10n.mojito.service.translationkit.TranslationKitRepository;
import com.box.l10n.mojito.test.TestIdWatcher;
import com.box.l10n.mojito.test.XliffUtils;
import java.nio.charset.StandardCharsets;
import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
@@ -635,10 +635,10 @@ public void testGetDropFolderName() {
Calendar cal = Calendar.getInstance();
cal.set(2013, 0, 1, 0, 0, 0);

assertEquals("Week 48 (Tuesday) - 01 January 2013 - 00:00:00", dropService.getDropName(cal.getTime()));
assertEquals("Week 48 (Tuesday) - 01 January 2013 - 00.00.00", dropService.getDropName(cal.getTime()));

cal.set(Calendar.WEEK_OF_YEAR, 6);
assertEquals("Week 1 (Tuesday) - 05 February 2013 - 00:00:00", dropService.getDropName(cal.getTime()));
assertEquals("Week 1 (Tuesday) - 05 February 2013 - 00.00.00", dropService.getDropName(cal.getTime()));
}

@Test
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ public void all() throws DropExporterException, DropImporterException, BoxSDKSer
logger.debug("Test initial creation");
BoxDropExporter boxDropExporter = new BoxDropExporter();
String groupName = testIdWatcher.getEntityName("groupName");
String dropName = groupName + new SimpleDateFormat(" (EEEE) - dd MMMM YYYY - HH:mm:ss").format(new Date());
String dropName = groupName + new SimpleDateFormat(" (EEEE) - dd MMMM YYYY - HH.mm.ss").format(new Date());
boxDropExporter.init(groupName, dropName);

logger.debug("Test re-creation from config");
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Rule;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@@ -39,7 +39,7 @@ public void all() throws DropExporterException, DropImporterException, BoxSDKSer
logger.debug("Test initial creation");
FileSystemDropExporter fileSystemDropExporter = new FileSystemDropExporter();
String groupName = testIdWatcher.getEntityName("groupName");
String dropName = groupName + new SimpleDateFormat(" (EEEE) - dd MMMM YYYY - HH:mm:ss").format(new Date());
String dropName = groupName + new SimpleDateFormat(" (EEEE) - dd MMMM YYYY - HH.mm.ss").format(new Date());
fileSystemDropExporter.init(groupName, dropName);

logger.debug("Test re-creation from config");

0 comments on commit 588583a

Please sign in to comment.