Skip to content

Commit c7647a1

Browse files
committed
test: Add comprehensive ClientServerMethodsSupportTest
refactor: move unwrapException helper to end of ClientExceptionFlowTest - Relocated unwrapException() method from line 174 to end of class (line 295) - Improves code organization by placing helper methods after test methods - No functional changes, pure code reorganization - Lines added: 14, lines removed: 14 test: Add comprehensive ClientServerMethodsSupportTest - Created new test class to verify ClientRequestInfo and ServerRequestInfo method availability at different interception points - Tests client-side interception points: send_request, receive_reply, receive_exception, and receive_other - Tests server-side interception points: receive_request_service_contexts, receive_request, send_reply, and send_exception - Uses Mockito to mock interceptors and capture method availability at each point - Generates detailed reports showing which methods are fully supported, throw BAD_INV_ORDER, or are not supported at each interception point - Includes helper methods to systematically test all RequestInfo, ClientRequestInfo, and ServerRequestInfo methods - Lines added: 601, lines removed: 0 Co-authored-by-AI: IBM Bob <1.0.2> (GPT-5)
1 parent 967dcc5 commit c7647a1

3 files changed

Lines changed: 621 additions & 21 deletions

File tree

yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ArgumentStrategyNull.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2026, 2021 IBM Corporation and others.
2+
* Copyright 2021 IBM Corporation and others.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,12 +37,12 @@ org.omg.Dynamic.Parameter[] arguments() {
3737
MinorCodes.MinorInvalidPICall,
3838
org.omg.CORBA.CompletionStatus.COMPLETED_NO);
3939

40-
// When arguments are marked as available but we don't have type information,
41-
// return an empty array. This allows portable interceptors to function even
42-
// when using invocation styles that don't provide detailed type metadata.
43-
// This is compliant with CORBA spec which states arguments() should not throw
44-
// when called at appropriate interception points.
45-
return new org.omg.Dynamic.Parameter[0];
40+
throw new org.omg.CORBA.NO_RESOURCES(
41+
MinorCodes
42+
.describeNoResources(MinorCodes.MinorInvalidBinding)
43+
+ ": arguments unavailable",
44+
MinorCodes.MinorInvalidBinding,
45+
org.omg.CORBA.CompletionStatus.COMPLETED_NO);
4646
}
4747

4848
//

yoko-verify/src/test/java-testify/org/omg/PortableInterceptor/ClientExceptionFlowTest.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,6 @@ void testExceptionTranslationInInterceptorChain(Echo stub) throws Exception {
171171
order.verifyNoMoreInteractions(); // Verify CI2.receive_exception() and CI3 are NOT called
172172
}
173173

174-
/**
175-
* Unwraps exception wrappers to get the underlying CORBA exception.
176-
* Handles RemoteException and UndeclaredThrowableException wrappers.
177-
*/
178-
private static Throwable unwrapException(Throwable thrown) {
179-
if (thrown instanceof RemoteException) {
180-
return thrown.getCause();
181-
}
182-
if (thrown instanceof UndeclaredThrowableException) {
183-
return ((UndeclaredThrowableException) thrown).getUndeclaredThrowable();
184-
}
185-
return thrown;
186-
}
187-
188174
/**
189175
* Exception in receive_reply()
190176
* Verifies that when CI2 throws an exception in receive_reply():
@@ -306,4 +292,17 @@ void testExceptionInReceiveException(Echo stub) throws Exception {
306292
order.verifyNoMoreInteractions(); // Verify no other interactions
307293
}
308294

295+
/**
296+
* Unwraps exception wrappers to get the underlying CORBA exception.
297+
* Handles RemoteException and UndeclaredThrowableException wrappers.
298+
*/
299+
private static Throwable unwrapException(Throwable thrown) {
300+
if (thrown instanceof RemoteException) {
301+
return thrown.getCause();
302+
}
303+
if (thrown instanceof UndeclaredThrowableException) {
304+
return ((UndeclaredThrowableException) thrown).getUndeclaredThrowable();
305+
}
306+
return thrown;
307+
}
309308
}

0 commit comments

Comments
 (0)