Skip to content

Commit

Permalink
ICE-7333 - Java/C# cross test failure in Ice/optional
Browse files Browse the repository at this point in the history
  • Loading branch information
spruiell committed Sep 8, 2016
1 parent 108b3c9 commit 2e78fe1
Show file tree
Hide file tree
Showing 29 changed files with 125 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cpp/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
2 changes: 2 additions & 0 deletions cpp/test/Ice/optional/TestAMD.ice
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
13 changes: 13 additions & 0 deletions cpp/test/Ice/optional/TestAMDI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,13 @@ InitialI::supportsCppStringViewAsync(::std::function<void(bool)> response,
response(true);
}

void
InitialI::supportsNullOptionalAsync(::std::function<void(bool)> response,
::std::function<void(::std::exception_ptr)>, const Ice::Current&)
{
response(true);
}


#else // C++98 mapping

Expand Down Expand Up @@ -1012,4 +1019,10 @@ InitialI::supportsCppStringView_async(const ::Test::AMD_Initial_supportsCppStrin
cb->ice_response(true);
}

void
InitialI::supportsNullOptional_async(const ::Test::AMD_Initial_supportsNullOptionalPtr& cb, const Ice::Current&)
{
cb->ice_response(true);
}

#endif
4 changes: 4 additions & 0 deletions cpp/test/Ice/optional/TestAMDI.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ class InitialI :
virtual void supportsCppStringViewAsync(::std::function<void(bool)>,
::std::function<void(::std::exception_ptr)>, const Ice::Current&) override;

virtual void supportsNullOptionalAsync(::std::function<void(bool)>,
::std::function<void(::std::exception_ptr)>, const Ice::Current&) override;


#else // C++98 mapping
Expand Down Expand Up @@ -515,6 +517,8 @@ class InitialI :
virtual void supportsCppStringView_async(const ::Test::AMD_Initial_supportsCppStringViewPtr&,
const Ice::Current&);

virtual void supportsNullOptional_async(const ::Test::AMD_Initial_supportsNullOptionalPtr&, const Ice::Current&);

#endif

};
Expand Down
6 changes: 6 additions & 0 deletions cpp/test/Ice/optional/TestI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,9 @@ InitialI::supportsCppStringView(const Ice::Current&)
{
return true;
}

bool
InitialI::supportsNullOptional(const Ice::Current&)
{
return true;
}
2 changes: 2 additions & 0 deletions cpp/test/Ice/optional/TestI.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ class InitialI :
virtual bool supportsCsharpSerializable(const Ice::Current&);

virtual bool supportsCppStringView(const Ice::Current&);

virtual bool supportsNullOptional(const Ice::Current&);
};

#endif
18 changes: 12 additions & 6 deletions csharp/test/Ice/optional/AllTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,11 +1154,14 @@ public static Test.InitialPrx allTests(Ice.Communicator communicator)
test(!p2.HasValue && !p3.HasValue);
p2 = initial.opOneOptional(Ice.Util.None, out p3);
test(!p2.HasValue && !p3.HasValue);
p2 = initial.opOneOptional(null, out p3); // Implicitly converts to Ice.Optional<OneOptional>(null)
test(p2.HasValue && p2.Value == null && p3.HasValue && p3.Value == null);
if(initial.supportsNullOptional())
{
p2 = initial.opOneOptional(null, out p3); // Implicitly converts to Ice.Optional<OneOptional>(null)
test(p2.HasValue && p2.Value == null && p3.HasValue && p3.Value == null);

p2 = initial.opOneOptional(new Ice.Optional<Test.OneOptional>((Test.OneOptional)null), out p3);
test(p2.HasValue && p3.HasValue && p2.Value == null && p3.Value == null);
p2 = initial.opOneOptional(new Ice.Optional<Test.OneOptional>((Test.OneOptional)null), out p3);
test(p2.HasValue && p3.HasValue && p2.Value == null && p3.Value == null);
}

p1 = new Test.OneOptional(58);
p2 = initial.opOneOptional(p1, out p3);
Expand Down Expand Up @@ -1207,8 +1210,11 @@ public static Test.InitialPrx allTests(Ice.Communicator communicator)
test(!p2.HasValue && !p3.HasValue);
p2 = initial.opOneOptionalProxy(Ice.Util.None, out p3);
test(!p2.HasValue && !p3.HasValue);
p2 = initial.opOneOptionalProxy(null, out p3);
test(p2.HasValue && p3.HasValue && p2.Value == null && p3.Value == null);
if(initial.supportsNullOptional())
{
p2 = initial.opOneOptionalProxy(null, out p3);
test(p2.HasValue && p3.HasValue && p2.Value == null && p3.Value == null);
}

//
// Not allowed by C# language spec because OptionalOnePrx is an interface.
Expand Down
2 changes: 2 additions & 0 deletions csharp/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
2 changes: 2 additions & 0 deletions csharp/test/Ice/optional/TestAMD.ice
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
6 changes: 6 additions & 0 deletions csharp/test/Ice/optional/TestAMDI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,10 @@ public override Task<bool>
{
return Task.FromResult<bool>(false);
}

public override Task<bool>
supportsNullOptionalAsync(Ice.Current current)
{
return Task.FromResult<bool>(true);
}
}
5 changes: 5 additions & 0 deletions csharp/test/Ice/optional/TestI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,9 @@ public override bool supportsCppStringView(Ice.Current current)
{
return false;
}

public override bool supportsNullOptional(Ice.Current current)
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -678,4 +678,11 @@ public final class AMDInitialI extends Initial
{
cb.ice_response(false);
}

@Override
public void
supportsNullOptional_async(AMD_Initial_supportsNullOptional cb, Ice.Current current)
{
cb.ice_response(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -730,4 +730,11 @@ public Ice.Optional<java.util.Map<String, Integer>> opMDict2(Ice.Optional<java.u
{
return false;
}

@Override
public boolean
supportsNullOptional(Ice.Current current)
{
return true;
}
}
2 changes: 2 additions & 0 deletions java-compat/test/src/main/java/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
2 changes: 2 additions & 0 deletions java-compat/test/src/main/java/test/Ice/optional/TestAMD.ice
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
10 changes: 10 additions & 0 deletions java/test/src/main/java/test/Ice/optional/AMDInitialI.java
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,14 @@ public CompletionStage<Boolean> supportsCppStringViewAsync(Current current)
{
return CompletableFuture.completedFuture(false);
}

@Override
public CompletionStage<Boolean> supportsNullOptionalAsync(Current current)
{
//
// The java.util.Optional class does not support a null value. Constructing an Optional
// using Optional.ofNullable(null) returns an optional whose value is NOT present.
//
return CompletableFuture.completedFuture(false);
}
}
10 changes: 10 additions & 0 deletions java/test/src/main/java/test/Ice/optional/InitialI.java
Original file line number Diff line number Diff line change
Expand Up @@ -589,4 +589,14 @@ public boolean supportsCppStringView(Current current)
{
return false;
}

@Override
public boolean supportsNullOptional(Current current)
{
//
// The java.util.Optional class does not support a null value. Constructing an Optional
// using Optional.ofNullable(null) returns an optional whose value is NOT present.
//
return false;
}
}
2 changes: 2 additions & 0 deletions java/test/src/main/java/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
2 changes: 2 additions & 0 deletions java/test/src/main/java/test/Ice/optional/TestAMD.ice
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
2 changes: 2 additions & 0 deletions js/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ class Initial
bool supportsJavaSerializable();

bool supportsCsharpSerializable();

bool supportsNullOptional();
};

};
2 changes: 2 additions & 0 deletions objective-c/test/Ice/optional/OptionalTest.ice
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
1 change: 1 addition & 0 deletions objective-c/test/Ice/optional/TestI.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
-(BOOL) supportsRequiredParams:(ICECurrent*)current;
-(BOOL) supportsJavaSerializable:(ICECurrent*)current;
-(BOOL) supportsCsharpSerializable:(ICECurrent*)current;
-(BOOL) supportsNullOptional:(ICECurrent*)current;
@end
4 changes: 4 additions & 0 deletions objective-c/test/Ice/optional/TestI.m
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,9 @@ -(BOOL) supportsCppStringView:(ICECurrent*)current
{
return NO;
}
-(BOOL) supportsNullOptional:(ICECurrent*)current
{
return YES;
}

@end
4 changes: 4 additions & 0 deletions php/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ class Initial
bool supportsJavaSerializable();

bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
3 changes: 3 additions & 0 deletions python/test/Ice/optional/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def supportsCsharpSerializable(self, current=None):
def supportsCppStringView(self, current=None):
return False

def supportsNullOptional(self, current=None):
return True

def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp")
adapter = communicator.createObjectAdapter("TestAdapter")
Expand Down
3 changes: 3 additions & 0 deletions python/test/Ice/optional/ServerAMD.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ def supportsCsharpSerializable_async(self, cb, current=None):
def supportsCppStringView_async(self, cb, current=None):
cb.ice_response(False)

def supportsNullOptional(self, cb, current=None):
cb.ice_response(True)

def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp")
adapter = communicator.createObjectAdapter("TestAdapter")
Expand Down
2 changes: 2 additions & 0 deletions python/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
2 changes: 2 additions & 0 deletions python/test/Ice/optional/TestAMD.ice
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ class Initial
bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};
4 changes: 4 additions & 0 deletions ruby/test/Ice/optional/Test.ice
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ class Initial
bool supportsJavaSerializable();

bool supportsCsharpSerializable();

bool supportsCppStringView();

bool supportsNullOptional();
};

};

0 comments on commit 2e78fe1

Please sign in to comment.