Java Code Examples for org.junit.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 aether-core, under directory /aether-util/src/test/java/org/eclipse/aether/util/.
Source file: ChecksumUtilTest.java

@BeforeClass public static void beforeClass() throws IOException { emptyFileChecksums.put("MD5","d41d8cd98f00b204e9800998ecf8427e"); emptyFileChecksums.put("SHA-1","da39a3ee5e6b4b0d3255bfef95601890afd80709"); patternFileChecksums.put("MD5","14f01d6c7de7d4cf0a4887baa3528b5a"); patternFileChecksums.put("SHA-1","feeeda19f626f9b0ef6cbf5948c1ec9531694295"); textFileChecksums.put("MD5","12582d1a662cefe3385f2113998e43ed"); textFileChecksums.put("SHA-1","a8ae272db549850eef2ff54376f8cac2770745ee"); }
Example 2
From project android-rindirect, under directory /rindirect/src/test/java/de/akquinet/android/rindirect/.
Source file: RindirectTest.java

@BeforeClass public static void configure() throws FileNotFoundException, IOException { File template=new File("src/main/resources/templates/R.vm"); File out=new File("target/test-classes/templates"); out.mkdirs(); out=new File("target/test-classes/templates/R.vm"); copyInputStream(new FileInputStream(template),new FileOutputStream(out)); }
Example 3
From project archaius, under directory /archaius-aws/src/test/java/com/netflix/config/sources/.
Source file: DynamoBackedConfigurationTest.java

@BeforeClass public static void setUpClass() throws Exception { try { dbClient=new AmazonDynamoDBClient(new DefaultAWSCredentialsProviderChain().getCredentials()); } catch ( Exception e) { e.printStackTrace(); } System.setProperty("com.netflix.config.dynamo.tableName",tableName); if (dbClient != null) { createTable(dbClient,tableName); addElements(dbClient,tableName); } }
Example 4
From project Aardvark, under directory /aardvark-core/src/test/java/gw/vark/.
Source file: TestprojectTest.java

@BeforeClass public static void initGosu() throws Exception { File home=TestUtil.getHome(TestprojectTest.class); _varkFile=new File(home,"testproject/" + Aardvark.DEFAULT_BUILD_FILE_NAME); List<File> cp=new ArrayList<File>(); URL surefireBooterManifest=findSurefireBooterManifest(); if (surefireBooterManifest != null) { cp.addAll(yankClasspathFromSurefireBooter(surefireBooterManifest)); } cp.add(new File(home,"testproject/support")); Gosu.init(cp); Aardvark.pushAntlibTypeloader(); }
Example 5
From project addis, under directory /application/src/integration-test/java/org/drugis/addis/util/JSMAAintegration/.
Source file: NetworkBenefitRiskIT.java

@BeforeClass public static void setUp() throws IOException, InterruptedException { System.out.println("BeforeClass -- Running models"); d_domainManager=new DomainManager(); d_domainManager.loadXMLDomain(NetworkBenefitRiskIT.class.getResourceAsStream("network-br.addis"),1); final Domain domain=d_domainManager.getDomain(); d_br=(MetaBenefitRiskAnalysis)domain.getBenefitRiskAnalyses().get(0); d_brpm=new MetaBenefitRiskPresentation(d_br,null); for ( final AddisMCMCPresentation model : d_brpm.getWrappedModels()) { System.out.println("Running " + model); model.getModel().setSimulationIterations(100000); model.getModel().setExtendSimulation(ExtendSimulation.FINISH); TaskUtil.run(model.getModel().getActivityTask()); } SMAAPresentation<TreatmentDefinition,MetaBenefitRiskAnalysis> smaapm=d_brpm.getSMAAPresentation(); d_model=smaapm.getSMAAFactory().createSMAAModel(); }
Example 6
From project AdServing, under directory /modules/services/tracking/src/test/java/net/mad/ads/services/tracking/impl/local/h2/.
Source file: H2TrackingServiceTest.java

@BeforeClass public static void init(){ JdbcDataSource ds=new JdbcDataSource(); ds.setURL("jdbc:h2:mem:test"); ds.setUser("sa"); ds.setPassword("sa"); BaseContext context=new BaseContext(); context.put(TrackingContextKeys.EMBEDDED_TRACKING_DATASOURCE,ds); ts=new H2TrackingService(); try { ts.open(context); } catch ( ServiceException e) { e.printStackTrace(); } }
Example 7
@BeforeClass public static void setUpOnce(){ server=newAGServer(); try { cat=server.getCatalog(CATALOG_ID); repoId="javatest"; cat.deleteRepository(repoId); ping(); } catch ( Exception e) { throw new RuntimeException("server url: " + server.getServerURL(),e); } }
Example 8
From project almira-sample, under directory /almira-sample-webapp/src/test/java/almira/sample/web/.
Source file: WicketAdminPageTest.java

@BeforeClass public static void setUpContext(){ putBeanOnce("catapultIndexService",new IndexAdministration(){ @Override public void rebuildIndex() throws InterruptedException { LOG.fine("Rebuilding index."); } } ); }
Example 9
From project amber, under directory /oauth-2.0/integration-tests/src/test/java/org/apache/amber/oauth2/integration/.
Source file: ClientServerOAuthTest.java

@BeforeClass public static void initService() throws Exception { JAXRSServerFactoryBean sf=(JAXRSServerFactoryBean)ctx.getBean("oauthServer"); s=sf.create(); JAXRSServerFactoryBean sf2=(JAXRSServerFactoryBean)ctx.getBean("oauthClient"); s2=sf2.create(); }
Example 10
From project arquillian-container-osgi, under directory /container-embedded/src/test/java/org/jboss/test/arquillian/container/osgi/.
Source file: ARQ271BeforeClassTestCase.java

@BeforeClass public static void beforeClass() throws Exception { assertNotNull("BundleContext injected",context); assertEquals("System Bundle ID",0,context.getBundle().getBundleId()); assertNotNull("Bundle injected",bundle); assertEquals(Bundle.RESOLVED,bundle.getState()); }
Example 11
From project arquillian-core, under directory /container/spi/src/test/java/org/jboss/arquillian/container/spi/client/protocol/metadata/.
Source file: ServletTest.java

@BeforeClass public static void before(){ servlet=new Servlet(TEST_SERVLET_NAME,TEST_CONTEXT_ROOT); servletWithParent=new Servlet(TEST_SERVLET_NAME,TEST_CONTEXT_ROOT); servletWithParent.setParent(TEST_HTTP_CONTEXT); rootContextServletWithParent=new Servlet(TEST_SERVLET_NAME,Servlet.ROOT_CONTEXT); rootContextServletWithParent.setParent(TEST_HTTP_CONTEXT); }
Example 12
From project astyanax, under directory /src/test/java/com/netflix/astyanax/recipes/.
Source file: ReverseIndexQueryTest.java

@BeforeClass public static void setup() throws Exception { clusterContext=new AstyanaxContext.Builder().forCluster(TEST_CLUSTER_NAME).withAstyanaxConfiguration(new AstyanaxConfigurationImpl().setDiscoveryType(NodeDiscoveryType.NONE)).withConnectionPoolConfiguration(new ConnectionPoolConfigurationImpl(TEST_CLUSTER_NAME).setMaxConnsPerHost(1).setSeeds(SEEDS)).withConnectionPoolMonitor(new CountingConnectionPoolMonitor()).buildCluster(ThriftFamilyFactory.getInstance()); clusterContext.start(); if (TEST_INIT_KEYSPACE) { Cluster cluster=clusterContext.getEntity(); try { LOG.info("Dropping keyspace: " + TEST_KEYSPACE_NAME); cluster.dropKeyspace(TEST_KEYSPACE_NAME); Thread.sleep(10000); } catch ( ConnectionException e) { LOG.warn(e.getMessage()); } Map<String,String> stratOptions=new HashMap<String,String>(); stratOptions.put("replication_factor","3"); try { LOG.info("Creating keyspace: " + TEST_KEYSPACE_NAME); KeyspaceDefinition ksDef=cluster.makeKeyspaceDefinition(); ksDef.setName(TEST_KEYSPACE_NAME).setStrategyOptions(stratOptions).setStrategyClass("SimpleStrategy").addColumnFamily(cluster.makeColumnFamilyDefinition().setName(CF_DATA.getName()).setComparatorType("UTF8Type")).addColumnFamily(cluster.makeColumnFamilyDefinition().setName(CF_INDEX.getName()).setComparatorType("CompositeType(LongType, LongType)").setDefaultValidationClass("BytesType")); cluster.addKeyspace(ksDef); Thread.sleep(2000); populateKeyspace(); } catch ( ConnectionException e) { LOG.error(e.getMessage()); } } }
Example 13
From project avro, under directory /lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/test/java/integration/.
Source file: SimpleOrderServiceIntegrationTest.java

@BeforeClass public static void setupTransport() throws Exception { InetSocketAddress endpointAddress=new InetSocketAddress("0.0.0.0",12345); service=new SimpleOrderServiceEndpoint(endpointAddress); client=new SimpleOrderServiceClient(endpointAddress); service.start(); client.start(); }
Example 14
From project avro-utils, under directory /src/test/java/com/tomslabs/grid/avro/.
Source file: HadoopTestBase.java

@BeforeClass public static void beforeClass() throws Exception { System.setProperty("hadoop.tmp.dir",new File("target/hadoop-test").getAbsolutePath()); System.setProperty("test.build.data",new File("target/hadoop-test").getAbsolutePath()); localConf=new Configuration(); localConf.set("fs.default.name","file://" + new File("target/hadoop-test/dfs").getAbsolutePath()); localFs=FileSystem.getLocal(localConf); localConf.set("hadoop.log.dir",new Path("target/hadoop-test/logs").makeQualified(localFs).toString()); localConf.set("mapred.system.dir",new Path("target/hadoop-test/mapred/sys").makeQualified(localFs).toString()); localConf.set("mapred.local.dir",new File("target/hadoop-test/mapred/local").getAbsolutePath()); localConf.set("mapred.temp.dir",new File("target/hadoop-test/mapred/tmp").getAbsolutePath()); System.setProperty("hadoop.log.dir",localConf.get("hadoop.log.dir")); }
Example 15
From project aws-tasks, under directory /src/it/java/datameer/awstasks/aws/.
Source file: AbstractAwsIntegrationTest.java

@BeforeClass public static void readEc2Properties() throws IOException { _ec2Conf=new Ec2Configuration(); if (!_ec2Conf.isEc2Configured()) { fail("can't run integration test without a properly configured src/it/resources/ec2.properties"); } }
Example 16
From project azkaban, under directory /azkaban/src/unit/azkaban/flow/.
Source file: IndividualJobExecutableFlowTest.java

@BeforeClass public static void init() throws Exception { theException=new RuntimeException(); theExceptions=new HashMap<String,Throwable>(); theExceptions.put("blah",theException); emptyExceptions=new HashMap<String,Throwable>(); }
Example 17
From project big-data-plugin, under directory /shims/api/test-src/org/pentaho/hadoop/shim/.
Source file: HadoopConfigurationLocatorTest.java

@BeforeClass public static void setup() throws Exception { FileObject ramRoot=VFS.getManager().resolveFile(HADOOP_CONFIGURATIONS_PATH); FileObject aConfigFolder=ramRoot.resolveFile("a"); if (aConfigFolder.exists()) { aConfigFolder.delete(new AllFileSelector()); } aConfigFolder.createFolder(); assertEquals(FileType.FOLDER,aConfigFolder.getType()); FileObject configFile=aConfigFolder.resolveFile("config.properties"); Properties p=new Properties(); p.setProperty("name","Test Configuration A"); p.setProperty("classpath",""); p.setProperty("library.path",""); p.store(configFile.getContent().getOutputStream(),"Test Configuration A"); FileObject implJar=aConfigFolder.resolveFile("a-config.jar"); implJar.createFile(); JavaArchive archive=ShrinkWrap.create(JavaArchive.class,"a-configuration.jar").addAsServiceProvider(HadoopShim.class,MockHadoopShim.class).addClass(MockHadoopShim.class); archive.as(ZipExporter.class).exportTo(implJar.getContent().getOutputStream()); }
Example 18
@BeforeClass public static void initDetailedJerseyLoggingIntoFile() throws Exception { String tmpFileDirectory=System.getProperty("java.io.tmpdir"); File logFile=new File(tmpFileDirectory,"my-jersey-test.log"); Logger.getLogger("").addHandler(new FileHandler(logFile.getPath())); Logger.getLogger("com.sun.jersey").setLevel(Level.FINEST); System.out.println(AbstractJerseyTest.class.getSimpleName() + ": Jersey logs in " + logFile); }
Example 19
From project bonecp, under directory /bonecp/src/test/java/com/jolbox/bonecp/hooks/.
Source file: TestConnectionHook.java

/** * Setups all mocks. * @throws SQLException * @throws ClassNotFoundException */ @BeforeClass public static void setup() throws SQLException, ClassNotFoundException { ConnectionState.valueOf(ConnectionState.NOP.toString()); driver=new MockJDBCDriver(new MockJDBCAnswer(){ public Connection answer() throws SQLException { return new MockConnection(); } } ); hookClass=new CustomHook(); Class.forName("com.jolbox.bonecp.MockJDBCDriver"); mockConfig=createNiceMock(BoneCPConfig.class); expect(mockConfig.getPartitionCount()).andReturn(1).anyTimes(); expect(mockConfig.getMaxConnectionsPerPartition()).andReturn(5).anyTimes(); expect(mockConfig.getAcquireIncrement()).andReturn(0).anyTimes(); expect(mockConfig.getMinConnectionsPerPartition()).andReturn(5).anyTimes(); expect(mockConfig.getIdleConnectionTestPeriodInMinutes()).andReturn(10000L).anyTimes(); expect(mockConfig.getUsername()).andReturn(CommonTestUtils.username).anyTimes(); expect(mockConfig.getPassword()).andReturn(CommonTestUtils.password).anyTimes(); expect(mockConfig.getJdbcUrl()).andReturn("jdbc:mock").anyTimes(); expect(mockConfig.getReleaseHelperThreads()).andReturn(0).anyTimes(); expect(mockConfig.isDisableConnectionTracking()).andReturn(true).anyTimes(); expect(mockConfig.getConnectionHook()).andReturn(hookClass).anyTimes(); replay(mockConfig); poolClass=new BoneCP(mockConfig); }
Example 20
From project book, under directory /src/test/java/com/tamingtext/classifier/bayes/.
Source file: ExtractTrainingDataTest.java

@BeforeClass public static void beforeClass() throws Exception { baseDir=new File("target/test-output/extract-test"); baseDir.delete(); baseDir.mkdirs(); initCore("bayes-update-config.xml","bayes-update-schema.xml"); }
Example 21
From project bpelunit, under directory /net.bpelunit.framework/src/test/java/net/bpelunit/test/unit/.
Source file: SimpleTest.java

@BeforeClass public static void setUp() throws ConfigurationException { try { BPELUnitUtil.initializeParsing(); } catch ( ParserConfigurationException e) { throw new ConfigurationException("Could not initialize XML Parser Component.",e); } }
Example 22
From project camel-mongodb, under directory /src/test/java/org/apache/camel/component/mongodb/.
Source file: AbstractMongoDbTest.java

/** * Checks whether Mongo is running using the connection URI defined in the mongodb.test.properties file * @throws IOException */ @BeforeClass public static void checkMongoRunning() throws IOException { properties=new Properties(); InputStream is=MongoDbConversionsTest.class.getResourceAsStream("/mongodb.test.properties"); properties.load(is); try { mongo=new Mongo(new MongoURI(properties.getProperty("mongodb.connectionURI"))); mongo.getDatabaseNames(); dbName=properties.getProperty("mongodb.testDb"); db=mongo.getDB(dbName); } catch ( Exception e) { Assume.assumeNoException(e); } }
Example 23
From project camel-zookeeper, under directory /src/test/java/org/apache/camel/component/zookeeper/.
Source file: ZooKeeperTestSupport.java

@BeforeClass public static void setupTestServer() throws Exception { LOG.info("Starting Zookeeper Test Infrastructure"); server=new TestZookeeperServer(getServerPort(),clearServerData()); waitForServerUp("localhost:" + getServerPort(),1000); client=new TestZookeeperClient(getServerPort(),getTestClientSessionTimeout()); LOG.info("Started Zookeeper Test Infrastructure on port " + getServerPort()); }
Example 24
From project Cassandra-Client-Tutorial, under directory /src/test/java/com/jeklsoft/cassandraclient/astyanax/.
Source file: TestAstyanaxProtocolBufferWithStandardColumnExample.java

@BeforeClass public static void configureCassandra() throws Exception { if (useEmbeddedCassandra) { port=cassandraEmbeddedPort; List<String> cassandraCommands=new ArrayList<String>(); cassandraCommands.add("create keyspace " + cassandraKeySpaceName + ";"); cassandraCommands.add("use " + cassandraKeySpaceName + ";"); cassandraCommands.add("create column family " + columnFamilyName + ";"); URL stream=TestAstyanaxProtocolBufferWithStandardColumnExample.class.getClassLoader().getResource("cassandra.yaml"); File cassandraYaml=new File(stream.toURI()); EmbeddedCassandra.builder().withCleanDataStore().withStartupCommands(cassandraCommands).withHostname(cassandraHostname).withHostport(port).withCassandaConfigurationDirectoryPath(configurationPath).withCassandaYamlFile(cassandraYaml).build(); } AstyanaxConfiguration configuration=new AstyanaxConfigurationImpl().setDiscoveryType(NodeDiscoveryType.NONE); ConnectionPoolConfiguration connectionPoolConfiguration=new ConnectionPoolConfigurationImpl("AstyanaxPool").setPort(port).setMaxConnsPerHost(1).setSeeds(cassandraHostname + ":" + port); ConnectionPoolMonitor connectionPoolMonitor=new CountingConnectionPoolMonitor(); ThriftFamilyFactory factory=ThriftFamilyFactory.getInstance(); context=new AstyanaxContext.Builder().forCluster(cassandraClusterName).forKeyspace(cassandraKeySpaceName).withAstyanaxConfiguration(configuration).withConnectionPoolConfiguration(connectionPoolConfiguration).withConnectionPoolMonitor(connectionPoolMonitor).buildKeyspace(factory); context.start(); keyspace=context.getEntity(); CF_USER_INFO=new ColumnFamily<UUID,DateTime>(columnFamilyName,UUIDSerializer.get(),DateTimeSerializer.get()); }
Example 25
From project chililog-server, under directory /src/test/java/org/chililog/server/data/.
Source file: RepositoryConfigTest.java

@BeforeClass public static void classSetup() throws Exception { _db=MongoConnection.getInstance().getConnection(); assertNotNull(_db); DBCollection coll=_db.getCollection(RepositoryConfigController.MONGODB_COLLECTION_NAME); Pattern pattern=Pattern.compile("^repo_info_test[\\w]*$"); DBObject query=new BasicDBObject(); query.put(RepositoryConfigBO.NAME_FIELD_NAME,pattern); coll.remove(query); }
Example 26
From project clustermeister, under directory /provisioning/src/test/java/com/github/nethad/clustermeister/provisioning/rmi/.
Source file: RmiIntegrationTest.java

@BeforeClass public static void setupClass() throws Exception { rmiInfrastructure=new RmiInfrastructure(65032); rmiInfrastructure.initialize(); rmiServerForApi=rmiInfrastructure.getRmiServerForApi(); rmiServerForDriver=rmiInfrastructure.getRmiServerForDriver(); }
Example 27
From project CMM-data-grabber, under directory /paul/src/test/java/au/edu/uq/cmm/paul/grabber/.
Source file: GrabberEventTest.java

@BeforeClass public static void setup(){ EMF=Persistence.createEntityManagerFactory("au.edu.uq.cmm.paul"); EntityManager em=EMF.createEntityManager(); try { em.getTransaction().begin(); em.getTransaction().commit(); } finally { em.close(); } FACILITY=buildFacility(); CONFIG=new PaulConfiguration(); CONFIG.setCaptureDirectory(prepareDirectory("/tmp/testSafe").toString()); CONFIG.setArchiveDirectory(prepareDirectory("/tmp/testArchive").toString()); FSM=buildMockFacilityStatusManager(); }
Example 28
From project codjo-data-process, under directory /codjo-data-process-server/src/test/java/net/codjo/dataprocess/server/dao/.
Source file: ContextDaoTest.java

@BeforeClass public static void beforeClass() throws Exception { COMPOSITE_FIXTURE.doSetUp(); JdbcFixture jdbcFixture=TOKIO.getJdbcFixture(); jdbcFixture.advanced().dropAllObjects(); try { DATAGEN.generate(); TestUtils.initScript(jdbcFixture,DATAGEN,"PM_DP_CONTEXT.tab"); } catch ( Exception e) { COMPOSITE_FIXTURE.doTearDown(); fail(e.getLocalizedMessage()); } }
Example 29
From project cometd, under directory /cometd-java/cometd-java-annotations/src/test/java/org/cometd/annotation/.
Source file: ClientAnnotationProcessorTest.java

@BeforeClass public static void startServer() throws Exception { server=new Server(); ServerConnector connector=new ServerConnector(server); connector.setIdleTimeout(30000); server.addConnector(connector); String contextPath=""; ServletContextHandler context=new ServletContextHandler(server,contextPath); ServletHolder cometdServletHolder=new ServletHolder(CometdServlet.class); cometdServletHolder.setInitParameter("timeout","10000"); cometdServletHolder.setInitParameter("multiFrameInterval","2000"); if (Boolean.getBoolean("debugTests")) cometdServletHolder.setInitParameter("logLevel","3"); cometdServletHolder.setInitOrder(1); String cometdServletPath="/cometd"; context.addServlet(cometdServletHolder,cometdServletPath + "/*"); server.start(); int port=connector.getLocalPort(); cometdURL="http://localhost:" + port + contextPath+ cometdServletPath; httpClient=new HttpClient(); httpClient.start(); }
Example 30
From project components, under directory /camel/camel-core/src/test/java/org/switchyard/component/camel/transformer/.
Source file: CamelTypeConverterExtractorTest.java

@BeforeClass public static void init() throws Exception { final DefaultCamelContext camelContext=new DefaultCamelContext(); _extractor=new CamelTypeConverterExtractor(camelContext); _extractor.init(); _transformerRegistry=new BaseTransformerRegistry(); new TransformerRegistryLoader(_transformerRegistry).loadOOTBTransforms(); }
Example 31
From project core_1, under directory /test/src/test/java/org/switchyard/test/mixins/.
Source file: HornetQMixInTest.java

@BeforeClass public static void setup(){ namingMixIn=new NamingMixIn(); namingMixIn.initialize(); hornetQMixIn=new HornetQMixIn(); hornetQMixIn.initialize(); }
Example 32
@BeforeClass public static void setUpClass() throws Exception { instance=new QueueService(); queue=instance.createQueue(queueName); nonQueue=new Database(instance.couchDB,nonQueueName); nonQueue.create(); }
Example 33
From project Countandra, under directory /src/org/countandra/unittests/.
Source file: CountandraTestCases.java

@BeforeClass public static void insertTestData(){ CountandraTestUtils.setPipeLineFactory(); DateTime dt=new DateTime(DateTimeZone.UTC); CountandraTestUtils.insertData("c=pti&s=us.georgia.atlanta&t=" + dt.getMillis() + "&v=400"); CountandraTestUtils.insertData("c=pti&s=us.newyork.buffalo&t=" + dt.getMillis() + "&v=250"); CountandraTestUtils.insertData("c=pti&s=us.georgia.atlanta&t=" + dt.minusHours(1).getMillis() + "&v=200"); CountandraTestUtils.insertData("c=pti&s=us.georgia.atlanta&t=" + dt.minusHours(1).getMillis() + "&v=300"); CountandraTestUtils.insertData("c=pti&s=us.georgia.augusta&t=" + dt.minusHours(1).getMillis() + "&v=250"); CountandraTestUtils.insertData("c=pti&s=us.california.lasvegas&t=" + dt.minusHours(1).getMillis() + "&v=250"); }
Example 34
From project crammer, under directory /src/test/java/uk/ac/ebi/ena/sra/cram/impl/.
Source file: TestCramIterators.java

@BeforeClass public static void createCramFile() throws Exception { cramFile=File.createTempFile(bamFile.getName(),".cram"); cramFile.deleteOnExit(); String command=String.format("-l error cram --input-bam-file %s --reference-fasta-file %s --output-cram-file %s --max-records 100",bamFile.getAbsolutePath(),refFile.getAbsolutePath(),cramFile.getAbsolutePath()); CramTools.main(command.split("\\s+")); indexFile=File.createTempFile(cramFile.getName(),".crai"); indexFile.deleteOnExit(); command=String.format("--input-cram-file %s --reference-fasta-file %s --index-file %s",cramFile.getAbsolutePath(),refFile.getAbsolutePath(),indexFile.getAbsolutePath()); CramIndexer.main(command.split("\\s+")); index=CramIndex.fromFile(indexFile); pointer=index.findRecordPointerAt("20",0); }
Example 35
From project culvert, under directory /culvert-accumulo/src/test/java/com/bah/culvert/accumulo/.
Source file: CulvertAccumuloIT.java

/** * Setup the mock instance * @throws Exception */ @BeforeClass public static void beforeClass() throws Exception { inst=new MockInstance(INSTANCE_NAME); conf.set(AccumuloConstants.INSTANCE_CLASS_KEY,MockInstance.class.getName()); conf.set(AccumuloConstants.INSTANCE_NAME_KEY,INSTANCE_NAME); conf.set(AccumuloConstants.USERNAME_KEY,USERNAME); conf.set(AccumuloConstants.PASSWORD_KEY,PASSWORD); }
Example 36
From project dawn-ui, under directory /org.dawb.workbench.ui.test/src/org/dawb/workbench/ui/editors/test/.
Source file: LargeFilesTest.java

@BeforeClass public static void before() throws Exception { ModelUtils.createWorkflowProject("workflows",ResourcesPlugin.getWorkspace().getRoot(),true,null); DataProjectUtils.createDataProject("data",ResourcesPlugin.getWorkspace().getRoot(),true,null); ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE,new NullProgressMonitor()); final IProject data=ResourcesPlugin.getWorkspace().getRoot().getProject("data"); final File dir=new File(System.getProperty("org.dawb.large.folder")); if (!dir.exists()) throw new Exception("Please set the large files folder system property and ensure it exists, 'org.dawb.large.folder'"); final IFolder folder=data.getFolder(dir.getName()); folder.createLink(dir.toURI(),IResource.DEPTH_ONE,null); folder.refreshLocal(IResource.DEPTH_ONE,null); }
Example 37
From project dawn-workflow, under directory /org.dawb.passerelle.actors.test/src/org/dawb/passerelle/actors/test/edna/.
Source file: MomlEdnaTest.java

/** * Ensure that the projects are available in this workspace. * @throws Exception */ @BeforeClass public static void beforeClass() throws Exception { InterpreterUtils.createJythonInterpreter("jython",new NullProgressMonitor()); InterpreterUtils.createPythonInterpreter("python",new NullProgressMonitor()); ModelUtils.createWorkflowProject("workflows",ResourcesPlugin.getWorkspace().getRoot(),true,null); ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE,new NullProgressMonitor()); WorkbenchServiceManager.startWorkbenchService(); }
Example 38
From project dci-examples, under directory /frontloading/java-qi4j/marc-grue/src/main/test/v1/.
Source file: FrontloadTest.java

@BeforeClass public static void setup() throws Exception { assembler=new SingletonAssembler(){ public void assemble( ModuleAssembly module) throws AssemblyException { module.layerAssembly().applicationAssembly().setMetaInfo(new ContextInjectionProviderFactory()); module.addEntities(ProjectRolemap.class,ActivityRolemap.class); module.addServices(MemoryEntityStoreService.class,UuidIdentityGeneratorService.class); } } ; buildDemoNetwork(assembler); System.out.println("FRONTLOADING TESTS - v1 \n========================================================"); }
Example 39
From project derric, under directory /test/org/derric_lang/validator/.
Source file: TestInterpretValidatorInputStreamImpl.java

@BeforeClass public static void beforeClass() throws IOException { File data=File.createTempFile("simpleValidatorInputStreamInterpretTest",null); data.deleteOnExit(); _path=data.getPath(); FileOutputStream output=new FileOutputStream(data); _data=new byte[]{85,-42,-76,29}; output.write(_data); output.close(); }
Example 40
From project DirectMemory, under directory /DirectMemory-Cache/src/test/java/org/apache/directmemory/memory/.
Source file: BaseTest.java

@BeforeClass @AfterClass public static void setup(){ rnd=new Random(); logger.info("test - size: " + test.size()); logger.info("test - errors: " + errors); logger.info("heap - max: " + Ram.inMb(Runtime.getRuntime().maxMemory())); logger.info("heap - allocated: " + Ram.inMb(Runtime.getRuntime().totalMemory())); logger.info("heap - free : " + Ram.inMb(Runtime.getRuntime().freeMemory())); logger.info("************************************************"); }
Example 41
From project DistCpV2-0.20.203, under directory /src/test/java/org/apache/hadoop/tools/.
Source file: TestDistCp.java

@BeforeClass public static void setup() throws Exception { configuration=getConfigurationForCluster(); cluster=new MiniDFSCluster(configuration,1,true,null); System.setProperty("org.apache.hadoop.mapred.TaskTracker","target/tmp"); configuration.set("org.apache.hadoop.mapred.TaskTracker","target/tmp"); System.setProperty("hadoop.log.dir","target/tmp"); configuration.set("hadoop.log.dir","target/tmp"); mrCluster=new MiniMRCluster(1,configuration.get("fs.default.name"),1); Configuration mrConf=mrCluster.createJobConf(); final String mrJobTracker=mrConf.get("mapred.job.tracker"); configuration.set("mapred.job.tracker",mrJobTracker); final String mrJobTrackerAddress=mrConf.get("mapred.job.tracker.http.address"); configuration.set("mapred.job.tracker.http.address",mrJobTrackerAddress); }
Example 42
From project drools-chance, under directory /drools-shapes/drools-shapes-examples/conyard-example/src/test/java/.
Source file: FactTest.java

@BeforeClass public static void init() throws ParseException, JAXBException, IOException { JAXBContext jaxbContext=JAXBContext.newInstance(factory.getClass().getPackage().getName()); marshaller=jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING,"UTF-8"); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE); unmarshaller=jaxbContext.createUnmarshaller(); }
Example 43
From project droolsjbpm-integration, under directory /drools-container/drools-spring/src/test/java/org/drools/container/spring/beans/persistence/.
Source file: JPASingleSessionCommandServiceFactoryEnvTest.java

@BeforeClass public static void startH2Database() throws Exception { DeleteDbFiles.execute("","DroolsFlow",true); h2Server=Server.createTcpServer(new String[0]); h2Server.start(); try { log.info("creating: {}",TMPDIR + "/processWorkItems.pkg"); writePackage(getProcessWorkItems(),new File(TMPDIR + "/processWorkItems.pkg")); log.info("creating: {}",TMPDIR + "/processSubProcess.pkg"); writePackage(getProcessSubProcess(),new File(TMPDIR + "/processSubProcess.pkg")); log.info("creating: {}",TMPDIR + "/processTimer.pkg"); writePackage(getProcessTimer(),new File(TMPDIR + "/processTimer.pkg")); log.info("creating: {}",TMPDIR + "/processTimer2.pkg"); writePackage(getProcessTimer2(),new File(TMPDIR + "/processTimer2.pkg")); } catch ( Exception e) { log.error("can't create packages!",e); throw new RuntimeException(e); } }
Example 44
From project EasySOA, under directory /easysoa-proxy/easysoa-proxy-core/easysoa-proxy-core-tests/src/test/java/org/easysoa/tests/.
Source file: ScenarioTest.java

@BeforeClass public static void setUp() throws Exception { startFraSCAti(); startHttpDiscoveryProxy("httpDiscoveryProxy.composite"); startScaffolderProxy("scaffoldingProxy.composite"); startMockServices(false); TwitterTestRunPortType_TwitterTestRunPort_Server.start(); }
Example 45
From project Ebselen, under directory /ebselen-tests/src/main/java/com/lazerycode/ebselen/.
Source file: EbselenTestBase.java

/** * Only start the browser the first time that this is run (The browser should remain open for the entire test suite) */ @BeforeClass public static void StartBrowser(){ ebselenCoreInstance.startSelenium(); driver=ebselenCoreInstance.getDriverObject(); ebselen=ebselenCoreInstance.getEbselenCommandsObject(); builder=ebselenCoreInstance.getActionsBuilderObject(); }
Example 46
From project Eclipse, under directory /com.mobilesorcery.sdk.core.tests/src/com/mobilesorcery/sdk/core/.
Source file: PathExclusionFilterTest.java

@BeforeClass public static void setUp() throws Exception { try { project=ResourcesPlugin.getWorkspace().getRoot().getProject("project"); if (project.exists()) { project.delete(true,new NullProgressMonitor()); } project.create(null); MoSyncNature.addNatureToProject(project,true); } catch ( CoreException e) { e.printStackTrace(); } }
Example 47
@BeforeClass public static void startDb() throws Exception { zk=LocalhostZooKeeperCluster.singleton().clearDataAndVerifyConnection(); File storeDir=dir.graphDbDir(true); CreateEmptyDb.at(storeDir); db=Neo4jHaCluster.single(zk,storeDir,3377,MapUtil.stringMap("jmx.port","9913")); }
Example 48
From project example-projects, under directory /ejb-jee5/src/test/java/org/example/.
Source file: HelloBeanTest.java

@BeforeClass public static void setUpClass() throws Exception { Properties props=new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces"); props.put(Context.PROVIDER_URL,"localhost:1099"); ic=new InitialContext(props); }
Example 49
From project ExperienceMod, under directory /ExperienceMod/test/com/comphenix/xp/lookup/.
Source file: ItemTreeTest.java

@BeforeClass public static void loadDefaultConfiguration() throws FileNotFoundException { InputStream file=ItemTreeTest.class.getResourceAsStream("/config.yml"); YamlConfiguration defaultFile=YamlConfiguration.loadConfiguration(file); RewardProvider rewards=new RewardProvider(); ChannelProvider channels=new ChannelProvider(); rewards.setDefaultReward(RewardTypes.EXPERIENCE); rewards.register(new MockRewardable(RewardTypes.EXPERIENCE)); Debugger injected=new Debugger(){ public void printWarning( Object sender, String message, Object... params){ fail(String.format(message,params)); } public void printDebug( Object sender, String message, Object... params){ } public boolean isDebugEnabled(){ return false; } } ; configuration=new Configuration(injected,rewards,channels); configuration.setParameterProviders(new ParameterProviderSet()); configuration.setItemParser(new ItemParser(new ItemNameParser())); configuration.setMobParser(new MobParser(new MobMatcher())); configuration.setActionTypes(ActionTypes.Default()); configuration.loadFromConfig(defaultFile); }
Example 50
From project fakereplace, under directory /core/src/test/java/a/org/fakereplace/test/replacement/abstractmethod/.
Source file: AbstractMethodTest.java

@BeforeClass public static void setup(){ ClassReplacer rep=new ClassReplacer(); rep.queueClassForReplacement(AbstractClass.class,AbstractClass1.class); rep.queueClassForReplacement(AbstractCaller.class,AbstractCaller1.class); rep.queueClassForReplacement(BigChild.class,BigChild1.class); rep.queueClassForReplacement(SmallChild.class,SmallChild1.class); rep.replaceQueuedClasses(); }
Example 51
From project fedora-client, under directory /fedora-client-core/src/test/java/com/yourmediashelf/fedora/client/.
Source file: FedoraClientIT.java

@BeforeClass public static void setUpBeforeClass() throws Exception { String baseUrl=System.getProperty("fedora.test.baseUrl"); String username=System.getProperty("fedora.test.username"); String password=System.getProperty("fedora.test.password"); credentials=new FedoraCredentials(new URL(baseUrl),username,password); }
Example 52
From project fest-assert-2.x, under directory /src/test/java/org/fest/assertions/api/filter/.
Source file: AbstractTest_filter.java

@BeforeClass public static void setUpOnce(){ rose=new Player(new Name("Derrick","Rose"),"Chicago Bulls"); rose.setAssistsPerGame(8); rose.setPointsPerGame(25); rose.setReboundsPerGame(5); james=new Player(new Name("Lebron","James"),"Miami Heat"); james.setAssistsPerGame(6); james.setPointsPerGame(27); james.setReboundsPerGame(8); durant=new Player(new Name("Kevin","Durant"),"OKC"); durant.setAssistsPerGame(4); durant.setPointsPerGame(30); durant.setReboundsPerGame(5); noah=new Player(new Name("Joachim","Noah"),"Chicago Bulls"); noah.setAssistsPerGame(4); noah.setPointsPerGame(10); noah.setReboundsPerGame(11); players=newArrayList(rose,james,durant,noah); }
Example 53
From project figgo, under directory /src/test/java/br/octahedron/figgo/ui/.
Source file: LoginLogoutIT.java

@BeforeClass public static void addUser(){ driver.get("http://localhost:8080/"); WebElement imageLogin=driver.findElement(By.linkText("login")); imageLogin.click(); WebElement emailTextInput=driver.findElement(By.id("email")); emailTextInput.clear(); emailTextInput.sendKeys(email); WebElement loginButton=driver.findElement(By.xpath("//input[@value='Log In']")); loginButton.click(); Assert.assertEquals("http://localhost:8080/user/new",driver.getCurrentUrl()); WebElement nameTextInput=driver.findElement(By.xpath("//input[@name='name']")); nameTextInput.sendKeys("Fulano"); WebElement phoneNumberTextInput=driver.findElement(By.xpath("//input[@name='phoneNumber']")); phoneNumberTextInput.sendKeys("83 8888 8888"); WebElement descriptionTextInput=driver.findElement(By.xpath("//textarea")); descriptionTextInput.sendKeys("Descri??o do usu?rio"); WebElement submitInput=driver.findElement(By.xpath("//input[@type='submit']")); submitInput.submit(); driver.manage().deleteAllCookies(); }
Example 54
From project flume, under directory /flume-ng-sinks/flume-hdfs-sink/src/test/java/org/apache/flume/sink/hdfs/.
Source file: TestHDFSEventSinkOnMiniCluster.java

@BeforeClass public static void setup() throws IOException { File dfsDir=new File(DFS_DIR); if (!dfsDir.isDirectory()) { dfsDir.mkdirs(); } oldTestBuildDataProp=System.getProperty(TEST_BUILD_DATA_KEY); System.setProperty(TEST_BUILD_DATA_KEY,DFS_DIR); cluster=new MiniDFSCluster(CONF,1,true,null); cluster.waitActive(); }
Example 55
From project fr.obeo.performance, under directory /fr.obeo.performance/test/fr/obeo/performance/test/.
Source file: BasicAPIUsageTest.java

@BeforeClass public static void configure(){ if (!EMFPlugin.IS_ECLIPSE_RUNNING) { @SuppressWarnings("unused") EPackage perf=PerformancePackage.eINSTANCE; Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("performance",new XMIResourceFactoryImpl()); } }
Example 56
From project gadget-server, under directory /gadget-core/src/test/java/org/overlord/gadgets/server/.
Source file: UserManagerTest.java

@BeforeClass public static void setUp() throws Exception { Injector injector=Guice.createInjector(new CoreModule()); userManager=injector.getInstance(UserManager.class); gadgetService=injector.getInstance(GadgetService.class); userManager.createUser(user); userManager.addPage(page,user); }
Example 57
From project geolatte-common, under directory /src/test/java/org/geolatte/common/dataformats/json/.
Source file: GeoJsonToDeserializationTest.java

@BeforeClass public static void setupSuite(){ assembler=new GeoJsonToAssembler(); mapper=new ObjectMapper(); JacksonConfiguration.applyMixin(mapper); mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,false); }
Example 58
From project geolatte-mapserver, under directory /src/test/java/org/geolatte/mapserver/wms/.
Source file: TestWMSGetCapabilitiesRequestHandler.java

@BeforeClass public static void setUp() throws ConfigurationException { Configuration config=Configuration.load("test-config.xml"); try { TileMapRegistry registry=TileMapRegistry.configure(config); response=WMSGetCapabilitiesResponse.build(config,registry); handler=new WMSGetCapabilitiesRequestHandler(response); } catch ( IllegalStateException e) { } }
Example 59
@BeforeClass public static void setUp() throws Exception { startGitblit(); if (REPOSITORIES.exists() || REPOSITORIES.mkdirs()) { cloneOrFetch("helloworld.git","https://github.com/git/hello-world.git"); cloneOrFetch("ticgit.git","https://github.com/schacon/ticgit.git"); cloneOrFetch("test/jgit.git","https://github.com/eclipse/jgit.git"); cloneOrFetch("test/helloworld.git","https://github.com/git/hello-world.git"); cloneOrFetch("test/ambition.git","https://github.com/defunkt/ambition.git"); cloneOrFetch("test/theoretical-physics.git","https://github.com/certik/theoretical-physics.git"); cloneOrFetch("test/gitective.git","https://github.com/kevinsawicki/gitective.git"); enableTickets("ticgit.git"); enableDocs("ticgit.git"); showRemoteBranches("ticgit.git"); showRemoteBranches("test/jgit.git"); } }
Example 60
From project glg2d, under directory /src/test/java/glg2d/misc/.
Source file: SimpleTimingTests.java

@BeforeClass public static void setup(){ drawable=new GLJPanel(); JFrame frame=new JFrame(); frame.setContentPane((GLJPanel)drawable); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(new Dimension(50,50)); frame.setVisible(true); }
Example 61
From project GoFleetLSServer, under directory /src/test/java/org/gofleet/openls/.
Source file: SimpleServiceTests.java

@BeforeClass public static void initialize() throws FileNotFoundException, JAXBException { determineRouteRequest=Utils.convertFile2XLSType("/determineRouteRequest.xml",XLSType.class); geocodingRequest=Utils.convertFile2XLSType("/geocodingRequest.xml",XLSType.class); reverseGeocodingRequest=Utils.convertFile2XLSType("/reverseGeocoding.xml",XLSType.class); directoryRequest=Utils.convertFile2XLSType("/directory.xml",XLSType.class); }
Example 62
From project goldenorb, under directory /src/test/java/org/goldenorb/io/.
Source file: TestInputSplitAllocatorDFS.java

@BeforeClass public static void setUpCluster() throws Exception { Configuration conf=new Configuration(true); conf.set("dfs.block.size","16384"); cluster=new MiniDFSCluster(conf,3,true,null); fs=cluster.getFileSystem(); }
Example 63
From project gora, under directory /gora-core/src/test/java/org/apache/gora/store/.
Source file: DataStoreTestBase.java

@BeforeClass public static void setUpClass() throws Exception { if (testDriver != null && !setUpClassCalled) { log.info("setting up class"); testDriver.setUpClass(); setUpClassCalled=true; } }
Example 64
From project grails-data-mapping, under directory /grails-datastore-appengine/src/test/groovy/org/grails/datastore/mapping/appengine/testsupport/.
Source file: AppEngineDatastoreTestCase.java

@BeforeClass public static void setUp() throws Exception { ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment()); ApiProxyLocalFactory factory=new ApiProxyLocalFactory(); ApiProxyLocal proxyLocal=factory.create(new LocalServerEnvironment(){ public File getAppDir(){ return new File("."); } public String getAddress(){ return "localhost"; } public int getPort(){ return 8080; } public void waitForServerToStart() throws InterruptedException { } } ); proxyLocal.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY,Boolean.TRUE.toString()); ApiProxy.setDelegate(proxyLocal); }
Example 65
From project gxa, under directory /atlas-analytics/src/test/java/uk/ac/ebi/gxa/R/compute/rcommand/.
Source file: RCommandResultTest.java

@BeforeClass public static void setUp() throws InstantiationException { AtlasRFactory rFactory=getAtlasRFactoryBuilder().buildAtlasRFactory(RType.BIOCEP,killUsed(false)); computeService=new AtlasComputeService(); computeService.setAtlasRFactory(rFactory); rCommand=new RCommand(computeService,RCommandResultTest.class.getResource("RCommandResultTest.R")); }
Example 66
From project hackergarten-moreunit, under directory /org.moreunit.swtbot.test/src/org/moreunit/.
Source file: JavaProjectSWTBotTestHelper.java

@BeforeClass public static void initialize(){ bot=new SWTWorkbenchBot(); if (!isWorkspacePrepared) { SWTBotPreferences.PLAYBACK_DELAY=10; SWTBotPreferences.KEYBOARD_LAYOUT="EN_US"; switchToJavaPerspective(); isWorkspacePrepared=true; } }
Example 67
From project HadoopIlluminated, under directory /src/test/java/com/hadoopilluminated/ch01/.
Source file: WordCount21Test.java

@BeforeClass public static void setupBase() throws Exception { System.out.println("hadoop21.setupBase"); if (new File(outputPath).exists()) { Files.deleteRecursively(new File(outputPath)); } }
Example 68
From project harmony, under directory /harmony.adapter.thin/src/test/java/org/opennaas/extensions/idb/da/thin/webservice/test/.
Source file: TestThinNrps.java

/** * Setup before creating test suite. * @throws java.lang.Exception An exception. */ @BeforeClass public static final void setUpBeforeClass() throws Exception { if (Config.isTrue("test","test.callWebservice")) { String eprUri=Config.getString("test","test.reservationEPR"); int portSeperatorPos=eprUri.indexOf(':',7); String host=eprUri.substring(7,portSeperatorPos); int port=Integer.parseInt(eprUri.substring(portSeperatorPos + 1,eprUri.indexOf('/',portSeperatorPos))); try { System.out.println("open Socket on host:" + host + "and port:"+ port); boolean status=InetAddress.getByName(host).isReachable(TIMEOUT); System.out.println("Socket opened: " + status); if (!status) { System.err.println("*** Service not running ***"); TestThinNrps.serviceAvailable=false; } TestThinNrps.client=new SimpleReservationClient(eprUri); } catch ( UnknownHostException e) { System.err.println("*** Unknown Host ***"); TestThinNrps.serviceAvailable=false; } catch ( IOException e) { System.err.println("*** Service not running ***"); TestThinNrps.serviceAvailable=false; } } else { client=new SimpleReservationClient(new ReservationWS()); } }
Example 69
From project hbase-transactional-tableindexed, under directory /src/test/java/org/apache/hadoop/hbase/client/transactional/.
Source file: StressTestTransactions.java

@BeforeClass public static void setUpClass() throws Throwable { Configuration conf=TEST_UTIL.getConfiguration(); conf.set(HConstants.REGION_SERVER_CLASS,TransactionalRegionInterface.class.getName()); conf.set(HConstants.REGION_SERVER_IMPL,TransactionalRegionServer.class.getName()); TEST_UTIL.startMiniCluster(3); }
Example 70
From project HBasePS, under directory /src/test/java/com/sentric/hbase/coprocessor/.
Source file: TestProspectiveSearchRegionObserver.java

@BeforeClass public static void setupBeforeClass() throws Exception { long startInNsec=System.nanoTime(); TEST_UTIL.startMiniCluster(1); TEST_UTIL.createTable(ArticleTable.NAME,ArticleTable.ARTICLE_FAMILIY); TEST_UTIL.createTable(AccountTable.NAME,AccountTable.AGENT_FAMILIY); TEST_UTIL.createTable(ReportTable.NAME,ReportTable.DOC_FAMILIY); fillAccountTable(ACCOUNTS); long upInNsec=System.nanoTime(); float delta=(float)(upInNsec - startInNsec) / 1000000000; System.out.printf("Cluster up in %f seconds\n",delta); }
Example 71
From project HBql, under directory /src/test/java/org/apache/hadoop/hbase/hbql/.
Source file: AggregateTest.java

@BeforeClass public static void beforeClass() throws HBqlException { connection=HConnectionManager.newConnection(); connection.execute("CREATE TEMP MAPPING aggmapping FOR TABLE aggtable" + "(" + "keyval key, "+ "f1 ("+ " val1 string alias val1, "+ " val2 string alias val2, "+ " val3 string alias notdefinedval "+ "), "+ "f2 ("+ " val1 date alias val3, "+ " val2 date alias val4 "+ "), "+ "f3 ("+ " val1 int alias val5, "+ " val2 int alias val6, "+ " val3 int alias val7, "+ " val4 int[] alias val8, "+ " mapval1 object alias f3mapval1, "+ " mapval2 object alias f3mapval2 "+ "))"); if (!connection.tableExists("aggtable")) System.out.println(connection.execute("create table aggtable (f1(), f2(), f3())")); else System.out.println(connection.execute("delete from aggmapping")); insertRecords(connection,10,"Batch 1"); insertRecords(connection,10,"Batch 2"); keyList.clear(); val1List.clear(); val5List.clear(); val8check=null; insertRecords(connection,10,"Batch 3"); val5max=Integer.MIN_VALUE; for (int i=0; i < val5List.size(); i++) val5max=Math.max(val5List.get(i),val5max); val5min=Integer.MAX_VALUE; for (int i=0; i < val5List.size(); i++) val5min=Math.min(val5List.get(i),val5min); }
Example 72
From project hcatalog, under directory /hcatalog-pig-adapter/src/test/java/org/apache/hcatalog/pig/.
Source file: TestHCatLoaderComplexSchema.java

@BeforeClass public static void setUpBeforeClass() throws Exception { HiveConf hiveConf=new HiveConf(TestHCatLoaderComplexSchema.class); hiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname,""); hiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname,""); hiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname,"false"); driver=new Driver(hiveConf); SessionState.start(new CliSessionState(hiveConf)); }