Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91544b3e authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Remove unnecessary getters/setters

* remove getters/setters for protected fields when they're only accessed from package scope
* version bump to 0.8.3
parent bac737a8
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public class ContactTest extends InstrumentationTestCase {
		assertTrue(new String(c.toEntity().toByteArray()).contains("VERSION:3.0"));

		// now let's generate VCard 4.0
		c.setVCardVersion(VCardVersion.V4_0);
		c.vCardVersion = VCardVersion.V4_0;
		assertEquals("text/vcard; version=4.0", c.getContentType().toString());
		assertTrue(new String(c.toEntity().toByteArray()).contains("VERSION:4.0"));
	}
@@ -53,11 +53,11 @@ public class ContactTest extends InstrumentationTestCase {
	public void testReferenceVCard3() throws IOException, InvalidResourceException {
		Contact c = parseVCF("reference-vcard3.vcf", Charset.forName(CharEncoding.UTF_8));

		assertEquals("Gümp", c.getFamilyName());
		assertEquals("Förrest", c.getGivenName());
		assertEquals("Förrest Gümp", c.getDisplayName());
		assertEquals("Bubba Gump Shrimpß Co.", c.getOrganization().getValues().get(0));
		assertEquals("Shrimp Man", c.getJobTitle());
		assertEquals("Gümp", c.familyName);
		assertEquals("Förrest", c.givenName);
		assertEquals("Förrest Gümp", c.displayName);
		assertEquals("Bubba Gump Shrimpß Co.", c.organization.getValues().get(0));
		assertEquals("Shrimp Man", c.jobTitle);
		
		Telephone phone1 = c.getPhoneNumbers().get(0);
		assertEquals("(111) 555-1212", phone1.getText());
@@ -76,21 +76,21 @@ public class ContactTest extends InstrumentationTestCase {

		@Cleanup InputStream photoStream = assetMgr.open("davdroid-logo-192.png", AssetManager.ACCESS_STREAMING);
		byte[] expectedPhoto = IOUtils.toByteArray(photoStream);
		assertTrue(Arrays.equals(c.getPhoto(), expectedPhoto));
		assertTrue(Arrays.equals(c.photo, expectedPhoto));
	}

	public void testParseInvalidUnknownProperties() throws IOException {
		Contact c = parseVCF("invalid-unknown-properties.vcf");
		assertEquals("VCard with invalid unknown properties", c.getDisplayName());
		assertNull(c.getUnknownProperties());
		assertEquals("VCard with invalid unknown properties", c.displayName);
		assertNull(c.unknownProperties);
	}

	public void testParseLatin1() throws IOException {
		Contact c = parseVCF("latin1.vcf", Charset.forName(CharEncoding.ISO_8859_1));
		assertEquals("Özkan Äuçek", c.getDisplayName());
		assertEquals("Özkan", c.getGivenName());
		assertEquals("Äuçek", c.getFamilyName());
		assertNull(c.getUnknownProperties());
		assertEquals("Özkan Äuçek", c.displayName);
		assertEquals("Özkan", c.givenName);
		assertEquals("Äuçek", c.familyName);
		assertNull(c.unknownProperties);
	}
	
	
+3 −3
Original line number Diff line number Diff line
@@ -61,8 +61,8 @@ public class EventTest extends InstrumentationTestCase {

		assertEquals(1, event.getExceptions().size());
		Event exception = event.getExceptions().get(0);
		assertEquals("20150503", exception.getRecurrenceId().getValue());
		assertEquals("Another summary for the third day", exception.getSummary());
		assertEquals("20150503", exception.recurrenceId.getValue());
		assertEquals("Another summary for the third day", exception.summary);
	}
	
	public void testStartEndTimes() throws IOException, ParserException, InvalidResourceException {
@@ -104,7 +104,7 @@ public class EventTest extends InstrumentationTestCase {
	
	public void testUnfolding() throws IOException, InvalidResourceException {
		Event e = parseCalendar("two-line-description-without-crlf.ics");
		assertEquals("http://www.tgbornheim.de/index.php?sessionid=&page=&id=&sportcentergroup=&day=6", e.getDescription());
		assertEquals("http://www.tgbornheim.de/index.php?sessionid=&page=&id=&sportcentergroup=&day=6", e.description);
	}
	
	
+9 −9
Original line number Diff line number Diff line
@@ -150,15 +150,15 @@ public class LocalCalendarTest extends InstrumentationTestCase {
		assertNotNull("Couldn't build and insert event", event);
		// compare with original event
		try {
			assertEquals(event.getSummary(), event2.getSummary());
			assertEquals(event.getDescription(), event2.getDescription());
			assertEquals(event.getLocation(), event2.getLocation());
			assertEquals(event.getDtStart(), event2.getDtStart());
			assertEquals(event.summary, event2.summary);
			assertEquals(event.description, event2.description);
			assertEquals(event.location, event2.location);
			assertEquals(event.dtStart, event2.dtStart);
			assertFalse(event2.isAllDay());

			assertEquals(1, event2.getAlarms().size());
			VAlarm alarm = event2.getAlarms().get(0);
			assertEquals(event.getSummary(), alarm.getDescription().getValue());  // should be built from event name
			assertEquals(event.summary, alarm.getDescription().getValue());  // should be built from event name
			assertEquals(new Dur(0, 0, -(24*60 + 60*2 + 3), 0), alarm.getTrigger().getDuration());   // calendar provider stores trigger in minutes
		} finally {
			testCalendar.delete(event);
@@ -184,10 +184,10 @@ public class LocalCalendarTest extends InstrumentationTestCase {
		assertNotNull("Couldn't build and insert event", event);
		// compare with original event
		try {
			assertEquals(event.getSummary(), event2.getSummary());
			assertEquals(event.getDescription(), event2.getDescription());
			assertEquals(event.getLocation(), event2.getLocation());
			assertEquals(event.getDtStart(), event2.getDtStart());
			assertEquals(event.summary, event2.summary);
			assertEquals(event.description, event2.description);
			assertEquals(event.location, event2.location);
			assertEquals(event.dtStart, event2.dtStart);
			assertTrue(event2.isAllDay());
		} finally {
			testCalendar.delete(event);
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="at.bitfire.davdroid"
    android:versionCode="69" android:versionName="0.8.2"
    android:versionCode="70" android:versionName="0.8.3"
    android:installLocation="internalOnly">

    <uses-sdk
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ import net.fortuna.ical4j.model.property.ProdId;

public class Constants {
	public static final String
		APP_VERSION = "0.8.2",
		APP_VERSION = "0.8.3",
		ACCOUNT_TYPE = "bitfire.at.davdroid",
		WEB_URL_HELP = "https://davdroid.bitfire.at/configuration?pk_campaign=davdroid-app",
		WEB_URL_VIEW_LOGS = "https://github.com/bitfireAT/davdroid/wiki/How-to-view-the-logs";
Loading