Author: koen.aers(a)jboss.com
Date: 2011-07-07 04:31:10 -0400 (Thu, 07 Jul 2011)
New Revision: 32689
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeExternalRuntime.java
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeExternalRuntimeTest.java
Log:
add setters for name and location to external forge runtime class
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeExternalRuntime.java
===================================================================
---
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeExternalRuntime.java 2011-07-07
08:24:00 UTC (rev 32688)
+++
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeExternalRuntime.java 2011-07-07
08:31:10 UTC (rev 32689)
@@ -13,12 +13,20 @@
public String getName() {
return name;
}
+
+ public void setName(String name) {
+ this.name = name;
+ }
@Override
public String getLocation() {
return location;
}
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
@Override
public String getType() {
return "external";
Modified:
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeExternalRuntimeTest.java
===================================================================
---
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeExternalRuntimeTest.java 2011-07-07
08:24:00 UTC (rev 32688)
+++
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeExternalRuntimeTest.java 2011-07-07
08:31:10 UTC (rev 32689)
@@ -2,16 +2,31 @@
import static org.junit.Assert.assertEquals;
+import org.junit.Before;
import org.junit.Test;
public class ForgeExternalRuntimeTest {
+
+ private ForgeExternalRuntime runtime;
+
+ @Before
+ public void setUp() {
+ runtime = new ForgeExternalRuntime("foo", "bar");
+ }
@Test
- public void test() {
- ForgeExternalRuntime runtime = new ForgeExternalRuntime("foo",
"bar");
+ public void testGetters() {
assertEquals("foo", runtime.getName());
assertEquals("bar", runtime.getLocation());
assertEquals("external", runtime.getType());
}
+
+ @Test
+ public void testSetters() {
+ runtime.setName("Honolulu");
+ assertEquals("Honolulu", runtime.getName());
+ runtime.setLocation("Hawaii");
+ assertEquals("Hawaii", runtime.getLocation());
+ }
}
Show replies by date