[jboss-cvs] JBossAS SVN: r97588 - in branches/JBPAPP_5_0_JBPAPP-3235: testsuite/src/main/org/jboss/test/profileservice/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 8 23:31:10 EST 2009
Author: jiwils
Date: 2009-12-08 23:31:10 -0500 (Tue, 08 Dec 2009)
New Revision: 97588
Added:
branches/JBPAPP_5_0_JBPAPP-3235/testsuite/src/main/org/jboss/test/profileservice/test/HDScannerTestCase.java
Modified:
branches/JBPAPP_5_0_JBPAPP-3235/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java
Log:
Fix for JBPAPP-3235. Setting HDScanner's scanEnabled attribute to true via XML results in a NPE.
Modified: branches/JBPAPP_5_0_JBPAPP-3235/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java
===================================================================
--- branches/JBPAPP_5_0_JBPAPP-3235/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java 2009-12-09 04:14:40 UTC (rev 97587)
+++ branches/JBPAPP_5_0_JBPAPP-3235/system/src/main/org/jboss/system/server/profileservice/hotdeploy/HDScanner.java 2009-12-09 04:31:10 UTC (rev 97588)
@@ -52,7 +52,7 @@
* @author adrian at jboss.org
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- *
+ *
* @version $Revision$
* @see MainDeployer
* @see ProfileService
@@ -184,7 +184,7 @@
*/
public synchronized void setScanEnabled(boolean scanEnabled)
{
- if (scanEnabled == true && activeScan == null)
+ if (scanEnabled == true && activeScan == null && scanExecutor != null)
{
start();
}
@@ -369,7 +369,7 @@
if (modified)
{
deployer.process();
-
+
// Only check the modified deployments to avoid duplicate errors
for(String name : modifiedDeploymentNames)
{
Copied: branches/JBPAPP_5_0_JBPAPP-3235/testsuite/src/main/org/jboss/test/profileservice/test/HDScannerTestCase.java (from rev 97583, branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/profileservice/test/HDScannerTestCase.java)
===================================================================
--- branches/JBPAPP_5_0_JBPAPP-3235/testsuite/src/main/org/jboss/test/profileservice/test/HDScannerTestCase.java (rev 0)
+++ branches/JBPAPP_5_0_JBPAPP-3235/testsuite/src/main/org/jboss/test/profileservice/test/HDScannerTestCase.java 2009-12-09 04:31:10 UTC (rev 97588)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.profileservice.test;
+
+import org.jboss.system.server.profileservice.hotdeploy.HDScanner;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * HDScanner test cases.
+ *
+ * @author <a href="mailto:jawilson at redhat.com">Jimmy Wilson</a>
+ */
+public class HDScannerTestCase extends JBossTestCase
+{
+ public HDScannerTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Test for JBAS-7528.
+ *
+ * Setting the scanEnabled attribute to true via XML led to
+ * NullPointerExceptions in previous releases.
+ */
+ public void testSettingScanEnabled()
+ {
+ HDScanner hdScanner = new HDScanner();
+
+ // Calling the setter *before* create/start have been called just like
+ // when set via XML.
+ hdScanner.setScanEnabled(true);
+ }
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list