|
Lines 2372-2378
Link Here
|
| 2372 |
* @return the metamodel managed type |
2372 |
* @return the metamodel managed type |
| 2373 |
* @throws IllegalArgumentException if not a managed class |
2373 |
* @throws IllegalArgumentException if not a managed class |
| 2374 |
*/ |
2374 |
*/ |
| 2375 |
//<X> ManagedType<X> type(Class<X> cls); |
2375 |
//<X> ManagedType<X> managedType(Class<X> cls); |
| 2376 |
// test normal path (subtype = Basic) |
2376 |
// test normal path (subtype = Basic) |
| 2377 |
/* expectedIAExceptionThrown = false; |
2377 |
/* expectedIAExceptionThrown = false; |
| 2378 |
try { |
2378 |
try { |
|
Lines 2387-2392
Link Here
|
| 2387 |
expectedIAExceptionThrown = false; |
2387 |
expectedIAExceptionThrown = false; |
| 2388 |
try { |
2388 |
try { |
| 2389 |
Type<EmbeddedPK> aType = metamodel.managedType(EmbeddedPK.class); |
2389 |
Type<EmbeddedPK> aType = metamodel.managedType(EmbeddedPK.class); |
|
|
2390 |
assertFalse(((TypeImpl)aType).isEntity()); |
| 2391 |
assertFalse(((TypeImpl)aType).isMappedSuperclass()); |
| 2390 |
} catch (IllegalArgumentException iae) { |
2392 |
} catch (IllegalArgumentException iae) { |
| 2391 |
iae.printStackTrace(); |
2393 |
iae.printStackTrace(); |
| 2392 |
expectedIAExceptionThrown = true; |
2394 |
expectedIAExceptionThrown = true; |
|
Lines 2397-2402
Link Here
|
| 2397 |
expectedIAExceptionThrown = false; |
2399 |
expectedIAExceptionThrown = false; |
| 2398 |
try { |
2400 |
try { |
| 2399 |
Type<Manufacturer> aType = metamodel.managedType(Manufacturer.class); |
2401 |
Type<Manufacturer> aType = metamodel.managedType(Manufacturer.class); |
|
|
2402 |
assertTrue(((TypeImpl)aType).isEntity()); |
| 2403 |
assertFalse(((TypeImpl)aType).isMappedSuperclass()); |
| 2400 |
} catch (IllegalArgumentException iae) { |
2404 |
} catch (IllegalArgumentException iae) { |
| 2401 |
iae.printStackTrace(); |
2405 |
iae.printStackTrace(); |
| 2402 |
expectedIAExceptionThrown = true; |
2406 |
expectedIAExceptionThrown = true; |
|
Lines 2423-2431
Link Here
|
| 2423 |
//iae.printStackTrace(); |
2427 |
//iae.printStackTrace(); |
| 2424 |
expectedIAExceptionThrown = true; |
2428 |
expectedIAExceptionThrown = true; |
| 2425 |
} |
2429 |
} |
| 2426 |
assertNull(aTypeFromNullClass); |
2430 |
//assertNull(aTypeFromNullClass); |
| 2427 |
assertFalse(expectedIAExceptionThrown); |
2431 |
assertTrue("IllegalArgumentException expected on Metamodel.managedType(null)",expectedIAExceptionThrown); |
| 2428 |
|
2432 |
|
|
|
2433 |
// Type is basic - throw IAE |
| 2434 |
expectedIAExceptionThrown = false; |
| 2435 |
try { |
| 2436 |
Type<Integer> aType = metamodel.managedType(Integer.class); |
| 2437 |
} catch (IllegalArgumentException iae) { |
| 2438 |
//iae.printStackTrace(); |
| 2439 |
expectedIAExceptionThrown = true; |
| 2440 |
} |
| 2441 |
assertTrue("IllegalArgumentException expected on Metamodel.managedType(Integer.class)",expectedIAExceptionThrown); |
| 2442 |
|
| 2429 |
// test variant path: wrong type (java simple type) |
2443 |
// test variant path: wrong type (java simple type) |
| 2430 |
expectedIAExceptionThrown = false; |
2444 |
expectedIAExceptionThrown = false; |
| 2431 |
try { |
2445 |
try { |