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 158918 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]
Update to IAC Tests
301264.txt (text/plain), 12.29 KB, created by
Joel Cayne
on 2010-02-11 16:08:13 EST
(
hide
)
Description:
Update to IAC Tests
Filename:
MIME Type:
Creator:
Joel Cayne
Created:
2010-02-11 16:08:13 EST
Size:
12.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.use.cases >Index: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AdminUtilTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/platform/org.eclipse.hyades.use.cases/src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AdminUtilTest.java,v >retrieving revision 1.1 >diff -u -r1.1 AdminUtilTest.java >--- src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AdminUtilTest.java 11 Feb 2010 16:29:05 -0000 1.1 >+++ src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AdminUtilTest.java 11 Feb 2010 21:07:34 -0000 >@@ -13,12 +13,16 @@ > package org.eclipse.hyades.use.cases.junit.iac.administrator.internal.test; > > import java.io.File; >+import java.util.ArrayList; >+import java.util.List; > > import junit.framework.TestCase; > > import org.eclipse.tptp.platform.iac.administrator.internal.common.AdminUtil; > > /** >+ * This test needs 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. > * >@@ -29,10 +33,19 @@ > public void testGetIACPlugins() { > boolean found; > File[] plugins = AdminUtil.getIACPlugins(); >+ List<String> checkedPlugins = new ArrayList<String>(); > 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"}; >+ /* The list of plug-ins with a config.jar */ >+ String[] expectedPlugins = {"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.jvmti.runtime", >+ "org.eclipse.tptp.platform.logging.events", >+ "org.eclipse.tptp.test.tools.junit.plugin"}; > > for(int i=0; i < plugins.length; i++) > { >@@ -46,6 +59,13 @@ > /* Plugin name without version */ > pluginName = pluginName.substring(0, pluginName.lastIndexOf('_')); > >+ /* Ignore checking duplicate entries */ >+ if(checkedPlugins.contains(pluginName)) >+ continue; >+ >+ /* Store the names of checked plug-ins */ >+ checkedPlugins.add(pluginName); >+ > found = false; > /* Find the plugin in our list of expected plugins */ > for (int k=0; k < expectedPlugins.length; k++) >Index: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AutoStartStopTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/platform/org.eclipse.hyades.use.cases/src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AutoStartStopTest.java,v >retrieving revision 1.1 >diff -u -r1.1 AutoStartStopTest.java >--- src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AutoStartStopTest.java 11 Feb 2010 16:29:04 -0000 1.1 >+++ src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/AutoStartStopTest.java 11 Feb 2010 21:07:34 -0000 >@@ -17,6 +17,8 @@ > import org.eclipse.tptp.platform.iac.administrator.internal.startstop.AutoStartStop; > > /** >+ * This test needs 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. > * >Index: src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/ConfigGeneratorTest.java >=================================================================== >RCS file: /cvsroot/tptp/test-results/platform/org.eclipse.hyades.use.cases/src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/ConfigGeneratorTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ConfigGeneratorTest.java >--- src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/ConfigGeneratorTest.java 11 Feb 2010 16:29:03 -0000 1.1 >+++ src/org/eclipse/hyades/use/cases/junit/iac/administrator/internal/test/ConfigGeneratorTest.java 11 Feb 2010 21:07:34 -0000 >@@ -68,7 +68,7 @@ > assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); > > /* Check accessibility */ >- assertEquals("ALL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >+ assertEquals("ALL", AdminUtil.getAttributeOfElement(document, "Allow", "type", 0)); > > /* Check security */ > assertEquals("false", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); >@@ -87,7 +87,7 @@ > assertEquals(acHome, AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "RASERVER_HOME", "value")); > > /* Check accessibility */ >- assertEquals("LOCAL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); >+ assertEquals("LOCAL", AdminUtil.getAttributeOfElement(document, "Allow", "type", 0)); > > /* Check security */ > assertEquals("false", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); >@@ -101,20 +101,21 @@ > 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("CUSTOM", AdminUtil.getAttributeOfElement(document, "Allow", "type", 0)); /* Check accessibility */ >+ assertEquals("localhost", AdminUtil.getAttributeOfElement(document, "Allow", "list", 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)); >+ assertEquals("CUSTOM", AdminUtil.getAttributeOfElement(document, "Allow", "type", 0)); >+ assertEquals("localhost", AdminUtil.getAttributeOfElement(document, "Allow", "list", 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)); >+ assertEquals("CUSTOM", AdminUtil.getAttributeOfElement(document, "Allow", "type", 0)); >+ assertEquals("host1, host2, host3", AdminUtil.getAttributeOfElement(document, "Allow", "list", 0)); > } > > public void testAllowAllWithSecurity() { >@@ -125,33 +126,35 @@ > 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("ALL", AdminUtil.getAttributeOfElement(document, "Allow", "type", 0)); /* Check accessibility */ > assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- assertEquals("ANY", AdminUtil.getElementValue(document, "UserDefinition", 0)); >+ assertEquals("ANY", AdminUtil.getAttributeOfElement(document, "UserDefinition", "type", 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)); >+ assertEquals("ANY", AdminUtil.getAttributeOfElement(document, "UserDefinition", "type", 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)); >+ assertEquals("CUSTOM", AdminUtil.getAttributeOfElement(document, "UserDefinition", "type", 0)); >+ assertEquals("user1,user2,user3", AdminUtil.getAttributeOfElement(document, "UserDefinition", "list", 0)); > } > > public void testSetUpLocallyWithSecurity() { > ConfigGenerator configGenerator = new ConfigGenerator(); >- configGenerator.setUpLocallyWithSecurity("ANY", "user1, user2, user3", acHome, javaExecutable, pluginsFolder, plugins); >+ configGenerator.setUpLocallyWithSecurity("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("LOCAL", AdminUtil.getAttributeOfElement(document, "Allow", "host", 0)); /* Check accessibility */ >+ assertEquals("LOCAL", AdminUtil.getAttributeOfElement(document, "Allow", "type", 0)); /* Check accessibility */ > assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- assertEquals("user1,user2,user3", AdminUtil.getElementValue(document, "UserDefinition", 0)); >+ assertEquals("CUSTOM", AdminUtil.getAttributeOfElement(document, "UserDefinition", "type", 0)); >+ assertEquals("user1,user2,user3", AdminUtil.getAttributeOfElement(document, "UserDefinition", "list", 0)); > } > > public void testCustomAccessWithSecurity() { >@@ -161,11 +164,11 @@ > 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("CUSTOM", AdminUtil.getAttributeOfElement(document, "Allow", "type", 0)); /* Check accessibility */ >+ assertEquals("host1, host2, host3", AdminUtil.getAttributeOfElement(document, "Allow", "list", 0)); /* Check accessibility */ > assertEquals("true", AdminUtil.getElementValue(document, "SecurityEnabled", 0)); /* Check security */ >- assertEquals("user1,user2,user3", AdminUtil.getElementValue(document, "UserDefinition", 0)); >+ assertEquals("CUSTOM", AdminUtil.getAttributeOfElement(document, "UserDefinition", "type", 0)); >+ assertEquals("user1,user2,user3", AdminUtil.getAttributeOfElement(document, "UserDefinition", "list", 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