Skip to content

Commit

Permalink
Merge branch 'develop' into feature/refactor_endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
elenagensch committed Jun 18, 2021
2 parents fd05944 + eab2af6 commit 2db13ee
Show file tree
Hide file tree
Showing 59 changed files with 277 additions and 40 deletions.
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## What does this change?

[Bug/Feature]*First, briefly describe what this merge request does.*

*Then, describe the changes in more detail (tests added, summary of )*
*Make sure potential reviewers have enough information to quickly dive in and understand the changes.*
Fixes *#number*

Co-authored-by: *name <name@example.com>*
Co-authored-by: *another-name <another-name@example.com>*


## Decisions / Choices I made

*This text should provide background information on the changes you did (optional). A great merge request answers at least the following question:*
*- Which architectural or implementation decisions did you make? And why?*

*Remember: The more information you give other developers, the easier it is for them
to understand and review the code, and the more helpful their review will ultimately be.*


## Checklist

- [ ] Your branch has no merge conflicts with master
- [ ] All related commits are squashed together
- [ ] Singleton / Database changed*: if changed which Singleton*
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# IMAPClient [![Build Status](https://travis-ci.org/hpi-swa-teaching/IMAPClient.svg?branch=develop)](https://travis-ci.org/hpi-swa-teaching/IMAPClient) [![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/IMAPClient/badge.svg?branch=develop)](https://coveralls.io/github/hpi-swa-teaching/IMAPClient?branch=develop)
# IMAPClient [![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/IMAPClient/badge.svg?branch=develop)](https://coveralls.io/github/hpi-swa-teaching/IMAPClient?branch=develop)

Welcome to our IMAP Client project. We are a team of 4th semester IT-Systems Engineering students and are happy to take over this project for the sixth iteration.
This project is part of a lecture in Softwareengineering techniques and will be contributing to our final grade, so we are giving it our best ;)
This project is part of a lecture in Software Engineering techniques and will be contributing to our final grade, so we are giving it our best ;)
As this is a student project, it will mostly be worked on during the summer terms. Therefore our time with this project is limited to the end of july.

In case of any questions, feel free to contact us.
Expand Down Expand Up @@ -97,7 +97,7 @@ After closing the IMAP-Client and reopening it your are welcomed by a password p
As this project has lived through many iterations, there are a couple of known issues that we could not resolve during the few months we spend with this project.
If you encounter any problem while using our IMAP client, have a look at the Issues of this GitHub Project. Most of them are probably already known to us.
In case your problem has not been reported yet, feel free to post a new issue and describe what you did to get the problem, what the unexpected behaviour was and what behaviour you would have expected.
Thank you in anvance for contributing to making this project better by reporting any problems that we are not yet aware of!
Thank you in advance for contributing to making this project better by reporting any problems that we are not yet aware of!

## Documentation

Expand All @@ -113,3 +113,5 @@ Hava a look at the GitHub Project Wiki to find more insights into the project.
2019: Paul Methfessel, Martin Taraz, Otto Kissig, Tim Garrels, Felix Rindt

2020: Henrik Guhl, Lorenz Woth, Niko Hastrich, Julia Joch

2021: Smilla Fox, Elena Gensch, Jan Groeneveld, Christian Helms, Lukas Rost, Johann Schulze Tast
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
initialize
initialize
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ newWith: anEmail with: aName
^ ICContact new
email: anEmail;
name: aName;
yourself
yourself
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
asString

^ (self name truncateTo: 30), Character tab, self email
^ (self name truncateTo: 40), Character tab, self email
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"newWith:with:" : "EG 5/29/2021 23:20" },
"instance" : {
"asString" : "c.h. 5/25/2021 09:30",
"asString" : "lro 6/3/2021 11:48",
"email" : "EG 5/21/2021 00:03",
"email:" : "EG 5/21/2021 00:03",
"name" : "EG 5/21/2021 00:03",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ senderName

| fromCollection |
fromCollection := self from findBetweenSubStrs: self class senderAddressDelimeters.
^ (fromCollection at: 1 ifAbsent: [ '' ])
^ ((fromCollection at: 1 ifAbsent: [ '' ]) subStrings: '"') at: 1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"seen:" : "C.G. 7/25/2018 13:49",
"sender" : "EG 5/30/2021 12:20",
"senderAddressFromHeader" : "LW 8/2/2020 13:58",
"senderName" : "EG 5/30/2021 12:20",
"senderName" : "lro 6/3/2021 11:47",
"serializeToJson" : "hg 7/29/2020 15:25",
"subject" : "tg 7/19/2019 11:45",
"subject:" : "C.G. 7/25/2018 13:49",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
action - update emails
startUpdateProcess: anUID

(self folderName = 'root') ifTrue: [^self].
(self folderName = 'root') ifTrue: [^true].

anUID
[anUID
ifNil: [self fetchNumberOfLatestEmails: self class numberOfHeadersToFetchAtTheBeginning]
ifNotNil: [self fetchEmailsFrom: anUID]
ifNotNil: [self fetchEmailsFrom: anUID]. ^true]
on: Error
do: [:e | self inform: e asString. ^false]
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
action - update emails
updateAndShowProgressWith: aBlock

|successful|
ProgressNotification
signal: (aBlock value)
extra: (self accountName, ' Mailbox. Folder: ', self folderName).

self startUpdateProcess: self highestUniqueID.
self childFolders do: [:anICFolder | anICFolder updateAndShowProgressWith: aBlock]
successful := self startUpdateProcess: self highestUniqueID.
self childFolders do: [:anICFolder | successful := successful and: (anICFolder updateAndShowProgressWith: aBlock)].
^ successful
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This class tests the ICAddressBookDialog (especially the sorting feature).
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addressBook: anObject
addressBook := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addressBook
^ addressBook
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addressBookDialog: anObject
addressBookDialog := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addressBookDialog
^ addressBookDialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
contactList: anObject
contactList := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
contactList
^ contactList
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
emailAccounts: anObject
emailAccounts := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
emailAccounts
^ emailAccounts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
constants
expectedSortedByMail

^ {'Erika Musterfrau', Character tab, 'erika.musterfrau@rocks.de'.
'Musterfirma GmbH', Character tab, 'info@musterfirma.de'.
'Max Mustermann', Character tab, 'max.mustermann@rocks.de'.}
asOrderedCollection.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
constants
expectedSortedByName

^ {'Erika Musterfrau', Character tab, 'erika.musterfrau@rocks.de'.
'Max Mustermann', Character tab, 'max.mustermann@rocks.de'.
'Musterfirma GmbH', Character tab, 'info@musterfirma.de'.}
asOrderedCollection.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
running
setUp

self contactList:
{(ICContact newWith: 'erika.musterfrau@rocks.de' with: 'Erika Musterfrau') asString.
(ICContact newWith: 'max.mustermann@rocks.de' with: 'Max Mustermann') asString.
(ICContact newWith: 'info@musterfirma.de' with: 'Musterfirma GmbH') asString.}
asOrderedCollection.

self addressBook: ICAddressBook new.
self addressBook removeAll.
self addressBook addAll: contactList.

self addressBookDialog: ICAddressBookDialog basicNew.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
running
tearDown

self addressBook removeAll
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sorting entries
testSortByMail

self addressBookDialog sortByMail.
self assert: self addressBook asOrderedCollection equals: self expectedSortedByMail.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sorting entries
testSortByMailReversed

self addressBookDialog sortByMail.
self addressBookDialog sortByMail.
self assert: self addressBook asOrderedCollection equals: self expectedSortedByMail reversed
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sorting entries
testSortByName

self addressBookDialog sortByName.
self assert: self addressBook asOrderedCollection equals: self expectedSortedByName
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sorting entries
testSortByNameReversed

self addressBookDialog sortByName.
self addressBookDialog sortByName.
self assert: self addressBook asOrderedCollection equals: self expectedSortedByName reversed
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"class" : {
},
"instance" : {
"addressBook" : "lro 6/10/2021 09:58",
"addressBook:" : "lro 6/10/2021 09:58",
"addressBookDialog" : "lro 6/10/2021 09:59",
"addressBookDialog:" : "lro 6/10/2021 09:59",
"contactList" : "lro 6/10/2021 09:59",
"contactList:" : "lro 6/10/2021 09:59",
"emailAccounts" : "lro 6/10/2021 10:09",
"emailAccounts:" : "lro 6/10/2021 10:09",
"expectedSortedByMail" : "lro 6/10/2021 11:08",
"expectedSortedByName" : "lro 6/10/2021 11:08",
"setUp" : "lro 6/10/2021 11:26",
"tearDown" : "lro 6/10/2021 11:25",
"testSortByMail" : "lro 6/10/2021 11:23",
"testSortByMailReversed" : "lro 6/10/2021 11:23",
"testSortByName" : "lro 6/10/2021 11:23",
"testSortByNameReversed" : "lro 6/10/2021 11:23" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"category" : "IMAPClient-Tests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "lro 6/10/2021 09:56",
"instvars" : [
"addressBook",
"addressBookDialog",
"contactList",
"emailAccounts" ],
"name" : "ICAddressBookDialogTest",
"pools" : [
],
"super" : "TestCase",
"type" : "normal" }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ running
setUp
self addressBook: (ICAddressBook new: 10).

self emailContact:
self emailContact:
(ICContact newWith: 'erika.musterfrau@rocks.de' with: 'Erika Musterfrau') asString.

self emailAccounts: ICMockEndpoint new asOrderedCollection
self emailAccounts: ICMockEndpoint new asOrderedCollection
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ testFindEntry

self addressBook addEmail: self emailContact.

self assert: (self addressBook find: self emailContact) equals: self emailContact
self assert: (self addressBook find: self emailContact) equals: self emailContact
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
running
setUp

self contact: (ICContact newWith: 'erika.musterfrau@rocks.de' with: 'Erika Musterfrau')
self contact: (ICContact newWith: 'erika.musterfrau@rocks.de' with: 'Erika Musterfrau')
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test - converting
testAsString

self assert: self contact asString equals: self class expectedStringRepresentation
self assert: self contact asString equals: self class expectedStringRepresentation
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ buildAddressBookPanel: builder
model: self;
frame: (0.0 @ 0.0 extent: 1 @ self buttonOffset);
children: {
self buildButton: (0 @ 0 extent: 1 @ 1) with: self class addContactIcon with: #addContact with: builder.}
self buildButton: (0 @ 0 extent: 0.2 @ 1) with: self class addContactIcon with: #addContact with: builder.
self buildButton: (0.2 @ 0 extent: 0.4 @ 1) with: 'Sort by name' with: #sortByName with: builder.
self buildButton: (0.6 @ 0 extent: 0.4 @ 1) with: 'Sort by mail' with: #sortByMail with: builder.
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ action
initializeMailEmailAddresses

self addressBook feedMeWithEntries: self emailAccounts.
self sortByName.
self changed: #addressBook
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
action
invalidateSorting

self sortMethod: #invalid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
action
reverseContacts

self addressBook reverseInPlace.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
accessing
sortBlocks

^ Dictionary withAll: {
#mail
-> [:aContactString :anotherContactString | ((aContactString splitBy: Character tab asString) at: 2)
caseInsensitiveLessOrEqual: ((anotherContactString splitBy: Character tab asString) at: 2)].
#name
-> [:aContactString :anotherContactString | ((aContactString splitBy: Character tab asString) at: 1)
caseInsensitiveLessOrEqual: ((anotherContactString splitBy: Character tab asString) at: 1)]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
action
sortByMail

self sortContactsBy: #mail
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
action
sortByName

self sortContactsBy: #name
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
action
sortContactsBy: aMethod

self sortMethod = aMethod ifTrue: [self reverseContacts]
ifFalse: [
self sortMethod: aMethod.
self addressBook sort: (self sortBlocks at: aMethod)
].
self changed: #addressBook
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
sortMethod: anObject

sortMethod := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
sortMethod

^ sortMethod
Loading

0 comments on commit 2db13ee

Please sign in to comment.