Author: mamta
Date: Tue Sep 18 02:09:29 2012
New Revision: 1386967
URL: http://svn.apache.org/viewvc?rev=1386967&view=rev
Log:
DERBY-5663(Getting NPE when trying to set derby.language.logStatementText property to true
inside a junit suite.)
Backporting the code changes to 10.6. The test changed(largedata/LobLimitsTest.java) does
not exist in 10.7 and earlier releases
Modified:
db/derby/code/branches/10.6/ (props changed)
db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java
Propchange: db/derby/code/branches/10.6/
------------------------------------------------------------------------------
Merged /db/derby/code/branches/10.7:r1386854
Merged /db/derby/code/trunk:r1309244
Merged /db/derby/code/branches/10.8:r1386677
Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java?rev=1386967&r1=1386966&r2=1386967&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java
(original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java
Tue Sep 18 02:09:29 2012
@@ -51,7 +51,6 @@ public class SystemPropertyTestSetup ext
{
super(test);
this.newValues = newValues;
- this.oldValues = new Properties();
this.staticProperties = staticProperties;
}
@@ -67,7 +66,6 @@ public class SystemPropertyTestSetup ext
{
super(test);
this.newValues = newValues;
- this.oldValues = new Properties();
this.staticProperties = false;
}
/**
@@ -77,6 +75,15 @@ public class SystemPropertyTestSetup ext
protected void setUp()
throws java.lang.Exception
{
+ //DERBY-5663 Getting NPE when trying to set
+ // derby.language.logStatementText property to true inside a junit
+ // suite.
+ //The same instance of SystemPropertyTestSetup can be used again
+ // and hence we want to make sure that oldValues is not null as set
+ // in the tearDown() method. If we leave it null, we will run into NPE
+ // during the tearDown of SystemPropertyTestSetup during the
+ // decorator's reuse.
+ this.oldValues = new Properties();
setProperties(newValues);
// shutdown engine so static properties take effect
if (staticProperties)
@@ -102,7 +109,6 @@ public class SystemPropertyTestSetup ext
// shutdown engine to restore any static properties
if (staticProperties)
TestConfiguration.getCurrent().shutdownEngine();
- newValues = null;
oldValues = null;
}
|