Search in sources :

Example 56 with Before

use of org.junit.Before in project lucene-skos by behas.

the class SKOSLabelFilterTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    skosAnalyzer = new SKOSAnalyzer(skosEngine, SKOSAnalyzer.ExpansionType.LABEL);
    writer = new IndexWriter(directory, new IndexWriterConfig(skosAnalyzer));
}
Also used : IndexWriter(org.apache.lucene.index.IndexWriter) SKOSAnalyzer(at.ac.univie.mminf.luceneSKOS.analysis.SKOSAnalyzer) IndexWriterConfig(org.apache.lucene.index.IndexWriterConfig) Before(org.junit.Before)

Example 57 with Before

use of org.junit.Before in project lucene-skos by behas.

the class SKOSURIFilterTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    skosAnalyzer = new SKOSAnalyzer(skosEngine, ExpansionType.URI);
    writer = new IndexWriter(directory, new IndexWriterConfig(skosAnalyzer));
}
Also used : IndexWriter(org.apache.lucene.index.IndexWriter) SKOSAnalyzer(at.ac.univie.mminf.luceneSKOS.analysis.SKOSAnalyzer) IndexWriterConfig(org.apache.lucene.index.IndexWriterConfig) Before(org.junit.Before)

Example 58 with Before

use of org.junit.Before in project YCSB by brianfrankcooper.

the class AccumuloTest method client.

@Before
public void client() throws Exception {
    LOG.debug("Loading workload properties for {}", test.getMethodName());
    workloadProps = new Properties();
    workloadProps.load(getClass().getResourceAsStream("/workloads/" + test.getMethodName()));
    for (String prop : properties.stringPropertyNames()) {
        workloadProps.setProperty(prop, properties.getProperty(prop));
    }
    // TODO we need a better test rig for 'run this ycsb workload'
    LOG.debug("initializing measurements and workload");
    Measurements.setProperties(workloadProps);
    workload = new CoreWorkload();
    workload.init(workloadProps);
    LOG.debug("initializing client");
    client = new AccumuloClient();
    client.setProperties(workloadProps);
    client.init();
}
Also used : CoreWorkload(com.yahoo.ycsb.workloads.CoreWorkload) Properties(java.util.Properties) Before(org.junit.Before)

Example 59 with Before

use of org.junit.Before in project HikariCP by brettwooldridge.

the class StatementTest method setup.

@Before
public void setup() {
    HikariConfig config = newHikariConfig();
    config.setMinimumIdle(1);
    config.setMaximumPoolSize(2);
    config.setConnectionTestQuery("VALUES 1");
    config.setDataSourceClassName("com.zaxxer.hikari.mocks.StubDataSource");
    ds = new HikariDataSource(config);
}
Also used : HikariDataSource(com.zaxxer.hikari.HikariDataSource) HikariConfig(com.zaxxer.hikari.HikariConfig) TestElf.newHikariConfig(com.zaxxer.hikari.pool.TestElf.newHikariConfig) Before(org.junit.Before)

Example 60 with Before

use of org.junit.Before in project glide by bumptech.

the class ByteBufferGifDecoderTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    gifHeader = Mockito.spy(new GifHeader());
    when(parser.parseHeader()).thenReturn(gifHeader);
    when(parserPool.obtain(isA(ByteBuffer.class))).thenReturn(parser);
    when(decoderFactory.build(isA(GifDecoder.BitmapProvider.class), eq(gifHeader), isA(ByteBuffer.class), anyInt())).thenReturn(gifDecoder);
    List<ImageHeaderParser> parsers = new ArrayList<ImageHeaderParser>();
    parsers.add(new DefaultImageHeaderParser());
    options = new Options();
    decoder = new ByteBufferGifDecoder(RuntimeEnvironment.application, parsers, bitmapPool, new LruArrayPool(ARRAY_POOL_SIZE_BYTES), parserPool, decoderFactory);
}
Also used : Options(com.bumptech.glide.load.Options) LruArrayPool(com.bumptech.glide.load.engine.bitmap_recycle.LruArrayPool) DefaultImageHeaderParser(com.bumptech.glide.load.resource.bitmap.DefaultImageHeaderParser) ArrayList(java.util.ArrayList) GifHeader(com.bumptech.glide.gifdecoder.GifHeader) ByteBuffer(java.nio.ByteBuffer) DefaultImageHeaderParser(com.bumptech.glide.load.resource.bitmap.DefaultImageHeaderParser) ImageHeaderParser(com.bumptech.glide.load.ImageHeaderParser) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)10105 File (java.io.File)829 Properties (java.util.Properties)286 Configuration (org.apache.hadoop.conf.Configuration)282 ArrayList (java.util.ArrayList)256 TreeMap (java.util.TreeMap)247 HashMap (java.util.HashMap)196 IOException (java.io.IOException)175 URL (java.net.URL)167 Path (org.apache.hadoop.fs.Path)144 TableHelper (org.apache.cayenne.test.jdbc.TableHelper)132 InputStream (java.io.InputStream)119 Config (com.hazelcast.config.Config)115 HazelcastInstance (com.hazelcast.core.HazelcastInstance)111 InvocationOnMock (org.mockito.invocation.InvocationOnMock)111 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)106 Date (java.util.Date)105 ByteArrayOutputStream (java.io.ByteArrayOutputStream)96 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)90 Random (java.util.Random)82