Updates for season 2022
This commit is contained in:
@@ -62,12 +62,12 @@ public class App {
|
|||||||
break;
|
break;
|
||||||
case "APIFootballUpdater":
|
case "APIFootballUpdater":
|
||||||
APIFootballUpdater apiFootballUpdater = new APIFootballUpdater();
|
APIFootballUpdater apiFootballUpdater = new APIFootballUpdater();
|
||||||
apiFootballUpdater.updateAllFixtures();
|
apiFootballUpdater.updateAllFixtures(season);
|
||||||
apiFootballUpdater.updateAllRounds();
|
apiFootballUpdater.updateAllRounds(season);
|
||||||
break;
|
break;
|
||||||
case "MatchesListGistUpdater":
|
case "MatchesListGistUpdater":
|
||||||
MatchesListForumUpdater matchesListForumUpdater = new MatchesListForumUpdater();
|
MatchesListForumUpdater matchesListForumUpdater = new MatchesListForumUpdater(season);
|
||||||
matchesListForumUpdater.updateAllLeagues();
|
matchesListForumUpdater.updateAllLeagues(season);
|
||||||
break;
|
break;
|
||||||
case "PostChecksum":
|
case "PostChecksum":
|
||||||
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ public class ResourceProvider {
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JSONArray getLigenConfig() {
|
public static JSONArray getLigenConfig(int season) {
|
||||||
return getJSONArrayFromResource("Tippliga/Ligen.json");
|
return getJSONArrayFromResource("Tippliga/" + season + "_Ligen.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JSONArray getTeamIDMatcherConfig() {
|
public static JSONArray getTeamIDMatcherConfig() {
|
||||||
|
|||||||
@@ -47,15 +47,15 @@ public class APIFootballUpdater {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAllFixtures() {
|
public void updateAllFixtures(int season) {
|
||||||
HashSet<Integer> leagues = getLeagues();
|
HashSet<Integer> leagues = getLeagues(season);
|
||||||
for (Integer league : leagues) {
|
for (Integer league : leagues) {
|
||||||
updateFixtures(league);
|
updateFixtures(league);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAllRounds() {
|
public void updateAllRounds(int season) {
|
||||||
HashSet<Integer> leagues = getLeagues();
|
HashSet<Integer> leagues = getLeagues(season);
|
||||||
for (Integer league : leagues) {
|
for (Integer league : leagues) {
|
||||||
updateRounds(league);
|
updateRounds(league);
|
||||||
}
|
}
|
||||||
@@ -131,8 +131,8 @@ public class APIFootballUpdater {
|
|||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashSet<Integer> getLeagues() {
|
public HashSet<Integer> getLeagues(int season) {
|
||||||
JSONArray leaguesArray = ResourceProvider.getLigenConfig();
|
JSONArray leaguesArray = ResourceProvider.getLigenConfig(season);
|
||||||
HashSet<Integer> leagues = new HashSet<>();
|
HashSet<Integer> leagues = new HashSet<>();
|
||||||
for (Object leagueObject : leaguesArray) {
|
for (Object leagueObject : leaguesArray) {
|
||||||
JSONObject leagueJSONObject = (JSONObject) leagueObject;
|
JSONObject leagueJSONObject = (JSONObject) leagueObject;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class TLWMatchdaysCreator {
|
|||||||
this.season = season;
|
this.season = season;
|
||||||
this.league = league;
|
this.league = league;
|
||||||
|
|
||||||
TLWMatchesCreatorFootball matchesCreator = new TLWMatchesCreatorFootball(2021, 1, configPath);
|
TLWMatchesCreatorFootball matchesCreator = new TLWMatchesCreatorFootball(season, 1, configPath);
|
||||||
this.matches = matchesCreator.getMatches();
|
this.matches = matchesCreator.getMatches();
|
||||||
|
|
||||||
TippligaConfigProvider prov = new TippligaConfigProvider(season);
|
TippligaConfigProvider prov = new TippligaConfigProvider(season);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class TLWMatchesCreatorFootball extends TLWMatchesCreatorBase {
|
|||||||
this.config = prov.getTippligaConfig(configFileName);
|
this.config = prov.getTippligaConfig(configFileName);
|
||||||
|
|
||||||
this.numberOfMatchdays = ((Long) this.config.get("numberOfMatchdays")).intValue();
|
this.numberOfMatchdays = ((Long) this.config.get("numberOfMatchdays")).intValue();
|
||||||
|
this.matchesPerMatchday = ((Long) this.config.get("matchesPerMatchday")).intValue();
|
||||||
this.matchdayConfig = (JSONArray) this.config.get("matchdayConfig");
|
this.matchdayConfig = (JSONArray) this.config.get("matchdayConfig");
|
||||||
this.ko = ((Long) this.config.get("ko")).intValue();
|
this.ko = ((Long) this.config.get("ko")).intValue();
|
||||||
String deliveryDateMode = this.config.containsKey("deliveryDateMode") ? this.config.get("deliveryDateMode").toString() : "";
|
String deliveryDateMode = this.config.containsKey("deliveryDateMode") ? this.config.get("deliveryDateMode").toString() : "";
|
||||||
@@ -46,11 +47,6 @@ public class TLWMatchesCreatorFootball extends TLWMatchesCreatorBase {
|
|||||||
JSONArray matchesConfig = (JSONArray)((JSONObject) this.matchdayConfig.get(i)).get("matchesConfig");
|
JSONArray matchesConfig = (JSONArray)((JSONObject) this.matchdayConfig.get(i)).get("matchesConfig");
|
||||||
ArrayList<APIFootballMatch> apiFootballMatchesForMatchday = getAPIFootballMatchesForMatchday(matchesConfig);
|
ArrayList<APIFootballMatch> apiFootballMatchesForMatchday = getAPIFootballMatchesForMatchday(matchesConfig);
|
||||||
|
|
||||||
int tempNumberOfMatchesBackup = this.matchesPerMatchday;
|
|
||||||
if(((JSONObject) this.matchdayConfig.get(i)).containsKey("numberOfMatches")) {
|
|
||||||
this.matchesPerMatchday = ((Long) ((JSONObject) this.matchdayConfig.get(i)).get("numberOfMatches")).intValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
int matchdayMatchCounter = 0;
|
int matchdayMatchCounter = 0;
|
||||||
|
|
||||||
// Use first matchtime because API Football always returns matches sorted by date
|
// Use first matchtime because API Football always returns matches sorted by date
|
||||||
@@ -74,7 +70,15 @@ public class TLWMatchesCreatorFootball extends TLWMatchesCreatorBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add empty missing matches
|
// Add empty missing matches
|
||||||
for(int j = matchdayMatchCounter; j < this.matchesPerMatchday; j++) {
|
int matchesPerMatchdayTemp = 0;
|
||||||
|
if(this.matchesPerMatchday != 0) {
|
||||||
|
matchesPerMatchdayTemp = this.matchesPerMatchday;
|
||||||
|
} else {
|
||||||
|
if(((JSONObject) this.matchdayConfig.get(i)).containsKey("numberOfMatches")) {
|
||||||
|
matchesPerMatchdayTemp = ((Long) ((JSONObject) this.matchdayConfig.get(i)).get("numberOfMatches")).intValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(int j = matchdayMatchCounter; j < matchesPerMatchdayTemp; j++) {
|
||||||
String matchDatetime = "";
|
String matchDatetime = "";
|
||||||
if(apiFootballMatchesForMatchday.size() > 0) {
|
if(apiFootballMatchesForMatchday.size() > 0) {
|
||||||
matchDatetime = this.TLWMatches.get(this.TLWMatches.size() - 1).getMatchDateTime();
|
matchDatetime = this.TLWMatches.get(this.TLWMatches.size() - 1).getMatchDateTime();
|
||||||
@@ -86,10 +90,6 @@ public class TLWMatchesCreatorFootball extends TLWMatchesCreatorBase {
|
|||||||
this.nextMatchNo++;
|
this.nextMatchNo++;
|
||||||
this.TLWMatches.add(new TLWMatch(this.season, this.league, TLWMatchday, matchNo, matchDatetime, 0, this.ko));
|
this.TLWMatches.add(new TLWMatch(this.season, this.league, TLWMatchday, matchNo, matchDatetime, 0, this.ko));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(((JSONObject) this.matchdayConfig.get(i)).containsKey("numberOfMatches")) {
|
|
||||||
this.matchesPerMatchday = tempNumberOfMatchesBackup;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class TLWTeamsCreator {
|
|||||||
String getGroup(Integer teamId) {
|
String getGroup(Integer teamId) {
|
||||||
for(TLWMatch match: matches) {
|
for(TLWMatch match: matches) {
|
||||||
if(teamId.equals(match.getTeamIdHome()) || teamId.equals(match.getTeamIdGuest())) {
|
if(teamId.equals(match.getTeamIdHome()) || teamId.equals(match.getTeamIdGuest())) {
|
||||||
return match.getGroupId();
|
return match.getGroupId() != null ? match.getGroupId() : "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -8,28 +8,32 @@ import java.util.HashSet;
|
|||||||
public class MatchesListForumUpdater {
|
public class MatchesListForumUpdater {
|
||||||
private HashSet<Integer> leagues;
|
private HashSet<Integer> leagues;
|
||||||
|
|
||||||
public MatchesListForumUpdater() {
|
public MatchesListForumUpdater(int season) {
|
||||||
this.leagues = new APIFootballUpdater().getLeagues();
|
this.leagues = new APIFootballUpdater().getLeagues(season);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateAllLeagues() {
|
public void updateAllLeagues(int season) {
|
||||||
for(Integer league : this.leagues) {
|
for(Integer league : this.leagues) {
|
||||||
updateLeague(league);
|
updateLeague(season, league);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateLeague(int league) {
|
public void updateLeague(int season, int league) {
|
||||||
MatchesListCreator creator = new MatchesListCreator(league);
|
MatchesListCreator creator = new MatchesListCreator(league);
|
||||||
String content = creator.getMatchesBeautiful();
|
String content = creator.getMatchesBeautiful();
|
||||||
String contentWithCodeBBCode = "<r><CODE><s>[code]</s>" + content + "<e>[/code]</e></CODE></r>";
|
String contentWithCodeBBCode = "<r><CODE><s>[code]</s>" + content + "<e>[/code]</e></CODE></r>";
|
||||||
int postId = getPostId(creator.getCountry(), creator.getLeagueName());
|
int postId = getPostId(season, creator.getCountry(), creator.getLeagueName());
|
||||||
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
||||||
con.updatePost(postId, contentWithCodeBBCode);
|
con.updatePost(postId, contentWithCodeBBCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer getPostId(String country, String league) {
|
private Integer getPostId(int season, String country, String league) {
|
||||||
String query = "SELECT post_id FROM phpbb_posts WHERE post_subject = '" + country + " " + league + "';";
|
|
||||||
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
||||||
|
Integer adminForumId = con.getForumId("Admin");
|
||||||
|
Integer tippligaConfigForumId = con.getForumId("Tippliga-Config", adminForumId);
|
||||||
|
Integer seasonForumId = con.getForumId(String.valueOf(season), tippligaConfigForumId);
|
||||||
|
Integer leagueForumId = con.getForumId("Ligen", seasonForumId);
|
||||||
|
String query = "SELECT post_id FROM phpbb_posts WHERE post_subject = '" + country + " " + league + "' AND forum_id = " + leagueForumId + ";";
|
||||||
ResultSet rset = con.executeQuery(query);
|
ResultSet rset = con.executeQuery(query);
|
||||||
Integer postId = null;
|
Integer postId = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
72
src/main/resources/Tippliga/2022_Ligen.json
Normal file
72
src/main/resources/Tippliga/2022_Ligen.json
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"country": "Germany",
|
||||||
|
"name": "Bundesliga 1",
|
||||||
|
"league_id": 3510
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Germany",
|
||||||
|
"name": "Bundesliga 2",
|
||||||
|
"league_id": 3509
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Germany",
|
||||||
|
"name": "Liga 3",
|
||||||
|
"league_id": 3520
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Germany",
|
||||||
|
"name": "Regionalliga - SudWest",
|
||||||
|
"league_id": 3582
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Germany",
|
||||||
|
"name": "Regionalliga - Bayern",
|
||||||
|
"league_id": 3584
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Germany",
|
||||||
|
"name": "DFB Pokal",
|
||||||
|
"league_id": 3532
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Germany",
|
||||||
|
"name": "U19 Bundesliga",
|
||||||
|
"league_id": 3555
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Germany",
|
||||||
|
"name": "Women Bundesliga",
|
||||||
|
"league_id": 3541
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "England",
|
||||||
|
"name": "Premier League",
|
||||||
|
"league_id": 3456
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Spain",
|
||||||
|
"name": "Primera Division",
|
||||||
|
"league_id": 3513
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "Italy",
|
||||||
|
"name": "Serie A",
|
||||||
|
"league_id": 3576
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "France",
|
||||||
|
"name": "Ligue 1",
|
||||||
|
"league_id": 3506
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "World",
|
||||||
|
"name": "UEFA Champions League",
|
||||||
|
"league_id": 3431
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"country": "World",
|
||||||
|
"name": "UEFA Europa Conference League",
|
||||||
|
"league_id": 3490
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -833,5 +833,55 @@
|
|||||||
"teamname": "Nordmazedonien",
|
"teamname": "Nordmazedonien",
|
||||||
"tippligaID": 805,
|
"tippligaID": 805,
|
||||||
"apiFootballID": 1105
|
"apiFootballID": 1105
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "Wuppertaler SV",
|
||||||
|
"tippligaID": 62,
|
||||||
|
"apiFootballID": 9375
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "VfL Oldenburg",
|
||||||
|
"tippligaID": 630,
|
||||||
|
"apiFootballID": 12888
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "TuS RW Koblenz",
|
||||||
|
"tippligaID": 32,
|
||||||
|
"apiFootballID": 1657
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "Greifswalder FC",
|
||||||
|
"tippligaID": 631,
|
||||||
|
"apiFootballID": 16118
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "Bayreuth",
|
||||||
|
"tippligaID": 137,
|
||||||
|
"apiFootballID": 9325
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "Lokomotive Leipzig",
|
||||||
|
"tippligaID": 632,
|
||||||
|
"apiFootballID": 9355
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "Weiche Flensburg",
|
||||||
|
"tippligaID": 121,
|
||||||
|
"apiFootballID": 1649
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "Bremer Sv",
|
||||||
|
"tippligaID": 602,
|
||||||
|
"apiFootballID": 1630
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "FC Saarbrucken",
|
||||||
|
"tippligaID": 44,
|
||||||
|
"apiFootballID": 1639
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"teamname": "Verl",
|
||||||
|
"tippligaID": 52,
|
||||||
|
"apiFootballID": 4265
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ import static org.junit.Assert.assertEquals;
|
|||||||
|
|
||||||
public class TLWMatchdaysCreatorTest {
|
public class TLWMatchdaysCreatorTest {
|
||||||
|
|
||||||
|
int season = 2022;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchdaysTippligaTest() {
|
public void getMatchdaysTippligaTest() {
|
||||||
|
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 1, "Tippliga");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 1, "Tippliga");
|
||||||
ArrayList<TLWMatchday> matchdays = matchdaysCreator.getMatchdays();
|
ArrayList<TLWMatchday> matchdays = matchdaysCreator.getMatchdays();
|
||||||
|
|
||||||
assertEquals((Integer) 1, matchdays.get(0).getMatchday());
|
assertEquals((Integer) 1, matchdays.get(0).getMatchday());
|
||||||
@@ -20,7 +22,7 @@ public class TLWMatchdaysCreatorTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchdaysWTLPokalTest() {
|
public void getMatchdaysWTLPokalTest() {
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 1, "WTL-Pokal");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 1, "WTL-Pokal");
|
||||||
ArrayList<TLWMatchday> matchdays = matchdaysCreator.getMatchdays();
|
ArrayList<TLWMatchday> matchdays = matchdaysCreator.getMatchdays();
|
||||||
|
|
||||||
assertEquals((Integer) 1, matchdays.get(0).getMatchday());
|
assertEquals((Integer) 1, matchdays.get(0).getMatchday());
|
||||||
@@ -29,49 +31,49 @@ public class TLWMatchdaysCreatorTest {
|
|||||||
@Test
|
@Test
|
||||||
public void getMatchdaysTippliga1SqlTest() {
|
public void getMatchdaysTippliga1SqlTest() {
|
||||||
|
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 1, "Tippliga");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 1, "Tippliga");
|
||||||
String sql = matchdaysCreator.getMatchdaysSQL();
|
String sql = matchdaysCreator.getMatchdaysSQL();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchdaysTippliga2SqlTest() {
|
public void getMatchdaysTippliga2SqlTest() {
|
||||||
|
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 2, "Tippliga");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 2, "Tippliga");
|
||||||
String sql = matchdaysCreator.getMatchdaysSQL();
|
String sql = matchdaysCreator.getMatchdaysSQL();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchdaysTippliga51SqlTest() {
|
public void getMatchdaysTippliga51SqlTest() {
|
||||||
|
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 51, "Tippliga");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 51, "Tippliga");
|
||||||
String sql = matchdaysCreator.getMatchdaysSQL();
|
String sql = matchdaysCreator.getMatchdaysSQL();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchdaysTippliga52SqlTest() {
|
public void getMatchdaysTippliga52SqlTest() {
|
||||||
|
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 52, "Tippliga");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 52, "Tippliga");
|
||||||
String sql = matchdaysCreator.getMatchdaysSQL();
|
String sql = matchdaysCreator.getMatchdaysSQL();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchdaysWTLPokal48SqlTest() {
|
public void getMatchdaysWTLPokal48SqlTest() {
|
||||||
|
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 48, "WTL-Pokal");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 48, "WTL-Pokal");
|
||||||
String sql = matchdaysCreator.getMatchdaysSQL();
|
String sql = matchdaysCreator.getMatchdaysSQL();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchdaysWTLPokal98SqlTest() {
|
public void getMatchdaysWTLPokal98SqlTest() {
|
||||||
|
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 98, "WTL-Pokal");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 98, "WTL-Pokal");
|
||||||
String sql = matchdaysCreator.getMatchdaysSQL();
|
String sql = matchdaysCreator.getMatchdaysSQL();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import static org.junit.Assert.assertEquals;
|
|||||||
|
|
||||||
public class TLWMatchesCreatorFootballTest {
|
public class TLWMatchesCreatorFootballTest {
|
||||||
|
|
||||||
|
int season = 2022;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchesTest() {
|
public void getMatchesTest() {
|
||||||
TLWMatchesCreatorFootball creator = new TLWMatchesCreatorFootball(2021, 1, "WTL-Pokal");
|
TLWMatchesCreatorFootball creator = new TLWMatchesCreatorFootball(2021, 1, "WTL-Pokal");
|
||||||
@@ -19,17 +21,24 @@ public class TLWMatchesCreatorFootballTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchesTippligaSqlTest() {
|
public void getMatchesTippliga1SqlTest() {
|
||||||
TLWMatchesCreatorFootball creator = new TLWMatchesCreatorFootball(2021, 2, "Tippliga");
|
TLWMatchesCreatorFootball creator = new TLWMatchesCreatorFootball(season, 1, "Tippliga");
|
||||||
String sql = creator.getSQLInsertString();
|
String sql = creator.getSQLInsertString();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getMatchesTippliga2SqlTest() {
|
||||||
|
TLWMatchesCreatorFootball creator = new TLWMatchesCreatorFootball(season, 2, "Tippliga");
|
||||||
|
String sql = creator.getSQLInsertString();
|
||||||
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchesWTLPokalSqlTest() {
|
public void getMatchesWTLPokalSqlTest() {
|
||||||
TLWMatchesCreatorFootball creator = new TLWMatchesCreatorFootball(2021, 48, "WTL-Pokal");
|
TLWMatchesCreatorFootball creator = new TLWMatchesCreatorFootball(season, 48, "WTL-Pokal");
|
||||||
String sql = creator.getSQLInsertString();
|
String sql = creator.getSQLInsertString();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -2,17 +2,15 @@ package de.jeyp91.tippliga;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
|
|
||||||
public class TLWMatchesCreatorTipperPokalTest {
|
public class TLWMatchesCreatorTipperPokalTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMatchesWTLPokalTest() throws ParseException {
|
public void getMatchesWTLPokalTest() {
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 48, "WTL-Pokal");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2022, 48, "WTL-Pokal");
|
||||||
|
|
||||||
TLWMatchesCreatorTipperPokal creator = new TLWMatchesCreatorTipperPokal(2021, 98, "WTL-Pokal Tipper", matchdaysCreator.getMatchdays());
|
TLWMatchesCreatorTipperPokal creator = new TLWMatchesCreatorTipperPokal(2022, 98, "WTL-Pokal Tipper", matchdaysCreator.getMatchdays());
|
||||||
|
|
||||||
String sql = creator.getSQLInsertString();
|
String sql = creator.getSQLInsertString();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,25 @@ import static org.junit.Assert.assertEquals;
|
|||||||
|
|
||||||
public class TLWMatchesCreatorTipperTest {
|
public class TLWMatchesCreatorTipperTest {
|
||||||
|
|
||||||
@Test
|
int season = 2022;
|
||||||
public void getMatchesTippligaTest() throws ParseException {
|
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 2, "Tippliga");
|
|
||||||
|
|
||||||
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(2021, 52, "2. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
@Test
|
||||||
|
public void getMatchesTippliga1Test() {
|
||||||
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 1, "Tippliga");
|
||||||
|
|
||||||
|
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(season, 51, "1. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
||||||
|
|
||||||
String sql = creator.getSQLInsertString();
|
String sql = creator.getSQLInsertString();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getMatchesTippliga2Test() {
|
||||||
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 2, "Tippliga");
|
||||||
|
|
||||||
|
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(season, 52, "2. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
||||||
|
|
||||||
|
String sql = creator.getSQLInsertString();
|
||||||
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,37 @@ import java.util.ArrayList;
|
|||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
public class TLWTeamsCreatorTest {
|
public class TLWTeamsCreatorTest {
|
||||||
|
|
||||||
|
int season = 2022;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTeamsTippligaFootball1Test() {
|
public void getTeamsTippligaFootball1Test() {
|
||||||
TLWMatchesCreatorFootball matchesCreator = new TLWMatchesCreatorFootball(2021, 1, "Tippliga");
|
TLWMatchesCreatorFootball matchesCreator = new TLWMatchesCreatorFootball(season, 1, "Tippliga");
|
||||||
ArrayList<TLWMatch> matches = matchesCreator.getMatches();
|
ArrayList<TLWMatch> matches = matchesCreator.getMatches();
|
||||||
|
|
||||||
TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 1, matches);
|
TLWTeamsCreator teamCreator = new TLWTeamsCreator(season, 1, matches);
|
||||||
String sql = teamCreator.getSql();
|
String sql = teamCreator.getSql();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getTeamsTippligaFootball2Test() {
|
||||||
|
TLWMatchesCreatorFootball matchesCreator = new TLWMatchesCreatorFootball(season, 2, "Tippliga");
|
||||||
|
ArrayList<TLWMatch> matches = matchesCreator.getMatches();
|
||||||
|
|
||||||
|
TLWTeamsCreator teamCreator = new TLWTeamsCreator(season, 2, matches);
|
||||||
|
String sql = teamCreator.getSql();
|
||||||
|
System.out.println(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getTeamsWTLPokalTest() {
|
||||||
|
TLWMatchesCreatorFootball matchesCreator = new TLWMatchesCreatorFootball(season, 48, "WTL-Pokal");
|
||||||
|
ArrayList<TLWMatch> matches = matchesCreator.getMatches();
|
||||||
|
|
||||||
|
TLWTeamsCreator teamCreator = new TLWTeamsCreator(season, 48, matches);
|
||||||
|
String sql = teamCreator.getSql();
|
||||||
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -30,40 +53,40 @@ public class TLWTeamsCreatorTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTeamsTipper1TLTest() throws ParseException {
|
public void getTeamsTipper1TLTest() throws ParseException {
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 1, "Tippliga");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 1, "Tippliga");
|
||||||
|
|
||||||
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(2021, 51, "1. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(season, 51, "1. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
||||||
|
|
||||||
ArrayList<TLWMatch> matches = creator.getMatches();
|
ArrayList<TLWMatch> matches = creator.getMatches();
|
||||||
|
|
||||||
TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 51, matches);
|
TLWTeamsCreator teamCreator = new TLWTeamsCreator(season, 51, matches);
|
||||||
String sql = teamCreator.getSql();
|
String sql = teamCreator.getSql();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTeamsTipper2TLTest() throws ParseException {
|
public void getTeamsTipper2TLTest() throws ParseException {
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 2, "Tippliga");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 2, "Tippliga");
|
||||||
|
|
||||||
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(2021, 52, "2. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
TLWMatchesCreatorTipperLeague creator = new TLWMatchesCreatorTipperLeague(season, 52, "2. Tippliga Tipper", matchdaysCreator.getMatchdays());
|
||||||
|
|
||||||
ArrayList<TLWMatch> matches = creator.getMatches();
|
ArrayList<TLWMatch> matches = creator.getMatches();
|
||||||
|
|
||||||
TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 52, matches);
|
TLWTeamsCreator teamCreator = new TLWTeamsCreator(season, 52, matches);
|
||||||
String sql = teamCreator.getSql();
|
String sql = teamCreator.getSql();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTeamsTipperWTLTest() throws ParseException {
|
public void getTeamsTipperWTLTest() throws ParseException {
|
||||||
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(2021, 48, "WTL-Pokal");
|
TLWMatchdaysCreator matchdaysCreator = new TLWMatchdaysCreator(season, 48, "WTL-Pokal");
|
||||||
|
|
||||||
TLWMatchesCreatorTipperPokal creator = new TLWMatchesCreatorTipperPokal(2021, 98, "WTL-Pokal Tipper", matchdaysCreator.getMatchdays());
|
TLWMatchesCreatorTipperPokal creator = new TLWMatchesCreatorTipperPokal(season, 98, "WTL-Pokal Tipper", matchdaysCreator.getMatchdays());
|
||||||
|
|
||||||
ArrayList<TLWMatch> matches = creator.getMatches();
|
ArrayList<TLWMatch> matches = creator.getMatches();
|
||||||
|
|
||||||
TLWTeamsCreator teamCreator = new TLWTeamsCreator(2021, 98, matches);
|
TLWTeamsCreator teamCreator = new TLWTeamsCreator(season, 98, matches);
|
||||||
String sql = teamCreator.getSql();
|
String sql = teamCreator.getSql();
|
||||||
// System.out.println(sql);
|
System.out.println(sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,18 @@
|
|||||||
package de.jeyp91.tippligaforum;
|
package de.jeyp91.tippligaforum;
|
||||||
|
|
||||||
import de.jeyp91.tippligaforum.MatchesListForumUpdater;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
|
|
||||||
public class MatchesListForumUpdaterTest {
|
public class MatchesListForumUpdaterTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateAllLeaguesTest() {
|
public void updateAllLeaguesTest() {
|
||||||
MatchesListForumUpdater updater = new MatchesListForumUpdater();
|
MatchesListForumUpdater updater = new MatchesListForumUpdater(2022);
|
||||||
// updater.updateAllLeagues();
|
// updater.updateAllLeagues(2022);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateLeagueTest() {
|
public void updateLeagueTest() {
|
||||||
MatchesListForumUpdater updater = new MatchesListForumUpdater();
|
MatchesListForumUpdater updater = new MatchesListForumUpdater(2022);
|
||||||
updater.updateLeague(2743);
|
updater.updateLeague(2022, 3509);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user