<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [2021] add @Test annotations with enable so its easy to turn on and off tests while working on http://jira.rhq-project.org/browse/RHQ-1125</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>2021</dd> <dt>Author</dt> <dd>mazz</dd> <dt>Date</dt> <dd>2008-11-17 16:27:05 -0600 (Mon, 17 Nov 2008)</dd> </dl> <h3>Log Message</h3> <pre>add @Test annotations with enable so its easy to turn on and off tests while working on http://jira.rhq-project.org/browse/RHQ-1125</pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqtrunkmodulesenterpriseserverjarsrctestjavaorgrhqenterpriseserverconfigurationConfigurationManagerBeanTestjava">rhq/trunk/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanTest.java</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunkmodulesenterpriseserverjarsrctestjavaorgrhqenterpriseserverconfigurationConfigurationManagerBeanTestjava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanTest.java (2020 => 2021)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanTest.java 2008-11-17 21:57:25 UTC (rev 2020) +++ rhq/trunk/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBeanTest.java 2008-11-17 22:27:05 UTC (rev 2021) </span><span class="lines">@@ -68,6 +68,8 @@ </span><span class="cx"> */ @Test public class ConfigurationManagerBeanTest extends AbstractEJB3Test { </span><span class="add">+ private static final boolean ENABLE_TESTS = true; + </span><span class="cx"> private ConfigurationManagerLocal configurationManager; private ResourceManagerLocal resourceManager; private Resource newResource1; </span><span class="lines">@@ -193,6 +195,7 @@ </span><span class="cx"> } } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testLastestConfiguration() throws Exception { int resourceId = newResource1.getId(); </span><span class="lines">@@ -245,12 +248,14 @@ </span><span class="cx"> assert myprop.getLongValue() == 7000L; } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testDeleteType() throws Exception { // the purpose of this little test is to test an error condition I'm getting when attempting to delete // a resource type - just forces a run with before/afterMethod return; } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testPluginConfigurationUpdateCallbackSuccess() throws Exception { Resource resource = newResource1; </span><span class="lines">@@ -293,6 +298,7 @@ </span><span class="cx"> assert current.getSimple("bar") == null : current; // this is gone now } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testPluginConfigurationUpdateCallbackFailure() throws Exception { Resource resource = newResource1; </span><span class="lines">@@ -319,19 +325,19 @@ </span><span class="cx"> assert current.getProperties().size() != 0 : current.toString(); } </span><span class="rem">- //@Test </span><span class="add">+ @Test(enabled = false) </span><span class="cx"> public void testAggregatePluginConfigurationUpdateWorkflowSuccess() throws Exception { // TODO (joseph): Fix and then re-enable this test. //testAggregatePluginConfigurationUpdateWorkflowHelper(false); } </span><span class="rem">- //@Test </span><span class="add">+ @Test(enabled = false) </span><span class="cx"> public void testAggregatePluginConfigurationUpdateWorkflowFailure() throws Exception { // TODO (joseph): Fix and then re-enable this test. //testAggregatePluginConfigurationUpdateWorkflowHelper(true); } </span><span class="rem">- //@Test </span><span class="add">+ @Test(enabled = false) </span><span class="cx"> public void testAggregatePluginConfigurationUpdateMergeAlgorithmPerformance() throws Exception { Configuration configuration = new Configuration(); configuration.put(new PropertySimple("foo1", "1")); </span><span class="lines">@@ -511,6 +517,7 @@ </span><span class="cx"> } } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testResourceConfigurationUpdateCallbackFailure() throws Exception { Resource resource = newResource1; </span><span class="lines">@@ -583,6 +590,7 @@ </span><span class="cx"> } } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testResourceConfigurationUpdateCallbackSuccess() throws Exception { Resource resource = newResource1; Subject overlord = LookupUtil.getSubjectManager().getOverlord(); </span><span class="lines">@@ -649,6 +657,7 @@ </span><span class="cx"> assert requests.size() == 1; // it will create one for us from the "live" configuration } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testConfigurationRollback() throws Exception { Resource resource = newResource1; </span><span class="lines">@@ -713,6 +722,7 @@ </span><span class="cx"> assert current.getConfiguration().getId() == newConfigUpdate.getConfiguration().getId(); } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testPurgeConfigurationHistorySame() throws Exception { Resource resource = newResource1; </span><span class="lines">@@ -739,6 +749,7 @@ </span><span class="cx"> assert requests.size() == 1 : "Got " + requests.size() + " config update requests - expected 1."; } </span><span class="add">+ @Test(enabled = true) </span><span class="cx"> public void testPurgeConfigurationHistoryDifferent() throws Exception { Resource resource = newResource1; </span><span class="lines">@@ -751,10 +762,13 @@ </span><span class="cx"> Configuration configuration2 = new Configuration(); configuration2.put(new PropertySimple("myboolean", "false")); </span><span class="rem">- configurationManager.updateResourceConfiguration(overlord, resource.getId(), configuration1); </span><span class="add">+ ResourceConfigurationUpdate up; + up = configurationManager.updateResourceConfiguration(overlord, resource.getId(), configuration1); </span><span class="cx"> Thread.sleep(2000); // wait for the test agent to complete the request </span><span class="rem">- configurationManager.updateResourceConfiguration(overlord, resource.getId(), configuration2); </span><span class="add">+ assert configuration1.equals(configurationManager.getActiveResourceConfiguration(resource.getId())); + up = configurationManager.updateResourceConfiguration(overlord, resource.getId(), configuration2); </span><span class="cx"> Thread.sleep(2000); // wait for the test agent to complete the request </span><span class="add">+ assert configuration2.equals(configurationManager.getActiveResourceConfiguration(resource.getId())); </span><span class="cx"> // at this point in time, the round trip messaging is done and we have the agent response List<ResourceConfigurationUpdate> requests; </span><span class="lines">@@ -778,6 +792,7 @@ </span><span class="cx"> assert requests.get(0).getId() == savedRequest.getId(); } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testPurgeConfigurationHistoryWithFailedUpdateRequest() throws Exception { Resource resource = newResource1; </span><span class="lines">@@ -845,6 +860,7 @@ </span><span class="cx"> assert mybool.getErrorMessage().indexOf("Not a valid boolean") > 0; } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testNoPermissionCallback() throws Exception { Subject superuser = LookupUtil.getSubjectManager().getOverlord(); Subject noPermSubject = new Subject("userWithNoPermissions", true, false); </span><span class="lines">@@ -874,6 +890,7 @@ </span><span class="cx"> } } </span><span class="add">+ @Test(enabled = ENABLE_TESTS) </span><span class="cx"> public void testInvalidUpdateCallback() throws Exception { ConfigurationUpdateResponse response = new ConfigurationUpdateResponse(Integer.MAX_VALUE, new Configuration(), ConfigurationUpdateStatus.SUCCESS, null); </span> </pre> </div> </div> </body> </html> |