Search in sources :

Example 96 with BeforeTest

use of org.testng.annotations.BeforeTest in project jetcd by coreos.

the class LeaseTest method setUp.

@BeforeTest
public void setUp() throws Exception {
    test = new Assertion();
    client = ClientBuilder.newBuilder().endpoints(TestConstants.endpoints).build();
    kvClient = client.getKVClient();
    leaseClient = client.getLeaseClient();
}
Also used : Assertion(org.testng.asserts.Assertion) BeforeTest(org.testng.annotations.BeforeTest)

Example 97 with BeforeTest

use of org.testng.annotations.BeforeTest in project gatk by broadinstitute.

the class ReferenceMemorySourceTest method init.

@BeforeTest
public void init() {
    List<SAMSequenceRecord> l = new ArrayList<>();
    l.add(new SAMSequenceRecord("chr1", 1000000));
    SAMSequenceDictionary seqDir = new SAMSequenceDictionary(l);
    memorySource = new ReferenceMemorySource(ref1, seqDir);
}
Also used : ArrayList(java.util.ArrayList) SAMSequenceRecord(htsjdk.samtools.SAMSequenceRecord) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) BeforeTest(org.testng.annotations.BeforeTest)

Example 98 with BeforeTest

use of org.testng.annotations.BeforeTest in project Payara by payara.

the class BasicCDITest method beforeTest.

@BeforeTest
public void beforeTest() throws NamingException {
    context = new InitialContext();
    String ejb1Jar = EJB1_JAR;
    if (!SOURCE_HOME.startsWith("$")) {
        ejb1Jar = SOURCE_HOME + SOURCE_HOME_EJB;
    }
    deployed1 = NucleusTestUtils.nadmin("deploy", ejb1Jar);
    Assert.assertTrue(deployed1);
    File destroyedFile = new File(GLASSFISH_HOME);
    destroyedFile = new File(destroyedFile, RELATIVE_FILE_PATH);
    if (destroyedFile.exists()) {
        Assert.assertTrue(destroyedFile.delete());
    }
}
Also used : File(java.io.File) InitialContext(javax.naming.InitialContext) BeforeTest(org.testng.annotations.BeforeTest)

Example 99 with BeforeTest

use of org.testng.annotations.BeforeTest in project Payara by payara.

the class JerseyTest method beforeTest.

@BeforeTest
public void beforeTest() throws NamingException {
    context = new InitialContext();
    String jerseyWar = JERSEY_WAR;
    if (!SOURCE_HOME.startsWith("$")) {
        jerseyWar = SOURCE_HOME + SOURCE_HOME_WAR;
    }
    deployed1 = NucleusTestUtils.nadmin("deploy", jerseyWar);
    Assert.assertTrue(deployed1);
}
Also used : InitialContext(javax.naming.InitialContext) BeforeTest(org.testng.annotations.BeforeTest)

Example 100 with BeforeTest

use of org.testng.annotations.BeforeTest in project carbon-apimgt by wso2.

the class ServiceDiscovererKubernetesTestCase method init.

/**
 *  ServiceName  Namespace   Criteria  Type          Ports  LoadBalancer  ExternalIP
 *
 *  service0     dev         app=web   ClusterIP     http       -         included
 *  service1     dev         -         ExternalName  http       -             -
 *  service2     dev         -         LoadBalancer  https      IP            -
 *  service3     prod        app=web   ClusterIP     http       -             -
 *  service4     prod        -         LoadBalancer  http     hostname        -
 */
@BeforeTest(description = "Create a list of services with all combinations included")
void init() {
    Map<String, String> oneLabel = createOneLabelHashMap();
    ServicePortBuilder httpPortBuilder = new ServicePortBuilder().withName("http").withPort(80);
    ServicePort httpPort = httpPortBuilder.build();
    ServicePort nodePort2 = new ServicePortBuilder().withName("https").withPort(443).withNodePort(30002).build();
    ServicePort nodePort4 = httpPortBuilder.withNodePort(30004).build();
    List<LoadBalancerIngress> ipIngresses = new ArrayList<>();
    LoadBalancerIngress ingressWithIP = new LoadBalancerIngressBuilder().withIp("100.1.1.2").build();
    ipIngresses.add(ingressWithIP);
    List<LoadBalancerIngress> hostnameIngresses = new ArrayList<>();
    LoadBalancerIngress ingressWithHostname = new LoadBalancerIngressBuilder().withHostname("abc.com").build();
    hostnameIngresses.add(ingressWithHostname);
    Service service0 = new ServiceBuilder().withNewMetadata().withName("service0").withNamespace("dev").withLabels(oneLabel).and().withNewSpec().withType("ClusterIP").withClusterIP("1.1.1.0").withPorts(httpPort).withExternalIPs("100.2.1.0").and().build();
    Service service1 = new ServiceBuilder().withNewMetadata().withName("service1").withNamespace("dev").and().withNewSpec().withType("ExternalName").withExternalName("aaa.com").withPorts(httpPort).and().build();
    Service service2 = new ServiceBuilder().withNewMetadata().withName("service2").withNamespace("dev").and().withNewSpec().withType("LoadBalancer").withClusterIP("1.1.1.2").withPorts(nodePort2).and().withNewStatus().withNewLoadBalancer().withIngress(ipIngresses).endLoadBalancer().and().build();
    Service service3 = new ServiceBuilder().withNewMetadata().withName("service3").withNamespace("prod").withLabels(oneLabel).and().withNewSpec().withType("ClusterIP").withClusterIP("1.1.1.3").withPorts(httpPort).and().build();
    Service service4 = new ServiceBuilder().withNewMetadata().withName("service4").withNamespace("prod").and().withNewSpec().withType("LoadBalancer").withClusterIP("1.1.1.4").withPorts(nodePort4).and().withNewStatus().withNewLoadBalancer().withIngress(hostnameIngresses).endLoadBalancer().and().build();
    List<Service> servicesList = new ArrayList<>();
    servicesList.add(service0);
    servicesList.add(service1);
    servicesList.add(service2);
    servicesList.add(service3);
    servicesList.add(service4);
    this.listOfServices = servicesList;
}
Also used : ServicePort(io.fabric8.kubernetes.api.model.ServicePort) LoadBalancerIngress(io.fabric8.kubernetes.api.model.LoadBalancerIngress) ServicePortBuilder(io.fabric8.kubernetes.api.model.ServicePortBuilder) ArrayList(java.util.ArrayList) LoadBalancerIngressBuilder(io.fabric8.kubernetes.api.model.LoadBalancerIngressBuilder) Service(io.fabric8.kubernetes.api.model.Service) ServiceBuilder(io.fabric8.kubernetes.api.model.ServiceBuilder) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

BeforeTest (org.testng.annotations.BeforeTest)142 Parameters (org.testng.annotations.Parameters)16 DatabaseConfiguration (com.google.refine.extension.database.DatabaseConfiguration)11 HashMap (java.util.HashMap)10 File (java.io.File)9 Series (com.axibase.tsd.api.model.series.Series)6 CommandManager (com.sun.identity.cli.CommandManager)6 Path (java.nio.file.Path)6 ArrayList (java.util.ArrayList)5 HashSet (java.util.HashSet)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 PinotHelixResourceManager (com.linkedin.pinot.controller.helix.core.PinotHelixResourceManager)4 Annotation (java.lang.annotation.Annotation)4 URL (java.net.URL)4 Injector (com.google.inject.Injector)3 AbstractTableConfig (com.linkedin.pinot.common.config.AbstractTableConfig)3 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)3 Map (java.util.Map)3 WorkUnitState (org.apache.gobblin.configuration.WorkUnitState)3 SSOException (com.iplanet.sso.SSOException)2