/** Tests the {@link SkippedComponent#getErrorDetails()} method */ public void testGetErrorDetails() { try { IApiComponent tcomp = getTestingComponent(); assertNotNull("The testing component should not be null", tcomp); // $NON-NLS-1$ SkippedComponent scomp1 = new SkippedComponent(tcomp.getSymbolicName(), tcomp.getVersion(), tcomp.getErrors()); assertNotNull( "There should be resolution errors for the testing component", scomp1.getErrors()); // $NON-NLS-1$ String reason = scomp1.getErrorDetails(); assertTrue( "The reason should be because of a unresolved constraint", reason.startsWith("Require-Bundle:")); // $NON-NLS-1$ //$NON-NLS-2$ scomp1 = new SkippedComponent(tcomp.getSymbolicName(), tcomp.getVersion(), null); assertNull( "There should be no errors for the testing component", scomp1.getErrors()); // $NON-NLS-1$ reason = scomp1.getErrorDetails(); assertTrue( "The reason should be because it was exclude", reason.startsWith( "This component was excluded from the search by the search parameters.")); //$NON-NLS-1$ //$NON-NLS-2$ } catch (Exception e) { fail(e.getMessage()); } }
/** Tests the {@link SkippedComponent#getErrors()} method */ public void testGetErrors() { try { IApiComponent tcomp = getTestingComponent(); assertNotNull("The testing component should not be null", tcomp); // $NON-NLS-1$ SkippedComponent scomp1 = new SkippedComponent(tcomp.getSymbolicName(), tcomp.getVersion(), tcomp.getErrors()); assertNotNull( "There should be resolution errors for the testing component", scomp1.getErrors()); // $NON-NLS-1$ } catch (Exception e) { fail(e.getMessage()); } }