/*
 * The MIT License
 *
 * Copyright 2012 Jesse Glick.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package hudson.model;

import java.util.TimeZone;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static org.junit.Assert.*;
import org.junit.Test;
import org.jvnet.hudson.test.Bug;

public class RunTest {

    @Bug(15816)
    @SuppressWarnings({"unchecked", "rawtypes"})
    @Test public void timezoneOfID() throws Exception {
        TimeZone origTZ = TimeZone.getDefault();
        try {
            final Run r;
            String id;
            TimeZone.setDefault(TimeZone.getTimeZone("America/Chicago"));
            ExecutorService svc = Executors.newSingleThreadExecutor();
            try {
                r = svc.submit(new Callable<Run>() {
                    @Override public Run call() throws Exception {
                        return new Run(new StubJob(), 1234567890) {};
                    }
                }).get();
                TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
                id = r.getId();
                assertEquals(id, svc.submit(new Callable<String>() {
                    @Override public String call() throws Exception {
                        return r.getId();
                    }
                }).get());
            } finally {
                svc.shutdown();
            }
            TimeZone.setDefault(TimeZone.getTimeZone("America/New_York"));
            svc = Executors.newSingleThreadExecutor();
            try {
                assertEquals(id, r.getId());
                assertEquals(id, svc.submit(new Callable<String>() {
                    @Override
                    public String call() throws Exception {
                        return r.getId();
                    }
                }).get());
            } finally {
                svc.shutdown();
            }
        } finally {
            TimeZone.setDefault(origTZ);
        }
    }

}

@@ -3053,12 +3053,1051 @@
  %7D%0A    %7D
+%0A    %0A%0A    @Bug(15587)%0A    @Test %0A    public void testParseTimestampFromBuildDir() throws Exception %7B%0A        //Assume.assumeTrue(!Functions.isWindows() %7C%7C (NTFS && JAVA7) %7C%7C ...);%0A        %0A        String buildDateTime = %222012-12-21_14-02-28%22;%0A        long buildTimestamp = 1356091348000L;%0A        int buildNumber = 155;%0A        %0A         ByteArrayOutputStream baos = new ByteArrayOutputStream();%0A         StreamTaskListener l = new StreamTaskListener(baos);%0A         %0A         File tempDir = Util.createTempDir();    %0A    %09 File buildDir = new File(tempDir, buildDateTime);  %0A         assertEquals(buildDir.mkdir(), true);  %0A    %09 File buildDirSymLink = new File(tempDir, Integer.toString(buildNumber));%0A    %09 %0A         try %7B%0A        %09 buildDir.mkdir();%0A        %09 %0A             Util.createSymlink(tempDir, buildDir.getAbsolutePath(), buildDirSymLink.getName(), l);%0A             assertEquals(Run.parseTimestampFromBuildDir(buildDirSymLink), buildTimestamp);%0A         %7D finally %7B%0A             Util.deleteRecursive(tempDir);%0A         %7D%0A    %7D
 %0A%0A%7D%0A

Update core/src/test/java/hudson/model/RunTest.java