Java Code Examples for org.testng.annotations.BeforeClass

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project akubra, under directory /akubra-fs/src/test/java/org/akubraproject/fs/.

Source file: TestFSBlob.java

  19 
vote

@BeforeClass public static void init() throws Exception {
  id=new URI("urn:example:store");
  baseDir=FSTestUtil.createTempDir();
  FSBlobStore store=new FSBlobStore(id,baseDir);
  mgr=new StreamManager();
  conn=new FSBlobStoreConnection(store,baseDir,mgr,true);
}
 

Example 2

From project b3log-solo, under directory /core/src/test/java/org/b3log/solo/.

Source file: AbstractTestCase.java

  19 
vote

/** 
 * Before class. <ol> <li>Sets up GAE unit test runtime environment</li> <li>Initializes Latke runtime</li> <li>Instantiates repositories</li> </ol>
 */
@BeforeClass public void beforeClass(){
  localServiceTestHelper.setUp();
  Latkes.initRuntimeEnv();
  userRepository=UserRepositoryImpl.getInstance();
  linkRepository=LinkRepositoryImpl.getInstance();
  articleRepository=ArticleRepositoryImpl.getInstance();
  tagRepository=TagRepositoryImpl.getInstance();
  tagArticleRepository=TagArticleRepositoryImpl.getInstance();
  pageRepository=PageRepositoryImpl.getInstance();
  commentRepository=CommentRepositoryImpl.getInstance();
  archiveDateRepository=ArchiveDateRepositoryImpl.getInstance();
  archiveDateArticleRepository=ArchiveDateArticleRepositoryImpl.getInstance();
  pluginRepository=PluginRepositoryImpl.getInstance();
  preferenceRepository=PreferenceRepositoryImpl.getInstance();
  statisticRepository=StatisticRepositoryImpl.getInstance();
  initService=InitService.getInstance();
  userMgmtService=UserMgmtService.getInstance();
  userQueryService=UserQueryService.getInstance();
  articleMgmtService=ArticleMgmtService.getInstance();
  articleQueryService=ArticleQueryService.getInstance();
  pageMgmtService=PageMgmtService.getInstance();
  pageQueryService=PageQueryService.getInstance();
  linkMgmtService=LinkMgmtService.getInstance();
  linkQueryService=LinkQueryService.getInstance();
  preferenceMgmtService=PreferenceMgmtService.getInstance();
  preferenceQueryService=PreferenceQueryService.getInstance();
  tagQueryService=TagQueryService.getInstance();
  tagMgmtService=TagMgmtService.getInstance();
  commentQueryService=CommentQueryService.getInstance();
  commentMgmtService=CommentMgmtService.getInstance();
  archiveDateQueryService=ArchiveDateQueryService.getInstance();
}
 

Example 3

From project CMake-runner-plugin, under directory /cmake-runner-test/src/jetbrains/buildServer/cmakerunner/tests/agent/output/.

Source file: MakeParserTest.java

  19 
vote

@Override @BeforeClass public void setUpClass() throws Exception {
  final InputStream parserConfigStream=this.getClass().getResourceAsStream("/make-parser.xml");
  Assert.assertNotNull(parserConfigStream);
  myParser=RegexParser.deserialize(parserConfigStream);
  Assert.assertNotNull(myParser);
}
 

Example 4

From project event-collector, under directory /event-combiner/src/test/java/com/proofpoint/event/combiner/.

Source file: TestS3Combine.java

  19 
vote

@BeforeClass @Parameters({"aws-credentials-file","aws-test-bucket"}) public void setUpClass(String awsCredentialsFile,String awsTestBucket) throws Exception {
  String credentialsJson=Files.toString(new File(awsCredentialsFile),Charsets.UTF_8);
  Map<String,String> map=JsonCodec.mapJsonCodec(String.class,String.class).fromJson(credentialsJson);
  String awsAccessKey=map.get("access-id");
  String awsSecretKey=map.get("private-key");
  AWSCredentials awsCredentials=new BasicAWSCredentials(awsAccessKey,awsSecretKey);
  service=new AmazonS3Client(awsCredentials);
  testBucket=awsTestBucket;
  if (!service.doesBucketExist(testBucket)) {
    service.createBucket(testBucket);
  }
}
 

Example 5

From project eventtracker, under directory /http/src/test/java/com/ning/metrics/eventtracker/.

Source file: TestHttpSender.java

  19 
vote

@BeforeClass(alwaysRun=true) public void setUpGlobal() throws Exception {
  final int port=findFreePort();
  server=new Server(port);
  errorServer=new Server(port){
    @Override public void handle(    final AbstractHttpConnection connection) throws IOException, ServletException {
      final String target=connection.getRequest().getPathInfo();
      final Request request=connection.getRequest();
      final Response response=connection.getResponse();
      response.setStatus(404);
      handle(target,request,request,response);
    }
  }
;
  System.setProperty("eventtracker.collector.port",Integer.toString(port));
  final EventTrackerConfig config=new ConfigurationObjectFactory(System.getProperties()).build(EventTrackerConfig.class);
  sender=new HttpSender(config.getCollectorHost(),config.getCollectorPort(),config.getEventType(),config.getHttpMaxWaitTimeInMillis(),config.getHttpMaxKeepAlive().getMillis(),10);
  failureCallbackHandler=new CallbackHandler(){
    @Override public void onError(    final Throwable t,    final File event){
      logger.debug("Got error (good): " + t.getMessage());
    }
    @Override public void onSuccess(    final File event){
      Assert.fail("Got success when we were expecting failure. Uh oh.");
    }
  }
;
  successCallbackHandler=new CallbackHandler(){
    @Override public void onError(    final Throwable t,    final File event){
      Assert.fail("Got error (bad!): ",t);
    }
    @Override public void onSuccess(    final File event){
      logger.debug("Got success. Yay.");
    }
  }
;
  Assert.assertTrue(eventsFile.createNewFile());
  final FileWriter writer=new FileWriter(eventsFile);
  writer.write("{ \"eventName\":\"Hello\", \"payload\": { \"dontcare\": \"World\" } }");
  writer.close();
}
 

Example 6

From project faces, under directory /Proyectos/demoSpringRichHibernate/src/test/java/pe/joedayz/ejemplos/persistence/dao/hibernate/.

Source file: UserDaoTest.java

  19 
vote

@BeforeClass public void contextInit(){
  user.setId(null);
  user.setSex(Boolean.TRUE);
  user.setFirstName(firstName);
  user.setLastName(lastName);
  user.setEmail("[email protected]");
  user.setUserName(userName);
  user.setPassword("reiz");
  user.setEnabled(Boolean.TRUE);
  userDao.makePersistent(user);
}
 

Example 7

From project flexmojos, under directory /flexmojos-generator/flexmojos-generator-internal-threadlocal/src/test/java/net/flexmojos/oss/generator/threadlocal/test/.

Source file: ThreadLocalGeneratorTest.java

  19 
vote

@BeforeClass protected void setUp() throws Exception {
  DefaultPlexusContainer plexus=new DefaultPlexusContainer();
  this.generator=plexus.lookup(Generator.class,"thread-local");
  files=new File("./target/files");
  FileUtils.forceDelete(files);
}
 

Example 8

From project gedcom5-conversion, under directory /src/test/java/org/gedcomx/conversion/gedcom/dq55/.

Source file: FamilyMapperTest.java

  19 
vote

@BeforeClass public void setUp() throws Exception {
  URL gedcomUrl=this.getClass().getClassLoader().getResource("Case009-Family.ged");
  File gedcomFile=new File(gedcomUrl.toURI());
  ModelParser modelParser=new ModelParser();
  gedcom=modelParser.parseGedcom(gedcomFile);
  gedcom.createIndexes();
  assertNotNull(gedcom);
}
 

Example 9

From project GNDMS, under directory /dspace/test-src/de/zib/gndms/dspace/service/test/.

Source file: DSpaceServiceTest.java

  19 
vote

@BeforeClass(dependsOnGroups={"dspaceActionTests"},dependsOnMethods={"init"}) private void initContext(){
  context=new ClassPathXmlApplicationContext("classpath:META-INF/00_system.xml");
  final Properties map=new Properties();
  map.put("openjpa.Id",getDbName());
  map.put("openjpa.ConnectionURL","jdbc:derby:" + getDbPath() + ";create=true");
  final EntityManagerFactory emf=Persistence.createEntityManagerFactory(getDbName(),map);
  setEntityManagerFactory(emf);
}
 

Example 10

From project hibernate-metamodelgen, under directory /src/test/java/org/hibernate/jpamodelgen/test/separatecompilationunits/.

Source file: SeparateCompilationUnitsTest.java

  19 
vote

@Override @BeforeClass protected void compileAllTestEntities() throws Exception {
  String superClassPackageName=getPackageNameOfCurrentTest() + ".superclass";
  List<File> sourceFiles=getCompilationUnits(CompilationTest.getSourceBaseDir(),superClassPackageName);
  compile(sourceFiles);
  sourceFiles=getCompilationUnits(getSourceBaseDir(),getPackageNameOfCurrentTest());
  compile(sourceFiles);
}
 

Example 11

From project hibernate-validator, under directory /engine/src/test/java/org/hibernate/validator/test/internal/constraintvalidators/.

Source file: DigitsValidatorForStringTest.java

  19 
vote

@BeforeClass public static void init(){
  AnnotationDescriptor<Digits> descriptor=new AnnotationDescriptor<Digits>(Digits.class);
  descriptor.setValue("integer",5);
  descriptor.setValue("fraction",2);
  descriptor.setValue("message","{validator.digits}");
  Digits p=AnnotationFactory.create(descriptor);
  constraint=new DigitsValidatorForCharSequence();
  constraint.initialize(p);
}
 

Example 12

From project ios-driver, under directory /client/src/test/java/.

Source file: ClientSideCriteriaTests.java

  19 
vote

@BeforeClass public void setup() throws IOException, JSONException {
  InputStream is=ClientSideCriteriaTests.class.getResourceAsStream("/ClientSideL10N.json");
  StringWriter writer=new StringWriter();
  IOUtils.copy(is,writer,"UTF-8");
  JSONArray json=new JSONArray(writer.toString());
  Map<String,String> content=new HashMap<String,String>();
  for (int i=0; i < json.length(); i++) {
    JSONObject entry=json.getJSONObject(i);
    String key=(String)entry.keys().next();
    content.put(key,entry.getString(key));
  }
  factory=new ClientSideCriteriaFactory(content);
}
 

Example 13

From project Ivory, under directory /common/src/test/java/org/apache/ivory/cleanup/.

Source file: LogCleanupServiceTest.java

  19 
vote

@BeforeClass public void setup() throws Exception {
  conf.set("hadoop.log.dir","/tmp");
  this.dfsCluster=new MiniDFSCluster(conf,1,true,null);
  fs=dfsCluster.getFileSystem();
  storeEntity(EntityType.CLUSTER,"testCluster");
  conf=new Configuration();
  System.setProperty("test.build.data","target/tdfs/data" + System.currentTimeMillis());
  this.targetDfsCluster=new MiniDFSCluster(conf,1,true,null);
  storeEntity(EntityType.CLUSTER,"backupCluster");
  storeEntity(EntityType.FEED,"impressionFeed");
  storeEntity(EntityType.FEED,"clicksFeed");
  storeEntity(EntityType.FEED,"imp-click-join1");
  storeEntity(EntityType.FEED,"imp-click-join2");
  storeEntity(EntityType.PROCESS,"sample");
  Process process=ConfigurationStore.get().get(EntityType.PROCESS,"sample");
  Process otherProcess=(Process)process.clone();
  otherProcess.setName("sample2");
  otherProcess.setFrequency(new Frequency("days(1)"));
  ConfigurationStore.get().remove(EntityType.PROCESS,otherProcess.getName());
  ConfigurationStore.get().publish(EntityType.PROCESS,otherProcess);
}
 

Example 14

From project javamagic, under directory /cometd/src/test/java/com/googlecode/tawus/cometd/examples/.

Source file: JavaClientBasedTest.java

  19 
vote

@BeforeClass public void startupServer() throws Exception {
  server=new Server(9990);
  server.setStopAtShutdown(true);
  server.setGracefulShutdown(1000);
  WebAppContext context=new WebAppContext();
  context.setContextPath("/test");
  context.setWar("src/test/webapp");
  server.setHandler(context);
  server.start();
  logger.info("Server started");
}
 

Example 15

From project jclouds-abiquo, under directory /live/src/test/java/org/jclouds/abiquo/domain/cloud/.

Source file: VirtualMachineNetworkingLiveTest.java

  19 
vote

@BeforeClass public void setupIps(){
  privateIp=env.privateNetwork.listUnusedIps().get(0);
  assertNotNull(privateIp);
  externalIp=env.externalNetwork.listUnusedIps().get(0);
  assertNotNull(externalIp);
  publicIpInfrastructure=env.virtualDatacenter.listAvailablePublicIps().get(0);
  env.virtualDatacenter.purchasePublicIp(publicIpInfrastructure);
  publicIpCloud=env.virtualDatacenter.findPurchasedPublicIp(IpPredicates.<PublicIp>address(publicIpInfrastructure.getIp()));
  assertNotNull(publicIpCloud);
}
 

Example 16

From project jclouds-chef, under directory /core/src/test/java/org/jclouds/chef/filters/.

Source file: SignedHeaderAuthTest.java

  19 
vote

/** 
 * before class, as we need to ensure that the filter is threadsafe.
 * @throws IOException
 */
@BeforeClass protected void createFilter() throws IOException {
  Injector injector=ContextBuilder.newBuilder(new ChefApiMetadata()).credentials(USER_ID,PRIVATE_KEY).modules(ImmutableSet.<Module>of(new MockModule(),new NullLoggingModule())).buildInjector();
  crypto=injector.getInstance(Crypto.class);
  HttpUtils utils=injector.getInstance(HttpUtils.class);
  PrivateKey privateKey=injector.getInstance(PrivateKey.class);
  signing_obj=new SignedHeaderAuth(new SignatureWire(),USER_ID,privateKey,new Provider<String>(){
    @Override public String get(){
      return TIMESTAMP_ISO8601;
    }
  }
,crypto,utils);
}
 

Example 17

From project jDcHub, under directory /jdchub-modules/WebManagementConsole/src/main/test/jdchub/module/.

Source file: ModuleMainTest.java

  19 
vote

@BeforeClass public void setUp() throws Exception {
  URLClassLoader classLoader=(URLClassLoader)ClassLoader.getSystemClassLoader();
  Class clazz=URLClassLoader.class;
  Method method=clazz.getDeclaredMethod("addURL",new Class[]{URL.class});
  method.setAccessible(true);
  method.invoke(classLoader,new Object[]{new File(ConfigurationManager.getInstance().getHubConfigDir()).toURI().toURL()});
  moduleMain=new ModuleMain();
}
 

Example 18

From project JPA-NestedSet, under directory /src/test/java/org/code_factory/jpa/nestedset/.

Source file: FunctionalNestedSetTest.java

  19 
vote

@BeforeClass(alwaysRun=true) protected void createEntityManagerFactory(){
  try {
    emFactory=Persistence.createEntityManagerFactory("TestPU");
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}
 

Example 19

From project jSCSI, under directory /bundles/target/src/test/java/org/jscsi/target/scsi/.

Source file: ScsiResponseDataSegmentTest.java

  19 
vote

@BeforeClass public void beforeClass(){
  final ProtocolDataUnit pdu=new ProtocolDataUnitFactory().create(false,true,OperationCode.LOGIN_REQUEST,"None","None");
  final SCSICommandParser parser=new SCSICommandParser(pdu);
  parser.setExpectedDataTransferLength(8);
  final RequestSenseCdb cdb=new RequestSenseCdb(parser.getCDB());
  SenseData senseData;
  if (cdb.getDescriptorFormat()) {
    senseData=new DescriptorFormatSenseData(ErrorType.CURRENT,SenseKey.ILLEGAL_REQUEST,AdditionalSenseCodeAndQualifier.INVALID_FIELD_IN_CDB,new SenseDataDescriptor[0]);
  }
 else {
    senseData=new FixedFormatSenseData(false,ErrorType.CURRENT,false,false,false,SenseKey.ILLEGAL_REQUEST,new FourByteInformation(),new FourByteInformation(),AdditionalSenseCodeAndQualifier.INVALID_FIELD_IN_CDB,(byte)0,new FieldPointerSenseKeySpecificData(true,true,true,3,8),new AdditionalSenseBytes());
  }
  nonEmpty=new ScsiResponseDataSegment(senseData,parser.getExpectedDataTransferLength());
}
 

Example 20

From project json-schema-validator, under directory /src/test/java/org/eel/kitchen/jsonschema/other/.

Source file: JarNamespaceValidationTest.java

  19 
vote

@BeforeClass public void buildJar() throws IOException, URISyntaxException {
  rootURI=getClass().getResource("/").toURI();
  jarLocation=doBuildJar();
  data=JsonLoader.fromResource("/grimbo/test-object.json");
  final String tmp=jarLocation.toURI().toString() + "!/grimbo/";
  namespace=new URI("jar",tmp,null).toString();
}
 

Example 21

From project lightweightEE, under directory /backend/src/test/java/de/jaxenter/eesummit/caroline/backend/test/.

Source file: CdiContainerTest.java

  19 
vote

@BeforeClass public final void beforeClass() throws Exception {
  setUp();
  cdiContainer.getContextControl().stopContext(RequestScoped.class);
  cdiContainer.getContextControl().startContext(RequestScoped.class);
  BeanManager beanManager=cdiContainer.getBeanManager();
  CreationalContext creationalContext=beanManager.createCreationalContext(null);
  AnnotatedType annotatedType=beanManager.createAnnotatedType(this.getClass());
  InjectionTarget injectionTarget=beanManager.createInjectionTarget(annotatedType);
  injectionTarget.inject(this,creationalContext);
}
 

Example 22

From project lime-mvc, under directory /test/org/zdevra/guice/mvc/.

Source file: WebTest.java

  19 
vote

@BeforeClass public void setup() throws Exception {
  setupWebserver();
  client=new HttpClient();
  System.setProperty("java.naming.factory.url.pkgs","org.mortbay.naming");
  System.setProperty("java.naming.factory.initial","org.mortbay.naming.InitialContextFactory");
  server=new Server(port);
  WebAppContext contexts[]=new WebAppContext[webapps.size()];
  for (int i=0; i < webapps.size(); ++i) {
    Webapp app=webapps.get(i);
    WebAppContext context=new WebAppContext();
    context.setContextPath(app.contextPath);
    context.setResourceBase(app.webappPath);
    context.setDescriptor(app.webappPath + "/WEB-INF/web.xml");
    context.setParentLoaderPriority(true);
    contexts[i]=context;
  }
  server.setHandlers(contexts);
  server.start();
}
 

Example 23

From project memcached-session-manager, under directory /javolution-serializer/src/test/java/de/javakaffee/web/msm/serializer/javolution/.

Source file: JavolutionTranscoderTest.java

  19 
vote

@BeforeClass public void beforeTest(){
  _manager=new MemcachedBackupSessionManager();
  final StandardContext container=new StandardContext();
  _manager.setContainer(container);
  final WebappLoader webappLoader=mock(WebappLoader.class);
  when(webappLoader.getClassLoader()).thenReturn(Thread.currentThread().getContextClassLoader());
  Assert.assertNotNull(webappLoader.getClassLoader(),"Webapp Classloader is null.");
  _manager.getContainer().setLoader(webappLoader);
  Assert.assertNotNull(_manager.getContainer().getLoader().getClassLoader(),"Classloader is null.");
  _transcoder=new JavolutionTranscoder(_manager,true);
}
 

Example 24

From project modelmapper, under directory /core/src/test/java/org/modelmapper/internal/.

Source file: TypeInfoImplTest.java

  19 
vote

@BeforeClass public void setupClass(){
  InheritingConfiguration config=new InheritingConfiguration();
  config.enableFieldMatching(true);
  config.setFieldAccessLevel(AccessLevel.PACKAGE_PRIVATE);
  config.setMethodAccessLevel(AccessLevel.PACKAGE_PRIVATE);
  personInfo=TypeInfoRegistry.typeInfoFor(Person.class,config);
}
 

Example 25

From project mongo-java-driver, under directory /src/test/com/mongodb/.

Source file: DBTCPConnectorTest.java

  19 
vote

@BeforeClass public void beforeClass() throws UnknownHostException {
  cleanupMongo=new Mongo(Arrays.asList(new ServerAddress("127.0.0.1"),new ServerAddress("127.0.0.1:27018")));
  cleanupDB="com_mongodb_unittest_DBTCPConnectorTest";
  _db=cleanupMongo.getDB(cleanupDB);
  _collection=_db.getCollection("testCol");
}
 

Example 26

From project monitor-event-tap, under directory /src/test/java/com/proofpoint/event/monitor/.

Source file: TestAmazonEmailAlerter.java

  19 
vote

@BeforeClass(groups="aws") @Parameters("aws-credentials-file") public void setUp(String awsCredentialsFile) throws Exception {
  Properties properties=new Properties();
  properties.load(new FileInputStream(awsCredentialsFile));
  String awsAccessKey=properties.getProperty("aws.access-key");
  String awsSecretKey=properties.getProperty("aws.secret-key");
  AWSCredentials awsCredentials=new BasicAWSCredentials(awsAccessKey,awsSecretKey);
  AmazonSimpleEmailService service=new AmazonSimpleEmailServiceClient(awsCredentials);
  alerter=new AmazonEmailAlerter(new AmazonConfig().setFromAddress("[email protected]").setToAddress("[email protected]"),service);
}
 

Example 27

From project nexus-p2-repository-plugin, under directory /src/test/java/org/sonatype/nexus/plugins/p2/repository/its/.

Source file: AbstractNexusProxyP2SecureIT.java

  19 
vote

@BeforeClass(alwaysRun=true) public void startProxy() throws Exception {
  if (proxyServer == null) {
    proxyServer=(ServletServer)this.lookup(ServletServer.ROLE,"secure");
    proxyServer.start();
  }
}
 

Example 28

From project overthere, under directory /src/test/java/com/xebialabs/overthere/.

Source file: OverthereConnectionItestBase.java

  19 
vote

@BeforeClass public void setupHost() throws Exception {
  doInitHost();
  host=CloudHostHolder.getHost(hostname);
  temp.create();
  setTypeAndOptions();
  connection=Overthere.getConnection(protocol,options);
}
 

Example 29

From project parasim, under directory /model/ode/src/test/java/org/sybila/parasim/model/ode/.

Source file: TestOctaveOdeSystem.java

  19 
vote

@BeforeClass public void prepareSystem(){
  List<Variable> variables=new ArrayList<>();
  final List<OdeSystemVariable> odeSystemVariables=new ArrayList<>();
  for (int i=0; i < 2; i++) {
    variables.add(new Variable("y" + i,i));
  }
  odeSystemVariables.add(new OdeSystemVariable(variables.get(0),new Plus(new Times(new Constant(10.1f),variables.get(0)),new Times(new Constant(-1.0f),variables.get(0),variables.get(1)))));
  odeSystemVariables.add(new OdeSystemVariable(variables.get(1),new Plus(new Times(new Constant(1.0f),variables.get(0),variables.get(1)),new Times(new Constant(-5.4f),variables.get(1)))));
  system=new OctaveOdeSystem(new SimpleOdeSystem(odeSystemVariables,Collections.EMPTY_LIST,Collections.EMPTY_LIST));
}
 

Example 30

From project pegdown, under directory /src/test/java/org/pegdown/.

Source file: AbstractTest.java

  19 
vote

@BeforeClass public void setup(){
  tidy.setTabsize(4);
  tidy.setPrintBodyOnly(true);
  tidy.setShowWarnings(false);
  tidy.setQuiet(true);
}
 

Example 31

From project Please, under directory /modules/acceptance-tests/src/test/java/com/atoito/please/uat/.

Source file: BaseUat.java

  19 
vote

@BeforeClass public void setUp() throws Exception {
  File cc=ClasspathUtil.getClasspathForClass(BasicFunctionalitySmokeUat.class);
  File modules=cc.getParentFile().getParentFile().getParentFile().getParentFile();
  String installPath=Joiner.on(File.separatorChar).join(modules.getAbsolutePath(),"cli","target","install","please");
  installedHome=new File(installPath);
  testDataPath=Joiner.on(File.separatorChar).join(modules.getAbsolutePath(),"acceptance-tests","src","test","data");
  Environment.refreshWithHome(installedHome);
  Environment environment=Environment.getCurrent();
  String installOpsDirPath=environment.distributionOpsFileDirPath();
  File installOpsDir=new File(installOpsDirPath);
  Directories.ensureExists(installOpsDir);
  String uatOpsDirectoryPath=Joiner.on(File.separatorChar).join(modules.getAbsolutePath(),"acceptance-tests","src","test","ops");
  File uatOpsDirectory=new File(uatOpsDirectoryPath);
  File[] uatOps=uatOpsDirectory.listFiles();
  for (int i=0; i < uatOps.length; i++) {
    copyOpsFile(uatOps[i],installOpsDir);
  }
}
 

Example 32

From project roboguice, under directory /roboguice/src/test/java/roboguice/event/.

Source file: EventManagerTest.java

  19 
vote

@BeforeClass(groups="roboguice") public void setup() throws NoSuchMethodException {
  eventManager=new EventManager();
  context=EasyMock.createMock(Context.class);
  tester=new ContextObserverTesterImpl();
  eventOneMethods=ContextObserverTesterImpl.getMethods(EventOne.class);
  eventTwoMethods=ContextObserverTesterImpl.getMethods(EventTwo.class);
  methods=new ArrayList<Method>();
  methods.addAll(eventOneMethods);
  methods.addAll(eventTwoMethods);
  event=new EventOne();
}
 

Example 33

From project samples_3, under directory /testing/testing-testng/src/test/java/com/example/.

Source file: LocaleUtilsOldStyleTest.java

  19 
vote

@BeforeClass private void setUp(){
  parseLocaleData.put(null,null);
  parseLocaleData.put("",LocaleUtils.ROOT_LOCALE);
  parseLocaleData.put("en",Locale.ENGLISH);
  parseLocaleData.put("en_US",Locale.US);
  parseLocaleData.put("en_GB",Locale.UK);
  parseLocaleData.put("ru",new Locale("ru"));
  parseLocaleData.put("ru_RU_xxx",new Locale("ru","RU","xxx"));
}
 

Example 34

From project serengeti-ws, under directory /server/serengeti/src/test/java/com/vmware/bdd/manager/.

Source file: TestClusterManager.java

  19 
vote

@BeforeClass public static void setup(){
  deleteAllResources();
  VcProviderManager vcProvider=(VcProviderManager)clusterManager.getCloudProviderMgr();
  vcProvider.getRpMgr().addResourcePool(RP_NAME,"Cluster1","rp1");
  List<String> sharedStores=new ArrayList<String>();
  sharedStores.add("share1");
  sharedStores.add("share2");
  vcProvider.getDatastoreMgr().addDataStores(SHARED_DATASTORE_NAME,DatastoreType.SHARED,sharedStores);
  List<String> localStores=new ArrayList<String>();
  localStores.add("local1");
  localStores.add("vmfs*");
  vcProvider.getDatastoreMgr().addDataStores(LOCAL_DATASTORE_NAME,DatastoreType.LOCAL,localStores);
  DAL.inTransactionDo(new Saveable<Void>(){
    @Override public Void body() throws Exception {
      clusterManager.getNetworkManager().addDhcpNetwork(NETWORK_NAME,PORT_GROUP_NAME);
      return null;
    }
  }
);
}
 

Example 35

From project servo, under directory /servo-core/src/test/java/com/netflix/servo/tag/.

Source file: SortedTagListTest.java

  19 
vote

@BeforeClass public void setup() throws Exception {
  tagArray[0]=a;
  tagArray[1]=b;
  tagArray[2]=c;
  testListFromStrings=new SortedTagList.Builder().withTag("a","a").withTag("b","b").withTag("c","c").build();
  collection=new ArrayList<Tag>();
  collection.add(a);
  collection.add(c);
  collection.add(b);
  testListFromCollection=new SortedTagList.Builder().withTags(collection).build();
  testListFromTags=new SortedTagList.Builder().withTag(c).withTag(a).withTag(b).build();
}
 

Example 36

From project spring-security, under directory /itest/web/src/integration-test/java/org/springframework/security/integration/.

Source file: AbstractWebServerIntegrationTests.java

  19 
vote

@BeforeClass public void startServer() throws Exception {
synchronized (SERVER_LOCK) {
    if (server == null) {
      server=new Server(0);
      server.addHandler(createWebContext());
      server.start();
    }
  }
}
 

Example 37

From project supose, under directory /supose-core/src/test/java/com/soebes/supose/core/lucene/.

Source file: LuceneTest.java

  19 
vote

@BeforeClass public void beforeClass() throws CorruptIndexException, LockObtainFailedException, IOException {
  Analyzer analyzer=AnalyzerFactory.createInstance();
  IndexWriter iwriter=new IndexWriter(directory,analyzer,true,IndexWriter.MaxFieldLength.UNLIMITED);
  iwriter.setMaxFieldLength(25000);
  Document doc=new Document();
  String text="This is the text to be indexed.";
  addUnTokenizedField(doc,FieldNames.REVISION.getValue(),NumberUtils.pad(1));
  addTokenizedField(doc,FieldNames.CONTENTS.getValue(),text);
  addUnTokenizedField(doc,FieldNames.FILENAME.getValue(),"/trunk/doc/testXML.doc");
  iwriter.addDocument(doc);
  doc=new Document();
  text="This is different text.";
  addUnTokenizedField(doc,FieldNames.REVISION.getValue(),NumberUtils.pad(2));
  addTokenizedField(doc,FieldNames.CONTENTS.getValue(),text);
  addUnTokenizedField(doc,FieldNames.FILENAME.getValue(),"/tags/docs/XYZabc.java");
  iwriter.addDocument(doc);
  doc=new Document();
  text="This is more different text.";
  addUnTokenizedField(doc,FieldNames.REVISION.getValue(),NumberUtils.pad(3));
  addTokenizedField(doc,FieldNames.CONTENTS.getValue(),text);
  addUnTokenizedField(doc,FieldNames.FILENAME.getValue(),"/tags/docs/SCMPlan.doc");
  iwriter.addDocument(doc);
  doc=new Document();
  text="This is the third text.";
  addUnTokenizedField(doc,FieldNames.REVISION.getValue(),NumberUtils.pad(4));
  addTokenizedField(doc,FieldNames.CONTENTS.getValue(),text);
  addUnTokenizedField(doc,FieldNames.FILENAME.getValue(),"/trunk/subdir/elviraXML.doc");
  iwriter.addDocument(doc);
  iwriter.optimize();
  iwriter.close();
  isearcher=new IndexSearcher(directory);
}
 

Example 38

From project tapx, under directory /tapx-templating/src/test/java/com/howardlewisship/tapx/templating/base/.

Source file: AbstractTemplatingIntegrationTest.java

  19 
vote

@BeforeClass public void setup_template_API(){
  templateAPI=new TemplateAPI(packageName,new File(contextDir));
  Registry registry=templateAPI.getRegistry();
  SymbolSource source=registry.getService(SymbolSource.class);
  tapestryVersion=source.valueForSymbol(SymbolConstants.TAPESTRY_VERSION);
}
 

Example 39

From project teamcity-artifactory-plugin, under directory /agent/src/test/java/org/jfrog/teamcity/agent/gradle/.

Source file: GradleBuildInfoAgentListenerTest.java

  19 
vote

@BeforeClass public void setUp() throws Exception {
  EventDispatcher eventDispatcher=EasyMock.createMock(EventDispatcher.class);
  eventDispatcher.addListener(EasyMock.isA(GradleBuildInfoAgentListener.class));
  EasyMock.expectLastCall();
  holder=EasyMock.createMock(ExtensionHolder.class);
  EasyMock.replay(eventDispatcher,holder);
  listener=new GradleBuildInfoAgentListener(eventDispatcher,holder);
  EasyMock.verify(eventDispatcher,holder);
}
 

Example 40

From project testlink-java-api, under directory /src/test/java/br/eti/kinoshita/testlinkjavaapi/.

Source file: BaseTest.java

  19 
vote

/** 
 * Set up method that creates the instance of the TestLink API.
 */
@BeforeClass protected void setUp() throws Exception {
  this.server=new HttpTestServer();
  this.loadXMLRPCMockData("tl.checkDevKey.xml");
  this.server.start();
  this.api=new TestLinkAPI(new URL("http://localhost:" + this.server.getPort() + "/testlink/lib/api/xmlrpc.php"),"devKey");
}
 

Example 41

From project usergrid-stack, under directory /core/src/test/java/org/usergrid/persistence/.

Source file: AbstractPersistenceTest.java

  19 
vote

@BeforeClass public static void setup() throws Exception {
  logger.info("setup");
  assertNull(helper);
  helper=new PersistenceTestHelperImpl();
  helper.setup();
}
 

Example 42

From project wooki, under directory /src/test/java/com/wooki/test/unit/.

Source file: AbstractWookiUnitTestSuite.java

  19 
vote

@BeforeClass public void setup(){
  pageTester=new WookiPageTester("com.wooki","wooki","src/main/webapp",WookiModule.class,com.wooki.installer.services.InstallerModule.class,InstallerModule.class,UnitTestModule.class,AppModule.class);
  registry=pageTester.getRegistry();
  context=registry.getService(ApplicationContext.class);
  MigrationManager manager=pageTester.getService(MigrationManager.class);
  manager.initialize();
  manager.reset();
  manager.migrate();
}
 

Example 43

From project zanata, under directory /zanata-war/src/test/java/org/zanata/webtrans/shared/validation/action/.

Source file: PrintfXSIExtensionValidationTest.java

  19 
vote

@BeforeClass public void mockMessages(){
  mockMessages=createMock(ValidationMessages.class);
  capturedVarsAdded=new Capture<List<String>>();
  capturedVarsMissing=new Capture<List<String>>();
  captureOutOfRangeVar=new Capture<String>();
  captureVars=new Capture<Collection<String>>();
  expect(mockMessages.varsAdded(capture(capturedVarsAdded))).andReturn(MOCK_VARIABLES_ADDED_MESSAGE).anyTimes();
  expect(mockMessages.varsMissing(capture(capturedVarsMissing))).andReturn(MOCK_VARIABLES_MISSING_MESSAGE).anyTimes();
  expect(mockMessages.mixVarFormats()).andReturn(MIX_VAR_FORMAT_MESSAGE).anyTimes();
  expect(mockMessages.varPositionOutOfRange(capture(captureOutOfRangeVar))).andReturn(VAR_IS_OUT_OF_RANGE).anyTimes();
  expect(mockMessages.varPositionDuplicated(capture(captureVars))).andReturn(VARIABLES_HAS_SAME_POSITION).anyTimes();
  expect(mockMessages.positionalPrintfVariablesValidatorName()).andReturn(MOCK_VARIABLES_VALIDATOR_NAME).anyTimes();
  expect(mockMessages.positionalPrintfVariablesValidatorDescription()).andReturn(MOCK_VARIABLES_VALIDATOR_DESCRIPTION).anyTimes();
  replay(mockMessages);
}