use of org.testng.annotations.BeforeSuite in project oxAuth by GluuFederation.
the class ConfigurableTest method initTestSuite.
@BeforeSuite
public void initTestSuite(ITestContext context) throws FileNotFoundException, IOException {
Reporter.log("Invoked init test suite method", true);
String propertiesFile = context.getCurrentXmlTest().getParameter("propertiesFile");
if (StringHelper.isEmpty(propertiesFile)) {
propertiesFile = "target/test-classes/testng.properties";
}
// Load test parameters
FileInputStream conf = new FileInputStream(propertiesFile);
Properties prop;
try {
prop = new Properties();
prop.load(conf);
} finally {
IOUtils.closeQuietly(conf);
}
Map<String, String> parameters = new HashMap<String, String>();
for (Entry<Object, Object> entry : prop.entrySet()) {
Object key = entry.getKey();
Object value = entry.getValue();
if (StringHelper.isEmptyString(key) || StringHelper.isEmptyString(value)) {
continue;
}
parameters.put(key.toString(), value.toString());
}
// Override test parameters
context.getSuite().getXmlSuite().setParameters(parameters);
}
use of org.testng.annotations.BeforeSuite in project open-ecard by ecsec.
the class AddonBundleDescriptionTest method setup.
@BeforeSuite
public void setup() throws IOException, WSMarshallerException, SAXException {
// read the test xml
InputStream descriptionStream = FileUtils.resolveResourceAsStream(AddonBundleDescriptionTest.class, TEST_DESCRIPTION);
String s = FileUtils.toString(descriptionStream);
// unmarshal it and check fields of POJO
WSMarshaller marshaller = WSMarshallerFactory.createInstance();
marshaller.removeAllTypeClasses();
marshaller.addXmlTypeClass(AddonSpecification.class);
Object o = marshaller.unmarshal(marshaller.str2doc(s));
addonBundleDescription = (AddonSpecification) o;
}
use of org.testng.annotations.BeforeSuite in project citrus-samples by christophd.
the class AbstractKubernetesIT method checkMinikubeEnvironment.
@BeforeSuite(alwaysRun = true)
public void checkMinikubeEnvironment() {
try {
Future<Boolean> future = Executors.newSingleThreadExecutor().submit(() -> {
KubernetesClient kubernetesClient = new DefaultKubernetesClient();
kubernetesClient.pods().list();
return true;
});
future.get(5000, TimeUnit.MILLISECONDS);
connected = true;
} catch (Exception e) {
log.warn("Skipping Kubernetes test execution as no proper Kubernetes environment is available on host system!", e);
}
}
use of org.testng.annotations.BeforeSuite in project midpoint by Evolveum.
the class ExpressionHandlerImplTest method setup.
@BeforeSuite
public void setup() throws SchemaException, SAXException, IOException {
PrettyPrinter.setDefaultNamespacePrefix(MidPointConstants.NS_MIDPOINT_PUBLIC_PREFIX);
PrismTestUtil.resetPrismContext(MidPointPrismContextFactory.FACTORY);
// just something to fill into c:actor expression variable
MidPointPrincipal principal = new MidPointPrincipal(new UserType(PrismTestUtil.getPrismContext()));
SecurityContext securityContext = SecurityContextHolder.getContext();
Authentication authentication = new UsernamePasswordAuthenticationToken(principal, null);
securityContext.setAuthentication(authentication);
}
use of org.testng.annotations.BeforeSuite in project selenium-tests by Wikia.
the class UpvotingTests method setUp.
@BeforeSuite
private void setUp() {
User user = User.USER_5;
String siteId = Utils.extractSiteIdFromWikiName("qadiscussions", "de");
existingPost = DiscussionsClient.using(user, driver).createPostWithUniqueData(siteId);
DiscussionsClient.using(user, driver).createReplyToPost(siteId, existingPost);
}
Aggregations