aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCheng Chen2012-05-17 23:31:42 (EDT)
committerCheng Chen2012-05-17 23:31:42 (EDT)
commitf2f4aa5e27d4f7ca4e1f4e8bfb697f3b7c49f31f (patch)
tree11d0175c1ad25f6a61785ddf05ea4f2732f88373
parentb66c03318f7b1bbda6345b84e2c4ec3e99f622ea (diff)
downloadorg.eclipse.recommenders-f2f4aa5e27d4f7ca4e1f4e8bfb697f3b7c49f31f.zip
org.eclipse.recommenders-f2f4aa5e27d4f7ca4e1f4e8bfb697f3b7c49f31f.tar.gz
org.eclipse.recommenders-f2f4aa5e27d4f7ca4e1f4e8bfb697f3b7c49f31f.tar.bz2
[snipmatch] add unit test case for EffectParameter classrefs/changes/22/6022/1
Change-Id: I559352b0b898da760be7d5e5775fadd8f9b43294 Signed-off-by: Cheng Chen <chengchendoc@gmail.com>
-rw-r--r--tests/org.eclipse.recommenders.tests.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/core/EffectParameterTest.java173
1 files changed, 173 insertions, 0 deletions
diff --git a/tests/org.eclipse.recommenders.tests.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/core/EffectParameterTest.java b/tests/org.eclipse.recommenders.tests.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/core/EffectParameterTest.java
new file mode 100644
index 0000000..31488be
--- /dev/null
+++ b/tests/org.eclipse.recommenders.tests.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/core/EffectParameterTest.java
@@ -0,0 +1,173 @@
+/**
+ * Copyright (c) 2011, University of Science and Technology Beijing
+ * 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:
+ * Cheng Chen - initial API and implementation.
+ */
+package org.eclipse.recommenders.snipmatch.core;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * The class <code>EffectParameterTest</code> contains tests for the class <code>{@link EffectParameter}</code>.
+ *
+ * @author Cheng Chen
+ */
+public class EffectParameterTest {
+
+ /**
+ * Run the boolean equals(Object) method test.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testEquals_1() throws Exception {
+ EffectParameter fixture = new EffectParameter();
+ fixture.setMinorType("minor");
+ fixture.setMajorType("major");
+ fixture.setName("name");
+ EffectParameter other = new EffectParameter();
+ other.setMinorType("minor");
+ other.setMajorType("major");
+ other.setName("");
+
+ boolean result = fixture.equals(other);
+
+ assertEquals(false, result);
+ }
+
+ /**
+ * Run the boolean equals(Object) method test.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testEquals_2() throws Exception {
+ EffectParameter fixture = new EffectParameter();
+ fixture.setMinorType("minor");
+ fixture.setMajorType("major");
+ fixture.setName("name");
+ EffectParameter other = new EffectParameter();
+ other.setName("name");
+
+ boolean result = fixture.equals(other);
+
+ assertEquals(false, result);
+ }
+
+ /**
+ * Run the boolean equals(Object) method test.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testEquals_3() throws Exception {
+ EffectParameter fixture = new EffectParameter();
+ fixture.setMinorType("minor");
+ fixture.setMajorType("major");
+ fixture.setName("name");
+ EffectParameter other = new EffectParameter();
+ other.setMajorType("major");
+ other.setName("name");
+
+ boolean result = fixture.equals(other);
+
+ assertEquals(false, result);
+ }
+
+ /**
+ * Run the boolean equals(Object) method test.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testEquals_4() throws Exception {
+ EffectParameter fixture = new EffectParameter();
+ fixture.setMinorType("minor");
+ fixture.setMajorType("major");
+ fixture.setName("name");
+ EffectParameter other = new EffectParameter();
+ other.setMinorType("minor");
+ other.setMajorType("major");
+ other.setName("name");
+
+ boolean result = fixture.equals(other);
+
+ assertEquals(true, result);
+ }
+
+ /**
+ * Run the String getFullType() method test.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testGetFullType_1() throws Exception {
+ EffectParameter fixture = new EffectParameter();
+ fixture.setMinorType("min");
+ fixture.setMajorType("maj");
+ fixture.setName("name");
+
+ String result = fixture.getFullType();
+
+ assertEquals("maj:min", result);
+ }
+
+ /**
+ * Run the String getFullType() method test.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testGetFullType_2() throws Exception {
+ EffectParameter fixture = new EffectParameter();
+ fixture.setMinorType("");
+ fixture.setMajorType("maj");
+ fixture.setName("name");
+
+ String result = fixture.getFullType();
+
+ assertEquals("maj", result);
+ }
+
+ /**
+ * Perform pre-test initialization.
+ *
+ * @throws Exception
+ * if the initialization fails for some reason
+ *
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ /**
+ * Perform post-test clean-up.
+ *
+ * @throws Exception
+ * if the clean-up fails for some reason
+ *
+ */
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ /**
+ * Launch the test.
+ *
+ * @param args
+ * the command line arguments
+ *
+ */
+ public static void main(String[] args) {
+ new org.junit.runner.JUnitCore().run(EffectParameterTest.class);
+ }
+} \ No newline at end of file