Ovn2/EgnaTest
2024-04-15 09:20:15 +02:00

31 lines
821 B
Plaintext

import java.util.Collection;
import java.util.*;
public class EgnaTest {
//private static Collection<Recording> data1;
private static final int TEST_SIZE = 1000000;
public static void main(String[] args) {
SearchOperations testLetare = new Searcher(new Data().getRecordings());
//Test antal artister
long nummerOfArtist = testLetare.numberOfArtists();
System.out.println(nummerOfArtist);
}
private static Collection<Recording> generateRandomData() {
Collection<Recording> data = new LinkedList<>();
Random random = new Random();
for (int i = 0; i < TEST_SIZE; i++) {
data.add(new Recording("Title" + random.nextInt(TEST_SIZE), "Artist" + random.nextInt(TEST_SIZE / 10),
1900 + random.nextInt(122), random.nextBoolean() ? "LP" : "CD", Set.of("Jazz")));
}
return data;
}
}