Author: rob.stryker(a)jboss.com
Date: 2010-12-16 04:45:27 -0500 (Thu, 16 Dec 2010)
New Revision: 27544
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossServerAPITest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
Log:
JBIDE-7876 - javadoc added, unit test added, fix applied.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2010-12-16
09:41:19 UTC (rev 27543)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2010-12-16
09:45:27 UTC (rev 27544)
@@ -58,9 +58,15 @@
return getServer().getHost();
}
+ /**
+ * The full path of the configuration, ex:
+ * /home/rob/tmp/default_copy3 would return /home/rob/tmp/default_copy3
+ * /home/rob/jboss-5.x.x/server/default would return
/home/rob/jboss-5.x.x/server/default
+ * @return
+ */
public String getConfigDirectory() {
IJBossServerRuntime runtime =
(IJBossServerRuntime)getServer().getRuntime().loadAdapter(IJBossServerRuntime.class,
null);
- return runtime.getConfigLocationFullPath().toOSString();
+ return runtime.getConfigurationFullPath().toOSString();
}
public String getDeployFolder() {
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2010-12-16
09:41:19 UTC (rev 27543)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2010-12-16
09:45:27 UTC (rev 27544)
@@ -35,6 +35,7 @@
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeployBinaryChildModuleTest;
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeploymentTester;
import org.jboss.ide.eclipse.as.test.publishing.v2.SingleFileDeploymentTester;
+import org.jboss.ide.eclipse.as.test.server.JBossServerAPITest;
public class ASTestSuite extends TestSuite {
public static Test suite() {
@@ -51,6 +52,7 @@
suite.addTestSuite(JSTDeploymentTester.class);
suite.addTestSuite(JSTDeployBinaryChildModuleTest.class);
suite.addTestSuite(SingleFileDeploymentTester.class);
+ suite.addTestSuite(JBossServerAPITest.class);
return suite;
}
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossServerAPITest.java
===================================================================
---
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossServerAPITest.java
(rev 0)
+++
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossServerAPITest.java 2010-12-16
09:45:27 UTC (rev 27544)
@@ -0,0 +1,37 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+
+public class JBossServerAPITest extends ServerRuntimeUtils {
+ protected IServer currentServer;
+ public void setUp() {
+ }
+
+ public void tearDown() {
+ try {
+ if( currentServer != null )
+ currentServer.delete();
+ } catch( CoreException ce ) {
+ // report
+ }
+ }
+ public void testJBossServerGetConfigDirectory() {
+ try {
+ currentServer = create42Server();
+ JBossServer jbs = (JBossServer)currentServer.getAdapter(JBossServer.class);
+ IRuntime rt = currentServer.getRuntime();
+ IJBossServerRuntime jbsrt =
(IJBossServerRuntime)rt.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
+ String configName = jbsrt.getJBossConfiguration();
+ assertTrue(jbs.getConfigDirectory().endsWith(configName));
+ } catch( CoreException ce ) {
+ fail("Failed during setUp for " + getName() + ": " +
ce.getMessage());
+ }
+ }
+
+}
Show replies by date