Mercurial > hg > tc-symbol-server
annotate tests/src/PdbStrExeTest.java @ 96:278205b01935 9.1.x
add more logging of storing pdb's signatures
author | Evgeniy.Koshkin |
---|---|
date | Fri, 20 Nov 2015 12:40:14 +0300 |
parents | 2d2f54daf202 |
children |
rev | line source |
---|---|
12 | 1 /* |
2 * Copyright 2000-2013 JetBrains s.r.o. | |
3 * | |
4 * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 * you may not use this file except in compliance with the License. | |
6 * You may obtain a copy of the License at | |
7 * | |
8 * http://www.apache.org/licenses/LICENSE-2.0 | |
9 * | |
10 * Unless required by applicable law or agreed to in writing, software | |
11 * distributed under the License is distributed on an "AS IS" BASIS, | |
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 * See the License for the specific language governing permissions and | |
14 * limitations under the License. | |
15 */ | |
16 | |
17 import jetbrains.buildServer.BaseTestCase; | |
18 import jetbrains.buildServer.ExecResult; | |
27
76ed2d58c871
- reused home path between all srcsrv-related utilities
Evgeniy.Koshkin
parents:
12
diff
changeset
|
19 import jetbrains.buildServer.symbols.tools.PdbStrExe; |
76ed2d58c871
- reused home path between all srcsrv-related utilities
Evgeniy.Koshkin
parents:
12
diff
changeset
|
20 import jetbrains.buildServer.symbols.tools.PdbStrExeCommands; |
35 | 21 import jetbrains.buildServer.util.FileUtil; |
12 | 22 import org.testng.annotations.BeforeMethod; |
23 import org.testng.annotations.Test; | |
24 | |
25 import java.io.File; | |
26 import java.io.IOException; | |
27 | |
28 /** | |
29 * @author Evgeniy.Koshkin | |
30 */ | |
31 public class PdbStrExeTest extends BaseTestCase { | |
32 | |
33 private PdbStrExe myTool; | |
34 private File myNotIndexedPdbFile; | |
35 private File myIndexedPdbFile; | |
36 | |
37 @BeforeMethod | |
38 public void setUp() throws Exception { | |
27
76ed2d58c871
- reused home path between all srcsrv-related utilities
Evgeniy.Koshkin
parents:
12
diff
changeset
|
39 myTool = new PdbStrExe(new File("aaa")); |
12 | 40 File homeDir = createTempDir(); |
41 | |
42 File file = new File(homeDir, "notIndexed.pdb"); | |
43 FileUtil.copy(new File("c:\\temp\\JetBrains.CommandLine.Symbols.pdb"), file); | |
44 myNotIndexedPdbFile = file; | |
45 assertFalse(myNotIndexedPdbFile.length() == 0); | |
46 | |
47 file = new File(homeDir, "indexed.pdb"); | |
48 FileUtil.copy(new File("c:\\temp\\JetBrains.CommandLine.Symbols.Indexed.pdb"), file); | |
49 myIndexedPdbFile = file; | |
50 assertFalse(myIndexedPdbFile.length() == 0); | |
51 } | |
52 | |
53 @Test | |
54 public void testRead() throws Exception { | |
55 final File tempFile = createTempFile(); | |
56 assertTrue(tempFile.length() == 0); | |
27
76ed2d58c871
- reused home path between all srcsrv-related utilities
Evgeniy.Koshkin
parents:
12
diff
changeset
|
57 ExecResult execResult = myTool.doCommand(PdbStrExeCommands.READ, myIndexedPdbFile, tempFile, PdbStrExe.SRCSRV_STREAM_NAME); |
12 | 58 assertEquals(0, execResult.getExitCode()); |
59 assertFalse(tempFile.length() == 0); | |
60 } | |
61 | |
62 @Test | |
63 public void testWrite() throws IOException { | |
64 final File tempFile = createTempFile(); | |
65 assertTrue(tempFile.length() == 0); | |
27
76ed2d58c871
- reused home path between all srcsrv-related utilities
Evgeniy.Koshkin
parents:
12
diff
changeset
|
66 myTool.doCommand(PdbStrExeCommands.READ, myNotIndexedPdbFile, tempFile, PdbStrExe.SRCSRV_STREAM_NAME); |
12 | 67 assertTrue(tempFile.length() == 0); |
68 | |
69 File inputStreamFile = new File("c:\\temp\\pdb-patch.txt"); | |
70 assertFalse(inputStreamFile.length() == 0); | |
27
76ed2d58c871
- reused home path between all srcsrv-related utilities
Evgeniy.Koshkin
parents:
12
diff
changeset
|
71 myTool.doCommand(PdbStrExeCommands.WRITE, myNotIndexedPdbFile, inputStreamFile, PdbStrExe.SRCSRV_STREAM_NAME); |
12 | 72 |
27
76ed2d58c871
- reused home path between all srcsrv-related utilities
Evgeniy.Koshkin
parents:
12
diff
changeset
|
73 myTool.doCommand(PdbStrExeCommands.READ, myNotIndexedPdbFile, tempFile, PdbStrExe.SRCSRV_STREAM_NAME); |
12 | 74 assertFalse(tempFile.length() == 0); |
75 } | |
76 } |