/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5102289
* @summary Stress test for ResourceBundle.getBundle with ResourceBundle.Control.
*/
// Usage: java StressTest [threadsFactor [duration]]
public class StressTest {
};
"U.S.A.",
"China",
"U.S.A.",
"Japan",
"U.S.A.", // StressOut_en_CA.properties is empty.
"Korea"
};
// increment each element when one getBundle call is done.
static int[] prevCounters;
static int intervalForCounterCheck;
static volatile boolean runrun = true;
int threadsFactor = 2;
}
int duration = 180;
}
}
}
try {
if ((i % intervalForCounterCheck) == 0) {
}
}
runrun = false;
}
} catch (InterruptedException e) {
}
}
static void checkCounters() {
for (int i = 0; i < length; i++) {
}
if (prevCounters == null) {
return;
}
for (int i = 0; i < length; i++) {
if (snapshot[i] > prevCounters[i]) {
continue;
}
"Warning: Thread #%d hasn't updated its counter for the last %d second(s).%n",
}
}
static void printCounters() {
long total = 0;
}
}
final int id;
final int index;
final int max;
final boolean cleaner;
Worker(int i) {
id = i;
", max="+max);
}
public void run() {
while (runrun) {
runrun = false;
}
try {
} catch (InterruptedException e) {
}
//System.out.println("Clearing cache!");
}
}
}
int max;
//System.out.println("Candidate locales=" + list);
return list;
}
}
// This will set TTL to a random value for each bundle.
//System.out.println("TTL: " + baseName + "_" + locale + " for " + ttl);
return ttl;
}
//System.out.println("Expired: " + baseName + "_" + locale + "." + format +
// " at " + (loadTime-startTime) + ", bundle=" + bundle);
return rand.nextBoolean();
}
}
}
}