Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion root/files/resource/Test/nw/Option (for example).txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
UserName=administrator;Password=seigi;Domain=Domain;ProxyUrl=http://xxxxxxxx:8080;PUserName=PUserName;PPassword=PPassword;PDomain=PDomain;UserAgent=UserAgent;ConnGroupName=ConnGroupName;Compression=true;CertFile=C:\certnew.cer;CertPassword=CertPassword;
UserName=administrator;Password=seigi;Domain=Domain;ProxyUrl=http://xxxxxxxx:8080;PUserName=PUserName;PPassword=PPassword;PDomain=PDomain;UserAgent=UserAgent;Compression=true;CertFile=C:\certnew.cer;CertPassword=CertPassword;
11 changes: 6 additions & 5 deletions root/files/resource/Xml/TMProtocolDefinition.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE TMD[
<!ELEMENT TMD (Prop*, Url*, Transmission*)>
<!ELEMENT TMD (Url*, Prop*, Transmission*)>

<!ELEMENT Url EMPTY>
<!ELEMENT Prop EMPTY>
<!ELEMENT Transmission EMPTY>

<!ATTLIST Url id ID #REQUIRED value CDATA #REQUIRED>
<!ATTLIST Prop id ID #REQUIRED value CDATA #REQUIRED>
<!ATTLIST Transmission id ID #REQUIRED protocol (1 | 2) #REQUIRED
<!ATTLIST Transmission id ID #REQUIRED protocol (1 | 4 | 5) #REQUIRED
url CDATA #IMPLIED url_ref IDREF #IMPLIED timeout CDATA #IMPLIED prop_ref IDREF #IMPLIED>
]>
<!-- idの先頭には、数字を使用できない。 -->
<!-- protocol:1=InProcess、2=WebService -->
<!-- protocol:1=InProcess、4=WCF(netTcpBinding)、5=ASP.NET WebAPI -->
<!-- 2=ASP.NET Webサービス、3=WCF(HTTP) は FxEnum.TmProtocol に実装が残るが、現行の構成では使用しない -->
<TMD>
<!-- マスタ データ -->

Expand All @@ -37,8 +38,8 @@
<Transmission id="testWebService4" protocol="5" url="https://localhost/WebAPIControllerForFx" />

<!-- サービス(マスタ データを活用)-->
<Transmission id="_testWebService" protocol="2" url_ref="url_a" timeout="60" prop_ref="prop_a" />
<Transmission id="_testWebService2" protocol="3" url_ref="url_b" />
<!--Transmission id="_testWebService" protocol="2" url_ref="url_a" timeout="60" prop_ref="prop_a" /-->
<!--Transmission id="_testWebService2" protocol="3" url_ref="url_b" /-->
<Transmission id="_testWebService3" protocol="4" url_ref="url_c" />
<Transmission id="_testWebService4" protocol="5" url_ref="url_d" />
</TMD>
11 changes: 6 additions & 5 deletions root/files/resource/Xml/TMProtocolDefinition2.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE TMD[
<!ELEMENT TMD (Prop*, Url*, Transmission*)>
<!ELEMENT TMD (Url*, Prop*, Transmission*)>

<!ELEMENT Url EMPTY>
<!ELEMENT Prop EMPTY>
<!ELEMENT Transmission EMPTY>

<!ATTLIST Url id ID #REQUIRED value CDATA #REQUIRED>
<!ATTLIST Prop id ID #REQUIRED value CDATA #REQUIRED>
<!ATTLIST Transmission id ID #REQUIRED protocol (1 | 2) #REQUIRED
<!ATTLIST Transmission id ID #REQUIRED protocol (1 | 4 | 5) #REQUIRED
url CDATA #IMPLIED url_ref IDREF #IMPLIED timeout CDATA #IMPLIED prop_ref IDREF #IMPLIED>
]>
<!-- idの先頭には、数字を使用できない。 -->
<!-- protocol:1=InProcess、2=WebService -->
<!-- protocol:1=InProcess、4=WCF(netTcpBinding)、5=ASP.NET WebAPI -->
<!-- 2=ASP.NET Webサービス、3=WCF(HTTP) は FxEnum.TmProtocol に実装が残るが、現行の構成では使用しない -->
<TMD>
<!-- マスタ データ -->

Expand All @@ -37,8 +38,8 @@
<Transmission id="testWebService4" protocol="5" url="https://localhost:44349/WebAPIControllerForFx" />

<!-- サービス(マスタ データを活用)-->
<Transmission id="_testWebService" protocol="2" url_ref="url_a" timeout="60" prop_ref="prop_a" />
<Transmission id="_testWebService2" protocol="3" url_ref="url_b" />
<!--Transmission id="_testWebService" protocol="2" url_ref="url_a" timeout="60" prop_ref="prop_a" /-->
<!--Transmission id="_testWebService2" protocol="3" url_ref="url_b" /-->
<Transmission id="_testWebService3" protocol="4" url_ref="url_c" />
<Transmission id="_testWebService4" protocol="5" url_ref="url_d" />
</TMD>
8 changes: 7 additions & 1 deletion root/programs/0_RunAll.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ param(
# UseLang = $true のものにだけ -Lang を渡す。
# 2_RunAllTests.ps1 に渡さないのは、VB 側にテスト プロジェクトが無く(#542)、
# 単体テストが CS の Frameworks\Tests に集約されているため。

# まとめの整形。Format-Table は 5.1 で全角の桁を数えないため、自前で揃える。
. (Join-Path $PSScriptRoot "SummaryTable.ps1")

$scripts = @(
@{ Name = "1_BuildAll.ps1"; UseLang = $true }
@{ Name = "2_RunAllTests.ps1"; UseLang = $false }
Expand Down Expand Up @@ -41,7 +45,9 @@ foreach ($s in $scripts)
# --- 結果のまとめ ---
Write-Host ""
Write-Host "================ 全体のまとめ ================"
$results | Format-Table -AutoSize | Out-String | Write-Host
Write-Host ""
Write-SummaryTable $results
Write-Host ""

# 1_BuildAll.ps1 は既知の署名エラー(MSB3482)で 1 になることがある。
# 終了コードだけで判断せず、エラー一覧の内容を確認すること(RELEASE.md 3 節)。
Expand Down
7 changes: 6 additions & 1 deletion root/programs/1_BuildAll.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ param(
# ビルド バッチはそれぞれの直下にあるため、ステップごとにそこへ移動して呼ぶ。
New-Item -ItemType Directory -Force $OutputDir | Out-Null

# サマリの整形。Format-Table は 5.1 で全角の桁を数えないため、自前で揃える。
. (Join-Path $PSScriptRoot "SummaryTable.ps1")

# ------------------------------------------------------------------
# コンソールのコード ページを先に UTF-8 にしておく
# ------------------------------------------------------------------
Expand Down Expand Up @@ -391,7 +394,9 @@ $total.Stop()
# ------------------------------------------------------------------
Write-Host ""
Write-Host "================ サマリ ================"
$results | Format-Table -AutoSize | Out-String | Write-Host
Write-Host ""
Write-SummaryTable $results
Write-Host ""
Write-Host (" 所要時間 : {0:N1} 分" -f $total.Elapsed.TotalMinutes)
Write-Host (" ログ : {0}" -f $OutputDir)

Expand Down
7 changes: 6 additions & 1 deletion root/programs/2_RunAllTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ $testsRoot = Join-Path $csRoot "Frameworks\Tests"
$repoRoot = (& git -C $testsRoot rev-parse --show-toplevel)
New-Item -ItemType Directory -Force $OutputDir | Out-Null

# サマリの整形。Format-Table は 5.1 で全角の桁を数えないため、自前で揃える。
. (Join-Path $PSScriptRoot "SummaryTable.ps1")

# ------------------------------------------------------------------
# コンソールのコード ページを先に UTF-8 にしておく
# ------------------------------------------------------------------
Expand Down Expand Up @@ -314,7 +317,9 @@ foreach ($t in $tests)
# ------------------------------------------------------------------
Write-Host ""
Write-Host "================ サマリ ================"
$results | Format-Table -AutoSize | Out-String | Write-Host
Write-Host ""
Write-SummaryTable $results
Write-Host ""
Write-Host (" 期待値・ログ : {0}" -f $OutputDir)
Write-Host " 実測値 : ワーキング ツリーの Result*.txt(git diff で確認できます)"

Expand Down
47 changes: 40 additions & 7 deletions root/programs/3_SmokeTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ $configRoot = if ($Lang -eq "VB") { Join-Path $PSScriptRoot "VB" } else { $csRoo

New-Item -ItemType Directory -Force $OutputDir | Out-Null

# サマリの整形。Format-Table は 5.1 で全角の桁を数えないため、自前で揃える。
. (Join-Path $PSScriptRoot "SummaryTable.ps1")

# 対象に与える stdin(空)。
# Start-Process -RedirectStandardInput は実在するファイルを要求するため、先に作る。
# これが無いと Console.ReadKey() が本当にキー入力を待つ。
Expand Down Expand Up @@ -818,6 +821,26 @@ $targetsCS = @(
Pre = $startDeployWebCore; Verify = $verifyDeployCore
}

# --- 通信制御の接続オプション(#546) ---
#
# CallController の接続オプション(ProxyUrl / UserName / UserAgent / Compression 等)が、
# 実際の HTTP 要求に反映されているかを見る。
#
# <外部環境が要らない>
# オリジンとプロキシを、テスト側が TcpListener で自前に立てる。
# 1 プロセスに閉じているので、起動・停止の面倒を見る必要がない。
#
# <net48 だけ>
# ASP.NET WebAPI の経路が .NET Framework 限定である(BinarySerialize を使うため)。
#
# <判定>
# 対象側が項目ごとに OK / NG を出し、末尾に件数を出す。
@{
Name = "TestTransmission (net48)"; Bat = "y_Build_TestTransmission.bat"
Exe = "Frameworks\Tests\TestTransmission\net48\bin\Debug\TestTransmissionFx.exe"
Expect = 'NG : 0 件'
}

# --- Web アプリ ---
@{
Name = "MVC_Sample (net48)"; Bat = "10_Build_WebApp_sample.bat"
Expand Down Expand Up @@ -1019,24 +1042,32 @@ if (-not $SkipBuild)
{
# ビルドする単位は「フォルダ + バッチ」。同じバッチ名が CS と VB の
# 両方にあるため(5_Build_Bat_sample.bat 等)、バッチ名だけでは一意化できない。
#
# 並びは「C# の対象 → VB の前提 → VB の対象」とする。
# 前提を先頭に置くと、-Lang Both で VB の準備が C# の対象より先に流れ、
# 1_BuildAll.ps1(CS → VB の順)と見た目が揃わない。依存関係は
# 「VB の前提が VB の対象より前」だけなので、この並びで足りる。
$builds = @()

# VB を含むなら、前提のビルドを先に通す。
if (@($selected | Where-Object { $_.Dir -eq "VB" }).Count -gt 0)
$builds += @($selected | Where-Object { $_.Dir -ne "VB" } |
ForEach-Object { @{ Dir = $_.Dir; Bat = $_.Bat; Note = "" } })

$vb = @($selected | Where-Object { $_.Dir -eq "VB" })
if ($vb.Count -gt 0)
{
$builds += $prerequisitesVB
$builds += @($prerequisitesVB |
ForEach-Object { @{ Dir = $_.Dir; Bat = $_.Bat; Note = "(VB の前提)" } })
$builds += @($vb | ForEach-Object { @{ Dir = $_.Dir; Bat = $_.Bat; Note = "" } })
}

$builds += @($selected | ForEach-Object { @{ Dir = $_.Dir; Bat = $_.Bat } })

$done = @{}
foreach ($b in $builds)
{
$key = $b.Dir + "\" + $b.Bat
if ($done.ContainsKey($key)) { continue }
$done[$key] = $true

Write-Host ("=== ビルド : {0} ===" -f $key) -ForegroundColor Cyan
Write-Host ("=== ビルド : {0}{1} ===" -f $key, $b.Note) -ForegroundColor Cyan
$sw = [Diagnostics.Stopwatch]::StartNew()
[void](Invoke-BuildBat $b.Dir $b.Bat)
$sw.Stop()
Expand Down Expand Up @@ -1288,7 +1319,9 @@ foreach ($t in $selected)
# ------------------------------------------------------------------
Write-Host ""
Write-Host "================ サマリ ================"
$results | Format-Table -AutoSize -Wrap | Out-String | Write-Host
Write-Host ""
Write-SummaryTable $results
Write-Host ""
Write-Host (" ログ : {0}" -f $OutputDir)

$ng = @($results | Where-Object { $_.結果 -ne "OK" })
Expand Down
2 changes: 1 addition & 1 deletion root/programs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ VS 18 のある環境では従来どおり `18.0` になるため、**挙動は
### 実測(run 30984111639 : 全ステップ成功)

> **当時の件数での記録。** その後、単体テストは 8 ケース(#520)、
> 疎通は 22 件(#528)に増えている。**時間の目安として読むこと。**
> 疎通は 23 件(#528、#546)に増えている。**時間の目安として読むこと。**

| ステップ | CI | ローカル |
|---|---|---|
Expand Down
2 changes: 1 addition & 1 deletion root/programs/CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cd root\programs
|---|---|---|
| ビルド | 全ステップ OK | [`BUILDING.md`](BUILDING.md) |
| 単体テスト | 8/8 OK、差分 0 | [`TESTING.md`](TESTING.md) |
| 疎通 | 22/22 OK | [`SMOKETEST.md`](SMOKETEST.md) |
| 疎通 | 23/23 OK | [`SMOKETEST.md`](SMOKETEST.md) |

**既定は C# 側。VB 側は `-Lang` で回す**(3 節)。

Expand Down
9 changes: 9 additions & 0 deletions root/programs/CODING.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ sakura -GREPMODE -GKEY="ビルドに" -GFOLDER="." -GFILE="*.log" -GOPT=P -GCODE
| 同じファイルなのに差分が出る | `Get-Content` の既定エンコードが 5.1 は ANSI、7 は UTF-8 | **`-Encoding UTF8`** を明示する |
| HTTP が常に失敗(状態コード `-1`) | `-SkipHttpErrorCheck` は **7 以降にしかない** | バージョンを見て付け外しする |
| 実行中に画面がクリアされ、それまでの結果が消える | 子プロセスの `chcp 65001` はコンソール全体に影響する | スクリプト冒頭で先に切り替える |
| 表の見出し・罫線・データがずれる | 5.1 の `Format-Table` は**桁数ではなく文字数**で幅を決める(全角は 1 文字で 2 桁) | `SummaryTable.ps1` の `Write-SummaryTable` を使う |

```powershell
# 7 専用の引数は、バージョンを見て付け外しする
Expand All @@ -230,8 +231,16 @@ if ([Console]::OutputEncoding.CodePage -ne 65001)
}
```

```powershell
# 集計表は Format-Table ではなく、桁数を自前で数える整形を使う
. (Join-Path $PSScriptRoot "SummaryTable.ps1")
Write-SummaryTable $results
```

- **`.bat` は「非 ASCII を含むときだけ」BOM 付き**(8.4)だが、
**`.ps1` は非 ASCII を含むなら必ず BOM 付き**。5.1 が既定で ANSI として読むため。
- **要素 1 個の配列は、返した時点でスカラーに展開される。** そのまま `[0]` を取ると
**文字列の 1 文字目**になる。関数の戻り値を添字で使うなら `@()` で受けること。
- 5.1 の `[Console]::OutputEncoding` は**起動時の値のまま**で、実行中にコード ページが
変わっても追随しない。同じ画面で 2 回目を実行したときに化ける原因になる。
- **変更したら 5.1 でも実行して確かめること。**
Expand Down
1 change: 1 addition & 0 deletions root/programs/CS/Frameworks/ANALYSIS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
| `TestDataAccess` | データ アクセスのテスト(#520)。`TestCode` と同じ構成だが**DB に接続する**。`/MODE` で対象 DBMS を切り替える(既定は SQL Server のみ) | [`README.md`](Tests/TestDataAccess/README.md) |
| `TestLog` | ログ出力確認(log4net/NLog、1〜3) | — |
| `TestBatch` | バッチ起動確認 | — |
| `TestTransmission` | 通信制御の接続オプション(#546)。**オリジンとプロキシを自前で立て**、`CallController` から呼んで、要求に反映されているかを見る。**期待値ファイルを持たず、自分で合否を出す**(疎通テストから呼ばれる) | [`SMOKETEST.md`](../../SMOKETEST.md) 3 節 |
| `EncAndDecUtil` / `EncAndDecUtilCUI` | 暗号・署名ユーティリティの GUI/CUI 確認 | — |

**`TestCode` と `TestDataAccess` は専用の `README.md` を持つ。**
Expand Down
Loading