Skip to content

Commit 138b80d

Browse files
authored
remove leftover test/experiment (#4270)
1 parent 23a8484 commit 138b80d

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/history/FileHistoryCacheTest.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,18 @@
3737
import java.io.File;
3838
import java.io.FileOutputStream;
3939
import java.io.IOException;
40-
import java.io.OutputStream;
4140
import java.nio.charset.StandardCharsets;
4241
import java.nio.file.Files;
4342
import java.nio.file.Path;
4443
import java.nio.file.Paths;
4544
import java.nio.file.attribute.FileTime;
46-
import java.util.ArrayList;
47-
import java.util.Collections;
4845
import java.util.Date;
4946
import java.util.Iterator;
5047
import java.util.LinkedList;
5148
import java.util.List;
5249
import java.util.Map;
5350
import java.util.Set;
5451

55-
import com.fasterxml.jackson.databind.ObjectMapper;
56-
import com.fasterxml.jackson.databind.ObjectWriter;
57-
import com.fasterxml.jackson.dataformat.smile.SmileFactory;
58-
import com.fasterxml.jackson.dataformat.smile.SmileParser;
59-
import com.fasterxml.jackson.dataformat.smile.databind.SmileMapper;
6052
import org.apache.commons.lang3.time.DateUtils;
6153
import org.eclipse.jgit.api.Git;
6254
import org.junit.jupiter.api.AfterEach;
@@ -991,41 +983,4 @@ void testStoreAndTryToGetIgnored() throws Exception {
991983
retrievedHistory = cache.get(makefile, repo, true);
992984
assertNotNull(retrievedHistory, "history for Makefile should not be null");
993985
}
994-
995-
// TODO
996-
@Test
997-
void testSmile() throws Exception {
998-
ObjectMapper mapper = new SmileMapper();
999-
File outputFile = new File("/tmp/histentry");
1000-
ObjectWriter objectWriter = mapper.writer().forType(HistoryEntry.class);
1001-
1002-
try (OutputStream outputStream = new FileOutputStream(outputFile)) {
1003-
HistoryEntry historyEntry = new HistoryEntry("1.1.1", "1",
1004-
new Date(1245446973L / 60 * 60 * 1000),
1005-
"xyz",
1006-
"Return failure when executed with no arguments",
1007-
true, Collections.emptyList());
1008-
byte[] bytes = objectWriter.writeValueAsBytes(historyEntry);
1009-
outputStream.write(bytes);
1010-
1011-
historyEntry = new HistoryEntry("2.2.2", "2",
1012-
new Date(1245446973L / 60 * 60 * 1000),
1013-
"xyz",
1014-
"Return failure when executed with no arguments",
1015-
true, Collections.emptyList());
1016-
bytes = objectWriter.writeValueAsBytes(historyEntry);
1017-
outputStream.write(bytes);
1018-
}
1019-
1020-
SmileFactory factory = new SmileFactory();
1021-
List<HistoryEntry> historyEntryList = new ArrayList<>();
1022-
try (SmileParser parser = factory.createParser(outputFile)) {
1023-
parser.setCodec(mapper);
1024-
Iterator<HistoryEntry> historyEntryIterator = parser.readValuesAs(HistoryEntry.class);
1025-
historyEntryIterator.forEachRemaining(historyEntryList::add);
1026-
}
1027-
1028-
History history = new History(historyEntryList);
1029-
System.out.println(history);
1030-
}
1031986
}

0 commit comments

Comments
 (0)