-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
134 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) ZeroC, Inc. | ||
|
||
namespace Ice.unknownProperties; | ||
|
||
public class AllTests : Test.AllTests | ||
{ | ||
public static int allTests(Test.TestHelper helper) | ||
{ | ||
var communicator = helper.communicator(); | ||
var output = helper.getWriter(); | ||
|
||
output.Write("Creating object adapter with unknown properties fails... "); | ||
communicator.getProperties().setProperty("Foo.Endpoints", "tcp -h 127.0.0.1"); | ||
communicator.getProperties().setProperty("Foo.UnknownProperty", "bar"); | ||
try | ||
{ | ||
communicator.createObjectAdapter("Foo"); | ||
test(false); | ||
} | ||
catch (UnknownPropertyException) | ||
{ | ||
} | ||
output.WriteLine("ok"); | ||
|
||
output.Write("Creating proxy with unknown properties fails... "); | ||
|
||
communicator.getProperties().setProperty("Greeter", "hello:tcp -h 127.0.0.1 -p 10000"); | ||
communicator.getProperties().setProperty("Greeter.UnknownProperty", "bar"); | ||
try | ||
{ | ||
communicator.propertyToProxy("Greeter"); | ||
test(false); | ||
} | ||
catch (UnknownPropertyException) | ||
{ | ||
} | ||
output.WriteLine("ok"); | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) ZeroC, Inc. | ||
|
||
namespace Ice.unknownProperties; | ||
|
||
public class Client : Test.TestHelper | ||
{ | ||
public override void run(string[] args) | ||
{ | ||
var initData = new InitializationData(); | ||
initData.properties = createTestProperties(ref args); | ||
using Communicator communicator = initialize(initData); | ||
AllTests.allTests(this); | ||
} | ||
|
||
public static Task<int> Main(string[] args) => | ||
Test.TestDriver.runTestAsync<Client>(args); | ||
} |
29 changes: 29 additions & 0 deletions
29
csharp/test/Ice/unknownProperties/msbuild/client/client.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="../../../../../msbuild/ice.common.props" /> | ||
<PropertyGroup> | ||
<AssemblyName>client</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>$(AppTargetFramework)</TargetFramework> | ||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> | ||
<OutputPath>.</OutputPath> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="../../../../TestCommon/TestHelper.cs" /> | ||
<Compile Include="../../AllTests.cs" /> | ||
<Compile Include="../../Client.cs" /> | ||
</ItemGroup> | ||
<Choose> | ||
<When Condition="'$(ICE_BIN_DIST)' == 'all'"> | ||
<ItemGroup> | ||
<PackageReference Include="zeroc.ice.net" Version="3.8.0" /> | ||
</ItemGroup> | ||
</When> | ||
<Otherwise> | ||
<ItemGroup> | ||
<ProjectReference Include="../../../../../src/Ice/Ice.csproj" /> | ||
</ItemGroup> | ||
</Otherwise> | ||
</Choose> | ||
</Project> |