Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAK-31796 - Clean up instances of e.printStackTrace in the rest of Sakai #5113

Merged
merged 76 commits into from
Dec 12, 2017
Merged
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4523959
Search - Clean up instances of e.printStackTrace
Dec 5, 2017
6a29191
Sections - Clean up instances of printStackTrace
Dec 5, 2017
a586309
Shortened - Clean up instances of e.printStackTrace
Dec 5, 2017
ece944d
SimpleRSS - Clean up instances of e.printStackTrace
Dec 5, 2017
6aaa55d
Site - Clean up instances of e.printStackTrace
Dec 5, 2017
869a189
sitedescription - Clean up instances of e.printStackTrace
Dec 5, 2017
ecaceae
Taggable - Clean up instances of e.printStackTrace
Dec 5, 2017
520f6c5
Signup - Clean up instances of e.printStackTrace
Dec 5, 2017
980ada3
Sitemanage - Clean up instances of e.printStackTrace
Dec 5, 2017
32cb89b
Access - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7569dbb
Admin-tools - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
18bae86
Announcement - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7290b3d
Archive - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
01d4981
Assignment - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
d10b521
Basiclti - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
0f4f4d3
Calendar - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
221b567
Chat - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
c1f21e5
Sitestats - Clean up instances of e.printStackTrace
Dec 5, 2017
bb1cd32
Citations - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
1804d43
Cloud-content - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
f0ce88e
Cmprovider - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
9e825c3
Common - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
0d98691
Commons - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7a9fbbe
Content - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
1bcc80f
Courier - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
719a23b
Dav - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
a036a03
Delegatedaccess - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7910656
Edu-services - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
130c0aa
Content-review - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
767c672
Citations - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7e3266e
Emailtemplateservice - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
9397592
Endorsed - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
00c1005
Entitybroker - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
fda3674
External-calendaring-service - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
594cd9a
External-calendaring-service - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
2cab54d
Feedback - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
28f618c
Syllabus - Clean up instances of e.printStackTrace
Dec 5, 2017
4e13885
Tags - Clean up instances of e.printStackTrace
Dec 5, 2017
c774917
Gradebook - Clean up instances of printStackTrace
josecebe Dec 5, 2017
610feae
Textarea - Clean up printStackTrace
Dec 5, 2017
9ef9156
Tool - Clean up printStackTrace
Dec 5, 2017
61846a4
Gradebookng - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
00298c9
Help - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
06cc79a
Hierarchy - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
65c9225
Jobsscheduler - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
75e4f95
Jsf - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
a5200e7
User - Clean up instances of printStackTrace
Dec 5, 2017
24329cf
useraudit - Clean up instances of printStack
Dec 5, 2017
4abf798
usermembership - Clean up instances of printStackTrace
Dec 5, 2017
ae2bf0e
Velocity - Clean up instances of printStackTrace
Dec 5, 2017
99d8719
Web - Clean up instances of printStackTrace
Dec 5, 2017
364406f
Webservices - Clean up instances of printStackTrace
Dec 5, 2017
1cb3169
Rwiki - Clean up instances of printStackTrace
Dec 11, 2017
91b863c
rubrics - Clean up instances of printStackTrace
Dec 11, 2017
a18cd74
rsf - Clean up instances of printStackTrace
Dec 11, 2017
bb18392
roster2 - Clean up instances of printStackTrace
Dec 11, 2017
bb54fe8
reset-pass - Clean up instances of printStackTrace
Dec 11, 2017
8165fb2
providers - Clean up instances of printStackTrace
Dec 11, 2017
e6c1a66
Profile2 - Clean up instances of printStackTrace
Dec 11, 2017
914f008
Kernel - Clean up instances of printStackTrace
josecebe Dec 11, 2017
969d6c3
Presence - Clean up instances of printStackTrace
Dec 11, 2017
7ba0a9b
Postem - Clean up instances of printStackTrace
Dec 11, 2017
86344d5
Portal - Clean up instances of printStackTrace
Dec 11, 2017
6c2c842
polls - Clean up instances of printStackTrace
Dec 11, 2017
500b969
Podcasts - Clean up instances of printStackTrace
Dec 11, 2017
57834d5
Pasystem - Clean up instances of printStackTrace
Dec 11, 2017
b6039f4
oauth - Clean up instances of printStackTrace
Dec 11, 2017
40ea310
Lessonbuilder - Clean up instances of printStackTrace
josecebe Dec 11, 2017
993ad10
Login - Clean up instances of printStackTrace
josecebe Dec 11, 2017
8402e5c
Mailarchive - Clean up instances of printStackTrace
josecebe Dec 12, 2017
10f2e65
Mailsender - Clean up instances of printStackTrace
josecebe Dec 12, 2017
98ceee0
Message - Clean up instances of printStackTrace
josecebe Dec 12, 2017
c8de889
MSGCNTR - Clean up instances of printStackTrace
Dec 12, 2017
40e0f7c
Extra cases - Clean up instances of printStackTrace
Dec 12, 2017
8694da6
Extra cases - Clean up instances of System.out.println
Dec 12, 2017
f2b911f
Extra cases - Use Slf4j Annotation
Dec 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
External-calendaring-service - Clean up instances of e.printStackTrace
  • Loading branch information
josecebe authored and Miguel Pellicer committed Dec 12, 2017
commit fda367495041ff62b4463d6b1ba1f25912b09fa1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

import javax.annotation.Resource;

import lombok.extern.slf4j.Slf4j;

import net.fortuna.ical4j.model.Calendar;
import net.fortuna.ical4j.model.component.VEvent;
import net.fortuna.ical4j.model.property.CalScale;
Expand All @@ -54,10 +56,18 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.sakaiproject.calendar.api.CalendarEvent;
import org.sakaiproject.calendar.api.CalendarEventEdit;
import org.sakaiproject.calendaring.api.ExternalCalendaringService;
Expand All @@ -69,11 +79,6 @@
import org.sakaiproject.user.api.UserAlreadyDefinedException;
import org.sakaiproject.user.api.UserIdInvalidException;
import org.sakaiproject.user.api.UserPermissionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand All @@ -87,6 +92,7 @@
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"/test-components.xml"})
@Configuration
@Slf4j
public class ExternalCalendaringServiceTest {

private final String EVENT_NAME = "A new event";
Expand Down Expand Up @@ -159,18 +165,18 @@ public void testGeneratingVEvent() {
//create vevent
net.fortuna.ical4j.model.component.VEvent vevent = service.createEvent(event);

System.out.println("testGeneratingVEvent");
System.out.println("####################");
System.out.println(vevent);
log.debug("testGeneratingVEvent");
log.debug("####################");
log.debug("{}", vevent);

Assert.assertNotNull(vevent);

//Testing timeIsLocal case
vevent = service.createEvent(event, null, true);

System.out.println("testGeneratingVEvent");
System.out.println("####################");
System.out.println(vevent);
log.debug("testGeneratingVEvent");
log.debug("####################");
log.debug("{}", vevent);

Assert.assertNotNull(vevent);

Expand All @@ -193,9 +199,9 @@ public void testGeneratingVEventWithOverridenUuid() {
//create vevent
net.fortuna.ical4j.model.component.VEvent vevent = service.createEvent(event);

System.out.println("testGeneratingVEventWithOverridenUuid");
System.out.println("#####################################");
System.out.println(vevent);
log.debug("testGeneratingVEventWithOverridenUuid");
log.debug("#####################################");
log.debug("{}", vevent);

Assert.assertNotNull(vevent);

Expand All @@ -218,9 +224,9 @@ public void testGeneratingVEventWithAttendees() {
//create vevent
net.fortuna.ical4j.model.component.VEvent vevent = service.createEvent(event, users);

System.out.println("testGeneratingVEventWithAttendees");
System.out.println("#################################");
System.out.println(vevent);
log.debug("testGeneratingVEventWithAttendees");
log.debug("#################################");
log.debug("{}", vevent);

Assert.assertNotNull(vevent);

Expand All @@ -241,14 +247,14 @@ public void testUpdatingVEventWithAttendees() {
//create vevent
net.fortuna.ical4j.model.component.VEvent vevent = service.createEvent(event);

System.out.println("testUpdatingVEventWithAttendees");
System.out.println("#################################");
System.out.println("Before:");
System.out.println(vevent);
log.debug("testUpdatingVEventWithAttendees");
log.debug("#################################");
log.debug("Before:");
log.debug("{}", vevent);

net.fortuna.ical4j.model.component.VEvent veventUpdated = service.addAttendeesToEvent(vevent, users);
System.out.println("After:");
System.out.println(vevent);
log.debug("After:");
log.debug("{}", vevent);

Assert.assertNotNull(vevent);

Expand All @@ -272,9 +278,9 @@ public void testCancellingVEvent() {
//set it to cancelled
VEvent cancelled = service.cancelEvent(vevent);

System.out.println("testCancellingVEvent");
System.out.println("####################");
System.out.println(cancelled);
log.debug("testCancellingVEvent");
log.debug("####################");
log.debug("{}", cancelled);

Assert.assertNotNull(cancelled);

Expand All @@ -297,9 +303,9 @@ public void testCancellingVEventTwice() {
VEvent cancelled = service.cancelEvent(vevent);
VEvent cancelledTwice = service.cancelEvent(vevent);

System.out.println("testCancellingVEventTwice");
System.out.println("####################");
System.out.println(cancelledTwice);
log.debug("testCancellingVEventTwice");
log.debug("####################");
log.debug("{}", cancelledTwice);

Assert.assertNotNull(cancelledTwice);

Expand All @@ -324,9 +330,9 @@ public void testCreatingVEventWithUidProperty() {
//create vevent
net.fortuna.ical4j.model.component.VEvent vevent = service.createEvent(event);

System.out.println("testCreatingVEventWithUidProperty");
System.out.println("####################");
System.out.println(vevent);
log.debug("testCreatingVEventWithUidProperty");
log.debug("####################");
log.debug("{}", vevent);

Assert.assertNotNull(vevent);

Expand All @@ -346,9 +352,9 @@ public void testCreatingVEventWithUrlProperty() {
//create vevent
net.fortuna.ical4j.model.component.VEvent vevent = service.createEvent(event);

System.out.println("testCreatingVEventWithUrlProperty");
System.out.println("####################");
System.out.println(vevent);
log.debug("testCreatingVEventWithUrlProperty");
log.debug("####################");
log.debug("{}", vevent);

Assert.assertNotNull(vevent);

Expand All @@ -368,9 +374,9 @@ public void testCreatingVEventWithSequenceProperty() {
//create vevent
net.fortuna.ical4j.model.component.VEvent vevent = service.createEvent(event);

System.out.println("testCreatingVEventWithSequenceProperty");
System.out.println("####################");
System.out.println(vevent);
log.debug("testCreatingVEventWithSequenceProperty");
log.debug("####################");
log.debug("{}", vevent);

Assert.assertNotNull(vevent);

Expand All @@ -393,9 +399,9 @@ public void testGeneratingCalendar() {
//create calendar from vevent
net.fortuna.ical4j.model.Calendar calendar = service.createCalendar(Collections.singletonList(vevent));

System.out.println("testGeneratingCalendar");
System.out.println("######################");
System.out.println(calendar);
log.debug("testGeneratingCalendar");
log.debug("######################");
log.debug("{}", calendar);

Assert.assertNotNull(calendar);

Expand All @@ -421,9 +427,9 @@ public void testGeneratingCalendarWithMultipleVEvents() {
//create calendar from vevent
net.fortuna.ical4j.model.Calendar calendar = service.createCalendar(vevents);

System.out.println("testGeneratingCalendarWithMultipleVEvents");
System.out.println("#########################################");
System.out.println(calendar);
log.debug("testGeneratingCalendarWithMultipleVEvents");
log.debug("#########################################");
log.debug("{}", calendar);

Assert.assertNotNull(calendar);

Expand All @@ -441,10 +447,10 @@ public void testGeneratingCalendarWithNullList() {
//create calendar with null
net.fortuna.ical4j.model.Calendar calendar = service.createCalendar(null);

System.out.println("testGeneratingCalendarWithNullList");
System.out.println("##################################");
System.out.println(calendar);
System.out.println("This should be null.");
log.debug("testGeneratingCalendarWithNullList");
log.debug("##################################");
log.debug("{}", calendar);
log.debug("This should be null.");

//should be null
Assert.assertNull(calendar);
Expand All @@ -457,10 +463,10 @@ public void testGeneratingCalendarWithEmptyList() {
//create calendar with null
net.fortuna.ical4j.model.Calendar calendar = service.createCalendar(Collections.EMPTY_LIST);

System.out.println("testGeneratingCalendarWithEmptyList");
System.out.println("###################################");
System.out.println(calendar);
System.out.println("This should be null.");
log.debug("testGeneratingCalendarWithEmptyList");
log.debug("###################################");
log.debug("{}", calendar);
log.debug("This should be null.");

//should be null
Assert.assertNull(calendar);
Expand All @@ -482,8 +488,8 @@ public void testCreatingFile() {

String path = service.toFile(calendar);

System.out.println("testCreatingFile");
System.out.println("################");
log.debug("testCreatingFile");
log.debug("################");

Assert.assertNotNull(path);

Expand All @@ -499,10 +505,10 @@ public void testCreatingFileWithNullCalendar() {

String path = service.toFile(null);

System.out.println("testCreatingFileWithNullCalendar");
System.out.println("################################");
System.out.println( path);
System.out.println("This should be null.");
log.debug("testCreatingFileWithNullCalendar");
log.debug("################################");
log.debug( path);
log.debug("This should be null.");

Assert.assertNull(path);

Expand Down