Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Green2013-10-25 21:53:23 -0400
committerDavid Green2013-10-25 21:53:23 -0400
commit77caae4506b7f806d7f740e759ddcd269393588d (patch)
treeca9a4d20f0850062267abe13e9cf2dcc1063f8e3 /org.eclipse.mylyn.tasks.core.tests
parentb7836ef3608f5e511420b0cb0e0958cc29cc6a6b (diff)
downloadorg.eclipse.mylyn.tasks-77caae4506b7f806d7f740e759ddcd269393588d.tar.gz
org.eclipse.mylyn.tasks-77caae4506b7f806d7f740e759ddcd269393588d.tar.xz
org.eclipse.mylyn.tasks-77caae4506b7f806d7f740e759ddcd269393588d.zip
Revert "413584: provide API for encoding/decoding task id"
Diffstat (limited to 'org.eclipse.mylyn.tasks.core.tests')
-rw-r--r--org.eclipse.mylyn.tasks.core.tests/src/org/eclipse/mylyn/tasks/core/spi/TaskIdEncoderTest.java90
1 files changed, 0 insertions, 90 deletions
diff --git a/org.eclipse.mylyn.tasks.core.tests/src/org/eclipse/mylyn/tasks/core/spi/TaskIdEncoderTest.java b/org.eclipse.mylyn.tasks.core.tests/src/org/eclipse/mylyn/tasks/core/spi/TaskIdEncoderTest.java
deleted file mode 100644
index 5ebbecf91..000000000
--- a/org.eclipse.mylyn.tasks.core.tests/src/org/eclipse/mylyn/tasks/core/spi/TaskIdEncoderTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.tasks.core.spi;
-
-import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.UUID;
-
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.mylyn.internal.tasks.core.RepositoryTaskHandleUtil;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-public class TaskIdEncoderTest {
- @Rule
- public final ExpectedException thrown = ExpectedException.none();
-
- @Test
- public void testEncodeNull() {
- thrown.expect(AssertionFailedException.class);
- TaskIdEncoder.encode(null);
- }
-
- @Test
- public void testDecodeNull() {
- thrown.expect(AssertionFailedException.class);
- TaskIdEncoder.decode(null);
- }
-
- @Test
- public void testEncodeSimple() {
- assertEquals("1234 abc", TaskIdEncoder.encode("1234 abc"));
- }
-
- @Test
- public void testEncodeComplex() {
- assertEquals("1234%25%2Dabc @$", TaskIdEncoder.encode("1234%-abc @$"));
- }
-
- @Test
- public void testDecodeSimple() {
- assertEquals("1234 abc", TaskIdEncoder.decode("1234 abc"));
- }
-
- @Test
- public void testDecodeComplex() {
- assertEquals("1234%-abc @$", TaskIdEncoder.decode("1234%25%2Dabc @$"));
- }
-
- @Test
- public void testUuidRoundTrip() {
- assertRoundTrip(UUID.randomUUID().toString());
- }
-
- @Test
- public void testHyphenatedRoundTrip() {
- assertRoundTrip("TEST-1234");
- }
-
- @Test
- public void testJsonRoundTrip() {
- assertRoundTrip("{\"one\":true,\"two\":\"three\"}");
- }
-
- @Test
- public void testJsonReadable() {
- String json = "{\"one\":true,\"two\":\"three\"}";
- assertEquals(json, TaskIdEncoder.encode(json));
- }
-
- private void assertRoundTrip(String original) {
- String encoded = TaskIdEncoder.encode(original);
-
- String handle = RepositoryTaskHandleUtil.getHandle("https://example.com", encoded);
-
- assertTrue(handle.endsWith(encoded));
- assertEquals(original, TaskIdEncoder.decode(encoded));
- }
-}

Back to the top