Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 158869 Details for
Bug 301264
Separate out JUnit tests from IAC plug-in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to move IAC Tests
301264.txt (text/plain), 33.56 KB, created by
Joel Cayne
on 2010-02-11 11:27:51 EST
(
hide
)
Description:
Patch to move IAC Tests
Filename:
MIME Type:
Creator:
Joel Cayne
Created:
2010-02-11 11:27:51 EST
Size:
33.56 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.use.cases >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tptp/test-results/platform/org.eclipse.hyades.use.cases/META-INF/MANIFEST.MF,v >retrieving revision 1.6 >diff -u -r1.6 MANIFEST.MF >--- META-INF/MANIFEST.MF 15 Jan 2010 16:42:17 -0000 1.6 >+++ META-INF/MANIFEST.MF 11 Feb 2010 16:26:59 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: Functional TPTP tests. > Bundle-SymbolicName: org.eclipse.hyades.use.cases; singleton:=true >-Bundle-Version: 4.0.0 >+Bundle-Version: 4.0.100 > Bundle-ClassPath: tptp-platform-tests.jar > Bundle-Localization: plugin > Require-Bundle: org.apache.xerces, >@@ -19,7 +19,8 @@ > org.eclipse.hyades.test.ui, > org.eclipse.ui.views, > org.eclipse.ui.views.properties.tabbed, >- org.eclipse.core.resources >+ org.eclipse.core.resources, >+ org.eclipse.tptp.platform.iac.administrator > Bundle-ActivationPolicy: lazy > Export-Package: org.eclipse.hyades.use.cases.auto.common, > org.eclipse.hyades.use.cases.auto.profiling.logging, >Index: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AdminUtilTest.java >=================================================================== >RCS file: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AdminUtilTest.java >diff -N src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AdminUtilTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AdminUtilTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,90 @@ >+/********************************************************************** >+ Copyright (c) 2007, 2010 IBM Corporation 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 >+ $Id: ConfigGenerator.java, >+ >+ Contributors: >+ IBM - initial implementation >+ **********************************************************************/ >+ >+package org.eclipse.hyades.use.cases.junit.iac.administrator.internal.test; >+ >+import java.io.File; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.tptp.platform.iac.administrator.internal.common.AdminUtil; >+ >+/** >+ * Note: Test case moved from platform/org.eclipse.tptp.platform.iac.administrator/ >+ * org.eclipse.tptp.platform.iac.administrator.internal.test as part of bug 302579. >+ * >+ */ >+ >+public class AdminUtilTest extends TestCase { >+ >+ public void testGetIACPlugins() { >+ boolean found; >+ File[] plugins = AdminUtil.getIACPlugins(); >+ assertTrue(plugins.length > 0); >+ >+ >+ String[] expectedPlugins = {"org.apache.commons_logging","org.eclipse.hyades.execution","org.eclipse.hyades.logging.core","org.eclipse.hyades.probekit","org.eclipse.hyades.test.core","org.eclipse.hyades.test.tools.core","org.eclipse.tptp.platform.collection.framework","org.eclipse.tptp.platform.logging.events","org.eclipse.tptp.platform.models","org.eclipse.tptp.platform.models.hierarchy"}; >+ >+ for(int i=0; i < plugins.length; i++) >+ { >+ /* Plugin name with version */ >+ String pluginName = plugins[i].getName(); >+ >+ assertEquals(-1, pluginName.indexOf('\\')); >+ assertEquals(-1, pluginName.indexOf('/')); >+ assertTrue(pluginName.indexOf('_') >= 0); >+ >+ /* Plugin name without version */ >+ pluginName = pluginName.substring(0, pluginName.lastIndexOf('_')); >+ >+ found = false; >+ /* Find the plugin in our list of expected plugins */ >+ for (int k=0; k < expectedPlugins.length; k++) >+ { >+ if(pluginName.equals(expectedPlugins[k])) >+ { >+ found = true; >+ expectedPlugins[k] = ""; >+ break; >+ } >+ } >+ assertTrue("Couldn't find " + pluginName + " in our list of expected plugins", found); >+ } >+ >+ /* Make sure everything in our expected plugins list has been found */ >+ for (int i=0; i < expectedPlugins.length; i++) >+ { >+ assertTrue("Didn't find plugin " + expectedPlugins[i] + " in our list of actual plugins", expectedPlugins[i].equals("")); >+ } >+ } >+ >+ public void testGetIACBinFolder() >+ { >+ assertNotNull(AdminUtil.getIACBinFolder()); >+ } >+ >+ public void testGetIACHome() >+ { >+ assertNotNull(AdminUtil.getIACHome()); >+ } >+ >+ public void testGetPluginsFolder() >+ { >+ assertNotNull(AdminUtil.getPluginsFolder()); >+ } >+ >+ public void testGetJvmtiNativePath() >+ { >+ assertNotNull(AdminUtil.getJvmtiNativePath()); >+ } >+ >+} >Index: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AutoStartStopTest.java >=================================================================== >RCS file: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AutoStartStopTest.java >diff -N src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AutoStartStopTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AutoStartStopTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,79 @@ >+/********************************************************************** >+ Copyright (c) 2007, 2010 IBM Corporation 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 >+ $Id: ConfigGenerator.java, >+ >+ Contributors: >+ IBM - initial implementation >+ **********************************************************************/ >+ >+package org.eclipse.hyades.use.cases.junit.iac.administrator.internal.test; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.tptp.platform.iac.administrator.internal.startstop.AutoStartStop; >+ >+/** >+ * Note: Test case moved from platform/org.eclipse.tptp.platform.iac.administrator/ >+ * org.eclipse.tptp.platform.iac.administrator.internal.test as part of bug 302579. >+ * >+ */ >+ >+public class AutoStartStopTest extends TestCase { >+ >+ /** >+ * Make sure Agent Controller isn't running >+ */ >+ public void setUp() >+ { >+ assertEquals(0, AutoStartStop.stopIAC()); >+ assertFalse(AutoStartStop.isIACRunning()); >+ } >+ >+ /** >+ * Test just start >+ */ >+ public void testStart() >+ { >+ assertEquals(0, AutoStartStop.startIAC()); >+ assertTrue(AutoStartStop.isIACRunning()); >+ } >+ >+ /** >+ * Test both start and stop >+ */ >+ public void testAutoStartStop() >+ { >+ assertEquals(0, AutoStartStop.startIAC()); >+ assertTrue(AutoStartStop.isIACRunning()); >+ assertEquals(0, AutoStartStop.stopIAC()); >+ assertFalse(AutoStartStop.isIACRunning()); >+ } >+ >+ /** >+ * Test restart >+ */ >+ public void testRestart() >+ { >+ assertEquals(0, AutoStartStop.restartIAC()); >+ assertTrue(AutoStartStop.isIACRunning()); >+ } >+ >+ /** >+ * Load test start/stop >+ */ >+ public void testMultipleCalls() >+ { >+ /* Call start/stop multiple times */ >+ for (int i=0; i < 5; i++) >+ { >+ assertEquals(0, AutoStartStop.startIAC()); >+ assertTrue(AutoStartStop.isIACRunning()); >+ assertEquals(0, AutoStartStop.stopIAC()); >+ assertFalse(AutoStartStop.isIACRunning()); >+ } >+ } >+} >Index: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/ConfigGeneratorTest.java >=================================================================== >RCS file: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/ConfigGeneratorTest.java >diff -N src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/ConfigGeneratorTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/ConfigGeneratorTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,171 @@ >+/********************************************************************** >+ Copyright (c) 2007, 2010 IBM Corporation 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 >+ $Id: ConfigGeneratorTest.java,v 1.5 2008/11/13 20:02:14 jkubasta Exp $ >+ >+ Contributors: >+ IBM - initial implementation >+ **********************************************************************/ >+ >+package org.eclipse.hyades.use.cases.junit.iac.administrator.internal.test; >+ >+import java.io.File; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.tptp.platform.iac.administrator.internal.common.AdminUtil; >+import org.eclipse.tptp.platform.iac.administrator.internal.common.CommonConstants; >+import org.eclipse.tptp.platform.iac.administrator.internal.config.ConfigGenerator; >+import org.w3c.dom.Document; >+ >+/** >+ * Note that this has to be run as a JUnit plug-in test >+ * >+ * Note: Test case moved from platform/org.eclipse.tptp.platform.iac.administrator/ >+ * org.eclipse.tptp.platform.iac.administrator.internal.test as part of bug 302579. >+ * >+ * @author Navid Mehregani >+ * >+ */ >+public class ConfigGeneratorTest extends TestCase { >+ >+ /* These values need to change to match location for the machine being tested */ >+ public static String acHome = "C:\\Documents and Settings\\Administrator\\workspace_iac_poc\\org.eclipse.tptp.platform.ac.win_ia32\\agent_controller"; >+ public static String javaExecutable = "C:\\java\\ibm_jdk1.5\\jre\\bin\\java.exe"; >+ public static String pluginsFolder = "D:\\TPTP_Drivers\\TPTP-4.4.0-200702211545\\eclipse\\plugins"; >+ >+ /* Absolute path to the serviceconfig.xml file of Agent Controller */ >+ private String configLocation = acHome + CommonConstants.FILE_SEPARATOR + "config" + CommonConstants.FILE_SEPARATOR + "serviceconfig.xml"; >+ >+ /* All the AC Plugins */ >+ private File[] plugins = null; >+ >+ /* Config file */ >+ private File configFile = new File(configLocation); >+ >+ protected void setUp() throws Exception >+ { >+ /* Delete the config file before starting */ >+ configFile.delete(); >+ >+ /* Get the AC plugins */ >+ plugins = AdminUtil.getIACPlugins(); >+ } >+ >+ public void testAllowAllWithNoSecurity() { >+ ConfigGenerator configGenerator = new ConfigGenerator(); >+ configGenerator.allowAllWithNoSecurity(acHome, javaExecutable, pluginsFolder, plugins); >+ >+ Document document = AdminUtil.parseFile(configLocation, false); >+ >+ /* Check java executable */ >+ assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); >+ >+ /* Check AC home */ >+ assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); >+ >+ /* Check accessibility */ >+ assertEquals("ALL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >+ >+ /* Check security */ >+ assertEquals("false", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); >+ } >+ >+ public void testSetUpLocallyWithNoSecurity() { >+ ConfigGenerator configGenerator = new ConfigGenerator(); >+ configGenerator.setUpLocallyWithNoSecurity(acHome, javaExecutable, pluginsFolder, plugins); >+ >+ Document document = AdminUtil.parseFile(configLocation, false); >+ >+ /* Check java executable */ >+ assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); >+ >+ /* Check AC home */ >+ assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); >+ >+ /* Check accessibility */ >+ assertEquals("LOCAL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >+ >+ /* Check security */ >+ assertEquals("false", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); >+ } >+ >+ public void testCustomAccessWithNoSecurity() { >+ ConfigGenerator configGenerator = new ConfigGenerator(); >+ >+ /* Check with Null passed in for hosts */ >+ configGenerator.customAccessWithNoSecurity(null, acHome, javaExecutable, pluginsFolder, plugins); >+ Document document = AdminUtil.parseFile(configLocation, false); >+ assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); /* Check java executable */ >+ assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); /* Check AC home */ >+ assertEquals("localhost", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >+ assertEquals("false", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >+ >+ /* Check with empty string passed in for hosts */ >+ configGenerator.customAccessWithNoSecurity("", acHome, javaExecutable, pluginsFolder, plugins); >+ document = AdminUtil.parseFile(configLocation, false); >+ assertEquals("localhost", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >+ >+ /* Check with specific machines passed in for hosts */ >+ configGenerator.customAccessWithNoSecurity("host1, host2, host3", acHome, javaExecutable, pluginsFolder, plugins); >+ document = AdminUtil.parseFile(configLocation, false); >+ assertEquals("host1", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >+ assertEquals("host2", AdminUtil.getAttributeOfElement(document, "Allow", "host", 1)); >+ assertEquals("host3", AdminUtil.getAttributeOfElement(document, "Allow", "host", 2)); >+ } >+ >+ public void testAllowAllWithSecurity() { >+ ConfigGenerator configGenerator = new ConfigGenerator(); >+ >+ /* Check with Null passed in for users */ >+ configGenerator.allowAllWithSecurity(null, null, acHome, javaExecutable, pluginsFolder, plugins); >+ Document document = AdminUtil.parseFile(configLocation, false); >+ assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); /* Check java executable */ >+ assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); /* Check AC home */ >+ assertEquals("ALL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >+ assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >+ assertEquals("ANY", AdminUtil.getElementValue(document, "UserDefinition", 0)); >+ >+ /* Check with empty string passed in for users */ >+ configGenerator.allowAllWithSecurity("", "", acHome, javaExecutable, pluginsFolder, plugins); >+ document = AdminUtil.parseFile(configLocation, false); >+ assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >+ assertEquals("ANY", AdminUtil.getElementValue(document, "UserDefinition", 0)); >+ >+ /* Check with specific users passed in for users */ >+ configGenerator.allowAllWithSecurity("CUSTOM", "user1,user2,user3", acHome, javaExecutable, pluginsFolder, plugins); >+ document = AdminUtil.parseFile(configLocation, false); >+ assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >+ assertEquals("user1,user2,user3", AdminUtil.getElementValue(document, "UserDefinition", 0)); >+ } >+ >+ public void testSetUpLocallyWithSecurity() { >+ ConfigGenerator configGenerator = new ConfigGenerator(); >+ configGenerator.setUpLocallyWithSecurity("ANY", "user1, user2, user3", acHome, javaExecutable, pluginsFolder, plugins); >+ >+ Document document = AdminUtil.parseFile(configLocation, false); >+ assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); /* Check java executable */ >+ assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); /* Check AC home */ >+ assertEquals("LOCAL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >+ assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >+ assertEquals("user1,user2,user3", AdminUtil.getElementValue(document, "UserDefinition", 0)); >+ } >+ >+ public void testCustomAccessWithSecurity() { >+ ConfigGenerator configGenerator = new ConfigGenerator(); >+ configGenerator.customAccessWithSecurity("host1, host2, host3","CUSTOM", "user1,user2,user3", acHome, javaExecutable, pluginsFolder, plugins); >+ >+ Document document = AdminUtil.parseFile(configLocation, false); >+ assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); /* Check java executable */ >+ assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); /* Check AC home */ >+ assertEquals("host1", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >+ assertEquals("host2", AdminUtil.getAttributeOfElement(document, "Allow", "host", 1)); /* Check accessibility */ >+ assertEquals("host3", AdminUtil.getAttributeOfElement(document, "Allow", "host", 2)); /* Check accessibility */ >+ assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >+ assertEquals("user1,user2,user3", AdminUtil.getElementValue(document, "UserDefinition", 0)); >+ } >+ >+} >#P org.eclipse.tptp.platform.iac.administrator >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 13 Jan 2010 21:01:29 -0000 1.9 >+++ META-INF/MANIFEST.MF 11 Feb 2010 16:27:01 -0000 >@@ -14,8 +14,7 @@ > org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", > org.eclipse.tptp.platform.agentcontroller;bundle-version="[4.1.0,5.0.0)", >- org.eclipse.jdt.launching;bundle-version="[3.2.0,4.0.0)", >- org.junit;bundle-version="[3.8.2,4.0.0)" >+ org.eclipse.jdt.launching;bundle-version="[3.2.0,4.0.0)" > Eclipse-LazyStart: true > Bundle-ActivationPolicy: lazy > Bundle-RequiredExecutionEnvironment: J2SE-1.4 >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/test/AdminUtilTest.java >=================================================================== >RCS file: src/org/eclipse/tptp/platform/iac/administrator/internal/test/AdminUtilTest.java >diff -N src/org/eclipse/tptp/platform/iac/administrator/internal/test/AdminUtilTest.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/test/AdminUtilTest.java 14 Jan 2010 19:20:53 -0000 1.9 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,84 +0,0 @@ >-/********************************************************************** >- Copyright (c) 2007, 2010 IBM Corporation 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 >- $Id: ConfigGenerator.java, >- >- Contributors: >- IBM - initial implementation >- **********************************************************************/ >- >-package org.eclipse.tptp.platform.iac.administrator.internal.test; >- >-import java.io.File; >- >-import junit.framework.TestCase; >- >-import org.eclipse.tptp.platform.iac.administrator.internal.common.AdminUtil; >- >-public class AdminUtilTest extends TestCase { >- >- public void testGetIACPlugins() { >- boolean found; >- File[] plugins = AdminUtil.getIACPlugins(); >- assertTrue(plugins.length > 0); >- >- >- String[] expectedPlugins = {"org.apache.commons_logging","org.eclipse.hyades.execution","org.eclipse.hyades.logging.core","org.eclipse.hyades.probekit","org.eclipse.hyades.test.core","org.eclipse.hyades.test.tools.core","org.eclipse.tptp.platform.collection.framework","org.eclipse.tptp.platform.logging.events","org.eclipse.tptp.platform.models","org.eclipse.tptp.platform.models.hierarchy"}; >- >- for(int i=0; i < plugins.length; i++) >- { >- /* Plugin name with version */ >- String pluginName = plugins[i].getName(); >- >- assertEquals(-1, pluginName.indexOf('\\')); >- assertEquals(-1, pluginName.indexOf('/')); >- assertTrue(pluginName.indexOf('_') >= 0); >- >- /* Plugin name without version */ >- pluginName = pluginName.substring(0, pluginName.lastIndexOf('_')); >- >- found = false; >- /* Find the plugin in our list of expected plugins */ >- for (int k=0; k < expectedPlugins.length; k++) >- { >- if(pluginName.equals(expectedPlugins[k])) >- { >- found = true; >- expectedPlugins[k] = ""; >- break; >- } >- } >- assertTrue("Couldn't find " + pluginName + " in our list of expected plugins", found); >- } >- >- /* Make sure everything in our expected plugins list has been found */ >- for (int i=0; i < expectedPlugins.length; i++) >- { >- assertTrue("Didn't find plugin " + expectedPlugins[i] + " in our list of actual plugins", expectedPlugins[i].equals("")); >- } >- } >- >- public void testGetIACBinFolder() >- { >- assertNotNull(AdminUtil.getIACBinFolder()); >- } >- >- public void testGetIACHome() >- { >- assertNotNull(AdminUtil.getIACHome()); >- } >- >- public void testGetPluginsFolder() >- { >- assertNotNull(AdminUtil.getPluginsFolder()); >- } >- >- public void testGetJvmtiNativePath() >- { >- assertNotNull(AdminUtil.getJvmtiNativePath()); >- } >- >-} >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/test/AutoStartStopTest.java >=================================================================== >RCS file: src/org/eclipse/tptp/platform/iac/administrator/internal/test/AutoStartStopTest.java >diff -N src/org/eclipse/tptp/platform/iac/administrator/internal/test/AutoStartStopTest.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/test/AutoStartStopTest.java 12 Apr 2007 18:02:54 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,73 +0,0 @@ >-/********************************************************************** >- Copyright (c) 2007 IBM Corporation 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 >- $Id: ConfigGenerator.java, >- >- Contributors: >- IBM - initial implementation >- **********************************************************************/ >- >-package org.eclipse.tptp.platform.iac.administrator.internal.test; >- >-import junit.framework.TestCase; >- >-import org.eclipse.tptp.platform.iac.administrator.internal.startstop.AutoStartStop; >- >-public class AutoStartStopTest extends TestCase { >- >- /** >- * Make sure Agent Controller isn't running >- */ >- public void setUp() >- { >- assertEquals(0, AutoStartStop.stopIAC()); >- assertFalse(AutoStartStop.isIACRunning()); >- } >- >- /** >- * Test just start >- */ >- public void testStart() >- { >- assertEquals(0, AutoStartStop.startIAC()); >- assertTrue(AutoStartStop.isIACRunning()); >- } >- >- /** >- * Test both start and stop >- */ >- public void testAutoStartStop() >- { >- assertEquals(0, AutoStartStop.startIAC()); >- assertTrue(AutoStartStop.isIACRunning()); >- assertEquals(0, AutoStartStop.stopIAC()); >- assertFalse(AutoStartStop.isIACRunning()); >- } >- >- /** >- * Test restart >- */ >- public void testRestart() >- { >- assertEquals(0, AutoStartStop.restartIAC()); >- assertTrue(AutoStartStop.isIACRunning()); >- } >- >- /** >- * Load test start/stop >- */ >- public void testMultipleCalls() >- { >- /* Call start/stop multiple times */ >- for (int i=0; i < 5; i++) >- { >- assertEquals(0, AutoStartStop.startIAC()); >- assertTrue(AutoStartStop.isIACRunning()); >- assertEquals(0, AutoStartStop.stopIAC()); >- assertFalse(AutoStartStop.isIACRunning()); >- } >- } >-} >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/test/ConfigGeneratorTest.java >=================================================================== >RCS file: src/org/eclipse/tptp/platform/iac/administrator/internal/test/ConfigGeneratorTest.java >diff -N src/org/eclipse/tptp/platform/iac/administrator/internal/test/ConfigGeneratorTest.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/test/ConfigGeneratorTest.java 13 Nov 2008 20:02:14 -0000 1.5 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,168 +0,0 @@ >-/********************************************************************** >- Copyright (c) 2007, 2008 IBM Corporation 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 >- $Id: ConfigGeneratorTest.java,v 1.5 2008/11/13 20:02:14 jkubasta Exp $ >- >- Contributors: >- IBM - initial implementation >- **********************************************************************/ >- >-package org.eclipse.tptp.platform.iac.administrator.internal.test; >- >-import java.io.File; >- >-import junit.framework.TestCase; >- >-import org.eclipse.tptp.platform.iac.administrator.internal.common.AdminUtil; >-import org.eclipse.tptp.platform.iac.administrator.internal.common.CommonConstants; >-import org.eclipse.tptp.platform.iac.administrator.internal.config.ConfigGenerator; >-import org.w3c.dom.Document; >- >-/** >- * Note that this has to be run as a JUnit plug-in test >- * >- * @author Navid Mehregani >- * >- */ >-public class ConfigGeneratorTest extends TestCase { >- >- /* These values need to change to match location for the machine being tested */ >- public static String acHome = "C:\\Documents and Settings\\Administrator\\workspace_iac_poc\\org.eclipse.tptp.platform.ac.win_ia32\\agent_controller"; >- public static String javaExecutable = "C:\\java\\ibm_jdk1.5\\jre\\bin\\java.exe"; >- public static String pluginsFolder = "D:\\TPTP_Drivers\\TPTP-4.4.0-200702211545\\eclipse\\plugins"; >- >- /* Absolute path to the serviceconfig.xml file of Agent Controller */ >- private String configLocation = acHome + CommonConstants.FILE_SEPARATOR + "config" + CommonConstants.FILE_SEPARATOR + "serviceconfig.xml"; >- >- /* All the AC Plugins */ >- private File[] plugins = null; >- >- /* Config file */ >- private File configFile = new File(configLocation); >- >- protected void setUp() throws Exception >- { >- /* Delete the config file before starting */ >- configFile.delete(); >- >- /* Get the AC plugins */ >- plugins = AdminUtil.getIACPlugins(); >- } >- >- public void testAllowAllWithNoSecurity() { >- ConfigGenerator configGenerator = new ConfigGenerator(); >- configGenerator.allowAllWithNoSecurity(acHome, javaExecutable, pluginsFolder, plugins); >- >- Document document = AdminUtil.parseFile(configLocation, false); >- >- /* Check java executable */ >- assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); >- >- /* Check AC home */ >- assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); >- >- /* Check accessibility */ >- assertEquals("ALL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >- >- /* Check security */ >- assertEquals("false", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); >- } >- >- public void testSetUpLocallyWithNoSecurity() { >- ConfigGenerator configGenerator = new ConfigGenerator(); >- configGenerator.setUpLocallyWithNoSecurity(acHome, javaExecutable, pluginsFolder, plugins); >- >- Document document = AdminUtil.parseFile(configLocation, false); >- >- /* Check java executable */ >- assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); >- >- /* Check AC home */ >- assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); >- >- /* Check accessibility */ >- assertEquals("LOCAL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >- >- /* Check security */ >- assertEquals("false", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); >- } >- >- public void testCustomAccessWithNoSecurity() { >- ConfigGenerator configGenerator = new ConfigGenerator(); >- >- /* Check with Null passed in for hosts */ >- configGenerator.customAccessWithNoSecurity(null, acHome, javaExecutable, pluginsFolder, plugins); >- Document document = AdminUtil.parseFile(configLocation, false); >- assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); /* Check java executable */ >- assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); /* Check AC home */ >- assertEquals("localhost", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >- assertEquals("false", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- >- /* Check with empty string passed in for hosts */ >- configGenerator.customAccessWithNoSecurity("", acHome, javaExecutable, pluginsFolder, plugins); >- document = AdminUtil.parseFile(configLocation, false); >- assertEquals("localhost", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >- >- /* Check with specific machines passed in for hosts */ >- configGenerator.customAccessWithNoSecurity("host1, host2, host3", acHome, javaExecutable, pluginsFolder, plugins); >- document = AdminUtil.parseFile(configLocation, false); >- assertEquals("host1", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >- assertEquals("host2", AdminUtil.getAttributeOfElement(document, "Allow", "host", 1)); >- assertEquals("host3", AdminUtil.getAttributeOfElement(document, "Allow", "host", 2)); >- } >- >- public void testAllowAllWithSecurity() { >- ConfigGenerator configGenerator = new ConfigGenerator(); >- >- /* Check with Null passed in for users */ >- configGenerator.allowAllWithSecurity(null, null, acHome, javaExecutable, pluginsFolder, plugins); >- Document document = AdminUtil.parseFile(configLocation, false); >- assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); /* Check java executable */ >- assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); /* Check AC home */ >- assertEquals("ALL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >- assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- assertEquals("ANY", AdminUtil.getElementValue(document, "UserDefinition", 0)); >- >- /* Check with empty string passed in for users */ >- configGenerator.allowAllWithSecurity("", "", acHome, javaExecutable, pluginsFolder, plugins); >- document = AdminUtil.parseFile(configLocation, false); >- assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- assertEquals("ANY", AdminUtil.getElementValue(document, "UserDefinition", 0)); >- >- /* Check with specific users passed in for users */ >- configGenerator.allowAllWithSecurity("CUSTOM", "user1,user2,user3", acHome, javaExecutable, pluginsFolder, plugins); >- document = AdminUtil.parseFile(configLocation, false); >- assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- assertEquals("user1,user2,user3", AdminUtil.getElementValue(document, "UserDefinition", 0)); >- } >- >- public void testSetUpLocallyWithSecurity() { >- ConfigGenerator configGenerator = new ConfigGenerator(); >- configGenerator.setUpLocallyWithSecurity("ANY", "user1, user2, user3", acHome, javaExecutable, pluginsFolder, plugins); >- >- Document document = AdminUtil.parseFile(configLocation, false); >- assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); /* Check java executable */ >- assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); /* Check AC home */ >- assertEquals("LOCAL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >- assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- assertEquals("user1,user2,user3", AdminUtil.getElementValue(document, "UserDefinition", 0)); >- } >- >- public void testCustomAccessWithSecurity() { >- ConfigGenerator configGenerator = new ConfigGenerator(); >- configGenerator.customAccessWithSecurity("host1, host2, host3","CUSTOM", "user1,user2,user3", acHome, javaExecutable, pluginsFolder, plugins); >- >- Document document = AdminUtil.parseFile(configLocation, false); >- assertEquals(javaExecutable, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value")); /* Check java executable */ >- assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); /* Check AC home */ >- assertEquals("host1", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >- assertEquals("host2", AdminUtil.getAttributeOfElement(document, "Allow", "host", 1)); /* Check accessibility */ >- assertEquals("host3", AdminUtil.getAttributeOfElement(document, "Allow", "host", 2)); /* Check accessibility */ >- assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- assertEquals("user1,user2,user3", AdminUtil.getElementValue(document, "UserDefinition", 0)); >- } >- >-}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 301264
: 158869 |
158918