/** * A client component is added to the suite fixture as the value of the * {@link SuiteAttribute#CLIENT} attribute; it may be subsequently accessed * via the {@link org.testng.ITestContext#getSuite()} method. * * @param suite The test suite instance. */ void registerClientComponent(ISuite suite) { Client client = ClientUtils.buildClient(); if (null != client) { suite.setAttribute(SuiteAttribute.CLIENT.getName(), client); } }
/** * A client component is added to the suite fixture as the value of the * {@link SuiteAttribute#CLIENT} attribute; it may be subsequently accessed * via the {@link org.testng.ITestContext#getSuite()} method. * * @param suite * The test suite instance. */ void registerClientComponent(ISuite suite) { Client client = ClientUtils.buildClient(); if (null != client) { suite.setAttribute(SuiteAttribute.CLIENT.getName(), client); } }
/** * An JAX-RS Client component is added to the suite fixture as the value of * the {@link SuiteAttribute#CLIENT} attribute; it may be subsequently * accessed via the {@link org.testng.ITestContext#getSuite()} method. * * @param suite * The test suite instance. */ void registerHttpClient(ISuite suite) { Client client = HttpClientUtils.buildClient(); if (null != client) { suite.setAttribute(SuiteAttribute.CLIENT.getName(), client); } } }
@Override public synchronized void startTestSuite(ISuite suite) { StartTestItemRQ rq = buildStartSuiteRq(suite); final Maybe<String> item = launch.get().startTestItem(rq); suite.setAttribute(RP_ID, item); }
/** * Processes test suite arguments and sets suite attributes accordingly. The * entity referenced by the {@link TestRunArg#IUT iut} argument is retrieved * and stored in a local file that is set as the value of the suite * attribute {@link org.opengis.cite.owc10.SuiteAttribute#TEST_SUBJ_FILE}. * * @param suite * An ISuite object representing a TestNG test suite. */ void processSuiteParameters(ISuite suite) { Map<String, String> params = suite.getXmlSuite().getParameters(); TestSuiteLogger.log(Level.CONFIG, "Suite parameters\n" + params.toString()); String iutParam = params.get(TestRunArg.IUT.toString()); if ((null == iutParam) || iutParam.isEmpty()) { throw new IllegalArgumentException( "Required test run parameter not found: " + TestRunArg.IUT.toString()); } URI iutRef = URI.create(iutParam.trim()); suite.setAttribute(SuiteAttribute.TEST_SUBJ_URI.getName(), iutRef); File entityFile = null; try { entityFile = URIUtils.dereferenceURI(iutRef); } catch (IOException iox) { throw new RuntimeException( "Failed to dereference resource located at " + iutRef, iox); } suite.setAttribute(SuiteAttribute.TEST_SUBJ_FILE.getName(), entityFile); }
Schema kml22Schema = ValidationUtils.createKMLSchema("2.2"); if (null != kml22Schema) { suite.setAttribute(SuiteAttribute.KML22_SCHEMA.getName(), kml22Schema); suite.setAttribute(SuiteAttribute.KML23_SCHEMA.getName(), kml23Schema);
suite.setAttribute(SuiteAttribute.LEVEL.getName(), level); String kmlParam = params.get(TestRunArg.KML.toString()); if ((null == kmlParam) || kmlParam.isEmpty()) { + iutRef, x); suite.setAttribute(SuiteAttribute.TEST_SUBJECT.getName(), kmlDoc); String kmlVersion = kmlDoc.getDocumentElement().getAttribute( KML2.VER_ATTR); kmlVersion = "2.2"; suite.setAttribute(SuiteAttribute.KML_VERSION.getName(), kmlVersion); if (TestSuiteLogger.isLoggable(Level.FINE)) { StringBuilder logMsg = new StringBuilder(
Schema csw3Schema = ValidationUtils.createCSWSchema(); if (null != csw3Schema) { suite.setAttribute(SuiteAttribute.CSW_SCHEMA.getName(), csw3Schema); suite.setAttribute(SuiteAttribute.ATOM_SCHEMA.getName(), atomSchema);
+ iutRef, iox); suite.setAttribute(SuiteAttribute.TEST_SUBJ_FILE.getName(), entityFile); Document iutDoc = null; try { + iutRef, x); suite.setAttribute(SuiteAttribute.TEST_SUBJECT.getName(), iutDoc); if (TestSuiteLogger.isLoggable(Level.FINE)) { StringBuilder logMsg = new StringBuilder(
@Override public void onStart(ISuite suite) { Reporter.clear(); // clear output from previous test runs Schema kmlSchema = ValidationUtils.createKMLSchema(); if (null != kmlSchema) { suite.setAttribute(SuiteAttribute.KML_SCHEMA.getName(), kmlSchema); } processSuiteParameters(suite); }
suite.setAttribute(SuiteAttribute.LEVEL.getName(), level); String iutParam = params.get(TestRunArg.IUT.toString()); if ((null == iutParam) || iutParam.isEmpty()) { + entityFile.toURI(), e); suite.setAttribute(SuiteAttribute.TEST_SUBJECT.getName(), kmlDoc); if (TestSuiteLogger.isLoggable(Level.FINE)) { StringBuilder logMsg = new StringBuilder(
/** * Finds shared styles occurring in a kml:Document container. The resulting * collection ({@code Set<String>}) of style identifiers is set as the value * of the suite attribute {@link SuiteAttribute#SHARED_STYLES}. * * @param testContext * Information about the test run. */ @BeforeSuite public void findSharedStyles(ITestContext testContext) { Document kmlDoc = (Document) testContext.getSuite().getAttribute( SuiteAttribute.TEST_SUBJECT.getName()); Source kmlSource = new DOMSource(kmlDoc, kmlDoc.getBaseURI()); Set<String> sharedStyles = KMLUtils.findElementIdentifiers(kmlSource, "//kml:Document/kml:Style | //kml:Document/kml:StyleMap"); testContext.getSuite().setAttribute( SuiteAttribute.SHARED_STYLES.getName(), sharedStyles); }
+ dataFile.getAbsolutePath()); DatasetInfo dataset = new DatasetInfo(dataFile); testContext.getSuite().setAttribute( SuiteAttribute.DATASET.getName(), dataset);
/** * Finds custom schemas (kml:Schema) defined in a kml:Document container. * The resulting collection ({@code Set<String>}) of schema identifiers is * set as the value of the suite attribute * {@link SuiteAttribute#CUSTOM_SCHEMAS}. * * @param testContext * Information about the test run. */ @BeforeSuite public void findCustomSchemas(ITestContext testContext) { Document kmlDoc = (Document) testContext.getSuite().getAttribute( SuiteAttribute.TEST_SUBJECT.getName()); Source kmlSource = new DOMSource(kmlDoc, kmlDoc.getBaseURI()); Set<String> customSchemas = KMLUtils.findElementIdentifiers(kmlSource, "//kml:Document/kml:Schema"); testContext.getSuite().setAttribute( SuiteAttribute.CUSTOM_SCHEMAS.getName(), customSchemas); }
ErrorMessageKeys.OPENSEARCH_UNAVAIL)); testContext.getSuite().setAttribute( SuiteAttribute.OPENSEARCH_DESCR.getName(), openSearchDescr);