diff options
Diffstat (limited to 'rpm/org.eclipse.linuxtools.rpm.ui.editor.tests/src/org/eclipse/linuxtools/internal/rpm/ui/editor/actions/tests/SpecfileChangelogFormatterTest.java')
-rw-r--r-- | rpm/org.eclipse.linuxtools.rpm.ui.editor.tests/src/org/eclipse/linuxtools/internal/rpm/ui/editor/actions/tests/SpecfileChangelogFormatterTest.java | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/rpm/org.eclipse.linuxtools.rpm.ui.editor.tests/src/org/eclipse/linuxtools/internal/rpm/ui/editor/actions/tests/SpecfileChangelogFormatterTest.java b/rpm/org.eclipse.linuxtools.rpm.ui.editor.tests/src/org/eclipse/linuxtools/internal/rpm/ui/editor/actions/tests/SpecfileChangelogFormatterTest.java index 4599d1cbbe..c4e8599b8d 100644 --- a/rpm/org.eclipse.linuxtools.rpm.ui.editor.tests/src/org/eclipse/linuxtools/internal/rpm/ui/editor/actions/tests/SpecfileChangelogFormatterTest.java +++ b/rpm/org.eclipse.linuxtools.rpm.ui.editor.tests/src/org/eclipse/linuxtools/internal/rpm/ui/editor/actions/tests/SpecfileChangelogFormatterTest.java @@ -1,9 +1,11 @@ /******************************************************************************* - * Copyright (c) 2009 Red Hat, Inc. - * 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 + * Copyright (c) 2009, 2018 Red Hat, Inc. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Red Hat - initial API and implementation @@ -28,42 +30,39 @@ import org.junit.Test; public class SpecfileChangelogFormatterTest extends FileTestCase { - private static final String USER_MAIL = "someone@redhat.com"; - private static final String USER_NAME = "Alexander Kurtakov"; - private SpecfileChangelogFormatter formatter; - private IEditorPart editor; - public final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("EEE MMM d yyyy"); + private static final String USER_MAIL = "someone@redhat.com"; + private static final String USER_NAME = "Alexander Kurtakov"; + private SpecfileChangelogFormatter formatter; + private IEditorPart editor; + public final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("EEE MMM d yyyy"); - @Override - @Before - public void setUp() throws CoreException { - super.setUp(); - newFile("%changelog"); - editor = IDE.openEditor(PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getActivePage(), testFile, - "org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor"); - formatter = new SpecfileChangelogFormatter(); - } + @Override + @Before + public void setUp() throws CoreException { + super.setUp(); + newFile("%changelog"); + editor = IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), testFile, + "org.eclipse.linuxtools.rpm.ui.editor.SpecfileEditor"); + formatter = new SpecfileChangelogFormatter(); + } - @Override - @After - public void tearDown () { - closeEditor(editor); - } + @Override + @After + public void tearDown() { + closeEditor(editor); + } - @Test - public void testFormatDateLine() { - String expectedLine = MessageFormat - .format("* {0} {1} <{2}> {3}{4}-{5}", SIMPLE_DATE_FORMAT.format(new Date()), //$NON-NLS-1$ - USER_NAME, USER_MAIL, "", "0", "0"); - assertEquals(expectedLine, - formatter.formatDateLine(USER_NAME, USER_MAIL)); - } + @Test + public void testFormatDateLine() { + String expectedLine = MessageFormat.format("* {0} {1} <{2}> {3}{4}-{5}", SIMPLE_DATE_FORMAT.format(new Date()), //$NON-NLS-1$ + USER_NAME, USER_MAIL, "", "0", "0"); + assertEquals(expectedLine, formatter.formatDateLine(USER_NAME, USER_MAIL)); + } - @Test - public void testMergeChangelogStringStringStringIEditorPartStringString() { - // TODO find how to test this - formatter.mergeChangelog("proba", "", "", editor, "", ""); - } + @Test + public void testMergeChangelogStringStringStringIEditorPartStringString() { + // TODO find how to test this + formatter.mergeChangelog("proba", "", "", editor, "", ""); + } } |