/*
* 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.
*/
/*
*
*/
/*
* This class is used by ExpirationTest.sh. See the timing information in
* the shell script.
*/
public class ExpirationTest {
// If -latency is specified, try sleeping for 3 seconds 3
// times to see its latency. If the latency is too large, then
// the program exits with 2. (See sleep())
for (int i = 0; i < 3; i++) {
sleep(3);
}
}
try {
control);
// Wait until the instance gets expired in the cache in 7 seconds.
sleep(7);
// At this point, it should be determined that reloading is not needed.
// Wait until the instance in the cache gets expired again and
// ExpirationData_de gets updated.
// 33 = 40 - 7 (See the timing chart in ExpirationTest.sh)
sleep(33);
// At this point, getBundle must reload the updated
// ExpirationData_de and ExpirationData_de_AT must be
// avaible.
try {
} catch (RuntimeException e) {
// Class loader doesn't load updated classes.
}
}
try {
} catch (RuntimeException e) {
// Jar doesn't load new entries.
} else {
throw e;
}
}
} finally {
}
}
+ time);
}
}
try {
} catch (InterruptedException e) {
}
// If the latecy is more than 1% of the requested sleep time,
// then give up the testing.
+ "expected %d [ms] latency rate: %+.2f%% (expected not more than 1%%)%n"
+ "exiting...%n",
}
}
}
return 5000; // 5 seconds
}
}
return bundle;
}
+ " at " + getTime());
return b;
}
}
}
}