Skip to content

Commit 96df6ee

Browse files
Merge pull request #245 from phasenraum2010/milestone-1.0.25
Milestone 1.0.25
2 parents a17ac5d + 7d2e591 commit 96df6ee

File tree

132 files changed

+2843
-2721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+2843
-2721
lines changed

pom.xml

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@
6060

6161
<properties>
6262
<java.version>1.8</java.version>
63-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6463
<maven.scm.version>1.9.5</maven.scm.version>
64+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
65+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
66+
<failsafe.skipAfterFailureCount>1</failsafe.skipAfterFailureCount>
67+
<surefire.skipAfterFailureCount>1</surefire.skipAfterFailureCount>
6568
</properties>
6669

6770
<dependencies>
@@ -174,6 +177,11 @@
174177
<artifactId>htmlunit</artifactId>
175178
<scope>test</scope>
176179
</dependency>
180+
<dependency>
181+
<groupId>junit</groupId>
182+
<artifactId>junit</artifactId>
183+
<scope>test</scope>
184+
</dependency>
177185
<!-- end::tests[] -->
178186
</dependencies>
179187

@@ -420,6 +428,14 @@
420428
<build>
421429
<plugins>
422430

431+
<plugin>
432+
<groupId>org.apache.maven.plugins</groupId>
433+
<artifactId>maven-failsafe-plugin</artifactId>
434+
<configuration>
435+
<skipTests>true</skipTests>
436+
</configuration>
437+
</plugin>
438+
423439
<plugin>
424440
<groupId>org.apache.maven.plugins</groupId>
425441
<artifactId>maven-surefire-plugin</artifactId>
@@ -439,14 +455,27 @@
439455

440456
<plugin>
441457
<groupId>org.apache.maven.plugins</groupId>
442-
<artifactId>maven-surefire-plugin</artifactId>
458+
<artifactId>maven-failsafe-plugin</artifactId>
443459
<configuration>
444-
<systemPropertyVariables>
445-
<spring.profiles.active>testing</spring.profiles.active>
446-
</systemPropertyVariables>
460+
<systemPropertyVariables>
461+
<spring.profiles.active>testing</spring.profiles.active>
462+
<failsafe.skipAfterFailureCount>1</failsafe.skipAfterFailureCount>
463+
<surefire.skipAfterFailureCount>1</surefire.skipAfterFailureCount>
464+
</systemPropertyVariables>
447465
</configuration>
448466
</plugin>
449467

468+
<plugin>
469+
<groupId>org.apache.maven.plugins</groupId>
470+
<artifactId>maven-surefire-plugin</artifactId>
471+
<configuration>
472+
<systemPropertyVariables>
473+
<spring.profiles.active>testing</spring.profiles.active>
474+
<failsafe.skipAfterFailureCount>1</failsafe.skipAfterFailureCount>
475+
<surefire.skipAfterFailureCount>1</surefire.skipAfterFailureCount>
476+
</systemPropertyVariables>
477+
</configuration>
478+
</plugin>
450479
</plugins>
451480
</build>
452481
</profile>
@@ -456,12 +485,26 @@
456485
<build>
457486
<plugins>
458487

488+
<plugin>
489+
<groupId>org.apache.maven.plugins</groupId>
490+
<artifactId>maven-failsafe-plugin</artifactId>
491+
<configuration>
492+
<systemPropertyVariables>
493+
<spring.profiles.active>travis</spring.profiles.active>
494+
<failsafe.skipAfterFailureCount>1</failsafe.skipAfterFailureCount>
495+
<surefire.skipAfterFailureCount>1</surefire.skipAfterFailureCount>
496+
</systemPropertyVariables>
497+
</configuration>
498+
</plugin>
499+
459500
<plugin>
460501
<groupId>org.apache.maven.plugins</groupId>
461502
<artifactId>maven-surefire-plugin</artifactId>
462503
<configuration>
463504
<systemPropertyVariables>
464505
<spring.profiles.active>travis</spring.profiles.active>
506+
<failsafe.skipAfterFailureCount>1</failsafe.skipAfterFailureCount>
507+
<surefire.skipAfterFailureCount>1</surefire.skipAfterFailureCount>
465508
</systemPropertyVariables>
466509
</configuration>
467510
</plugin>

src/main/java/org/woehlke/twitterwall/ScheduledTasks.java

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ScheduledTasks {
1818
@Scheduled(initialDelay= TEN_SECONDS, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_TWEETS)
1919
public void fetchTweetsFromTwitterSearch() {
2020
String msg = "fetch Tweets From TwitterSearch ";
21-
if(schedulerProperties.getAllowUpdateTweets() && !schedulerProperties.getSkipFortesting()) {
21+
if((schedulerProperties.getAllowUpdateTweets()) && (!schedulerProperties.getSkipFortesting())) {
2222
Task task = asyncStartTask.fetchTweetsFromSearch();
2323
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
2424
}
@@ -27,43 +27,61 @@ public void fetchTweetsFromTwitterSearch() {
2727
@Scheduled(initialDelay= TEN_SECONDS *2, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_USER_LIST)
2828
public void fetchUsersFromDefinedUserList(){
2929
String msg = "fetch Users from Defined User List ";
30-
if(schedulerProperties.getFetchUserListAllow() && !schedulerProperties.getSkipFortesting()) {
30+
if((schedulerProperties.getFetchUserListAllow()) && (!schedulerProperties.getSkipFortesting())) {
3131
Task task = asyncStartTask.fetchUsersFromList();
3232
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
3333
}
3434
}
3535

36-
@Scheduled(initialDelay= TEN_SECONDS *3, fixedRate = FIXED_RATE_FOR_SCHEDULAR_REMOVE_OLD_DATA_FROM_STORAGE)
36+
@Scheduled(initialDelay= TEN_SECONDS *3, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_FOLLOWER)
37+
public void fetchFollower(){
38+
String msg = "fetch Follower ";
39+
if((schedulerProperties.getFetchFollowerAllow()) && (!schedulerProperties.getSkipFortesting())) {
40+
Task task = asyncStartTask.fetchFollower();
41+
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
42+
}
43+
}
44+
45+
@Scheduled(initialDelay= TEN_SECONDS *4, fixedRate = FIXED_RATE_FOR_SCHEDULAR_FETCH_FRIENDS)
46+
public void fetchFriends(){
47+
String msg = "fetch Friends ";
48+
if((schedulerProperties.getFetchFriendsAllow()) && (!schedulerProperties.getSkipFortesting())) {
49+
Task task = asyncStartTask.fetchFriends();
50+
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
51+
}
52+
}
53+
54+
@Scheduled(initialDelay= TEN_SECONDS *5, fixedRate = FIXED_RATE_FOR_SCHEDULAR_REMOVE_OLD_DATA_FROM_STORAGE)
3755
public void removeOldDataFromStorage(){
3856
String msg = "remove Old Data From Storage: ";
39-
if(schedulerProperties.getRemoveOldDataFromStorageAllow() && !schedulerProperties.getSkipFortesting()) {
57+
if((schedulerProperties.getRemoveOldDataFromStorageAllow()) && (!schedulerProperties.getSkipFortesting())) {
4058
Task task = asyncStartTask.removeOldDataFromStorage();
4159
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
4260
}
4361
}
4462

45-
@Scheduled(initialDelay= TEN_SECONDS *4, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION)
63+
@Scheduled(initialDelay= TEN_SECONDS *6, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION)
4664
public void updateUserProfilesFromMentions(){
4765
String msg = "update User Profiles From Mentions";
48-
if(schedulerProperties.getAllowUpdateUserProfilesFromMention() && !schedulerProperties.getSkipFortesting()) {
66+
if((schedulerProperties.getAllowUpdateUserProfilesFromMention()) && (!schedulerProperties.getSkipFortesting())) {
4967
Task task = asyncStartTask.updateUsersFromMentions();
5068
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
5169
}
5270
}
5371

54-
@Scheduled(initialDelay= TEN_SECONDS *5, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS)
72+
@Scheduled(initialDelay= TEN_SECONDS *7, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS)
5573
public void updateTweets() {
5674
String msg = "update Tweets ";
57-
if(schedulerProperties.getAllowUpdateTweets() && !schedulerProperties.getSkipFortesting()){
75+
if((schedulerProperties.getAllowUpdateTweets()) && (!schedulerProperties.getSkipFortesting())){
5876
Task task = asyncStartTask.updateTweets();
5977
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
6078
}
6179
}
6280

63-
@Scheduled(initialDelay= TEN_SECONDS *6, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER)
81+
@Scheduled(initialDelay= TEN_SECONDS *8, fixedRate = FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER)
6482
public void updateUserProfiles() {
6583
String msg = "update User Profiles ";
66-
if(schedulerProperties.getAllowUpdateUserProfiles() && !schedulerProperties.getSkipFortesting()) {
84+
if((schedulerProperties.getAllowUpdateUserProfiles()) && (!schedulerProperties.getSkipFortesting())) {
6785
Task task = asyncStartTask.updateUsers();
6886
log.info(msg+ "SCHEDULED: task "+task.getUniqueId());
6987
}
@@ -87,6 +105,10 @@ public ScheduledTasks(SchedulerProperties schedulerProperties, AsyncStartTask mq
87105

88106
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER = TWELVE_HOURS;
89107

108+
private final static long FIXED_RATE_FOR_SCHEDULAR_FETCH_FOLLOWER = TWELVE_HOURS;
109+
110+
private final static long FIXED_RATE_FOR_SCHEDULAR_FETCH_FRIENDS = TWELVE_HOURS;
111+
90112
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_TWEETS = TWELVE_HOURS;
91113

92114
private final static long FIXED_RATE_FOR_SCHEDULAR_UPDATE_USER_BY_MENTION = ONE_HOUR;

src/main/java/org/woehlke/twitterwall/conf/properties/SchedulerProperties.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public class SchedulerProperties {
3939
@NotNull
4040
private Boolean removeOldDataFromStorageAllow;
4141

42+
@NotNull
43+
private Boolean fetchFollowerAllow;
44+
45+
@NotNull
46+
private Boolean fetchFriendsAllow;
47+
4248
public Boolean getAllowFetchTweetsFromTwitterSearch() {
4349
return allowFetchTweetsFromTwitterSearch;
4450
}
@@ -110,4 +116,20 @@ public Boolean getRemoveOldDataFromStorageAllow() {
110116
public void setRemoveOldDataFromStorageAllow(Boolean removeOldDataFromStorageAllow) {
111117
this.removeOldDataFromStorageAllow = removeOldDataFromStorageAllow;
112118
}
119+
120+
public void setFetchFollowerAllow(Boolean fetchFollowerAllow) {
121+
this.fetchFollowerAllow = fetchFollowerAllow;
122+
}
123+
124+
public Boolean getFetchFollowerAllow() {
125+
return fetchFollowerAllow;
126+
}
127+
128+
public void setFetchFriendsAllow(Boolean fetchFriendsAllow) {
129+
this.fetchFriendsAllow = fetchFriendsAllow;
130+
}
131+
132+
public Boolean getFetchFriendsAllow() {
133+
return fetchFriendsAllow;
134+
}
113135
}

src/main/java/org/woehlke/twitterwall/frontend/controller/TaskController.java

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public String getTaskById(
7272
}
7373

7474
@RequestMapping("/start/createTestData")
75-
public String getTestData(Model model) {
75+
public String createTTestData(Model model) {
7676
model = controllerHelper.setupPage(
7777
model,"Test Data Tweets",
7878
twitterProperties.getSearchQuery(),
@@ -97,7 +97,7 @@ public String getOnListRenew(
9797
) {
9898
Pageable pageRequest = new PageRequest(page, frontendProperties.getPageSize());
9999
String msg = "getOnListRenew: ";
100-
log.info(msg+"START startTask.fetchUsersFromList: ");
100+
log.info(msg+"START startTask.fetchUsersFromList");
101101
Task task = mqAsyncStartTask.fetchUsersFromList();
102102
model.addAttribute("task",task);
103103
log.info(msg+"DONE startTask.fetchUsersFromList: ");
@@ -114,7 +114,7 @@ public String getOnListRenew(
114114
@RequestMapping(path="/start/tweets/search")
115115
public String fetchTweetsFromTwitterSearchStartTask(Model model) {
116116
String msg = "/start/tweets/search";
117-
String title = "Scheduled Task started";
117+
String title = "Scheduled Task started: fetch Tweets from Search";
118118
String subtitle = "/start/tweets/search";
119119
String symbol = Symbols.TASK.toString();
120120
model = controllerHelper.setupPage(model,title,subtitle,symbol);
@@ -126,7 +126,7 @@ public String fetchTweetsFromTwitterSearchStartTask(Model model) {
126126
@RequestMapping(path="/start/tweets/update")
127127
public String updateTweetsStartTask(Model model) {
128128
String msg = "/start/tweets/fetch";
129-
String title = "Scheduled Task started";
129+
String title = "Scheduled Task started: update Tweets";
130130
String subtitle = "/start/tweets/update";
131131
String symbol = Symbols.TASK.toString();
132132
model = controllerHelper.setupPage(model,title,subtitle,symbol);
@@ -138,7 +138,7 @@ public String updateTweetsStartTask(Model model) {
138138
@RequestMapping(path="/start/users/list/fetch")
139139
public String fetchUsersFromDefinedUserListStartTask(Model model){
140140
String msg = "/start/users/list/fetch";
141-
String title = "Scheduled Task started";
141+
String title = "Scheduled Task started: fetch Users from List";
142142
String subtitle = "/start/users/list/fetch";
143143
String symbol = Symbols.TASK.toString();
144144
model = controllerHelper.setupPage(model,title,subtitle,symbol);
@@ -147,10 +147,34 @@ public String fetchUsersFromDefinedUserListStartTask(Model model){
147147
return PATH+"/start/taskStarted";
148148
}
149149

150+
@RequestMapping(path="/start/users/follower/fetch")
151+
public String fetchFollowerStartTask(Model model){
152+
String msg = "/start/users/follower/fetch";
153+
String title = "Scheduled Task started: fetch Follower";
154+
String subtitle = "/start/users/follower/fetch";
155+
String symbol = Symbols.TASK.toString();
156+
model = controllerHelper.setupPage(model,title,subtitle,symbol);
157+
Task task = mqAsyncStartTask.fetchFollower();
158+
model.addAttribute("task",task);
159+
return PATH+"/start/taskStarted";
160+
}
161+
162+
@RequestMapping(path="/start/users/friends/fetch")
163+
public String fetchFriendsStartTask(Model model){
164+
String msg = "/start/users/friends/fetch";
165+
String title = "Scheduled Task started: fetch Friends";
166+
String subtitle = "/start/users/friends/fetch";
167+
String symbol = Symbols.TASK.toString();
168+
model = controllerHelper.setupPage(model,title,subtitle,symbol);
169+
Task task = mqAsyncStartTask.fetchFriends();
170+
model.addAttribute("task",task);
171+
return PATH+"/start/taskStarted";
172+
}
173+
150174
@RequestMapping(path="/start/users/mentions/update")
151175
public String updateUserProfilesFromMentionsStartTask(Model model){
152176
String msg = "/start/users/mentions/update";
153-
String title = "Scheduled Task started";
177+
String title = "Scheduled Task started: update Users from Mentions";
154178
String subtitle = "/start/users/mentions/update";
155179
String symbol = Symbols.TASK.toString();
156180
model = controllerHelper.setupPage(model,title,subtitle,symbol);
@@ -162,7 +186,7 @@ public String updateUserProfilesFromMentionsStartTask(Model model){
162186
@RequestMapping(path="/start/users/update")
163187
public String updateUserProfilesStartTask(Model model) {
164188
String msg = "/start/users/update";
165-
String title = "Scheduled Task started";
189+
String title = "Scheduled Task started: update Users";
166190
String subtitle = "/start/users/update";
167191
String symbol = Symbols.TASK.toString();
168192
model = controllerHelper.setupPage(model,title,subtitle,symbol);
@@ -189,25 +213,21 @@ public String updateUserProfilesStartTask(Model model) {
189213

190214
private final TwitterProperties twitterProperties;
191215

192-
private final StartTask mqStartTask;
193-
194-
195216
@Autowired
196217
public TaskController(
197218
UserService userService, TaskService taskService,
198219
TaskHistoryService taskHistoryService,
199220
FrontendProperties frontendProperties,
200221
ControllerHelper controllerHelper,
201222
AsyncStartTask mqAsyncStartTask,
202-
TwitterProperties twitterProperties, StartTask mqStartTask) {
223+
TwitterProperties twitterProperties) {
203224
this.userService = userService;
204225
this.taskService = taskService;
205226
this.taskHistoryService = taskHistoryService;
206227
this.frontendProperties = frontendProperties;
207228
this.controllerHelper = controllerHelper;
208229
this.mqAsyncStartTask = mqAsyncStartTask;
209230
this.twitterProperties = twitterProperties;
210-
this.mqStartTask = mqStartTask;
211231
}
212232

213233
}

0 commit comments

Comments
 (0)