private CndImporter importNodesFromCND( InputStream cndInputStream ) throws IOException { Problems problemsDuringImport = new SimpleProblems(); CndImporter cndImporter = new CndImporter(new ExecutionContext()); cndImporter.importFrom(cndInputStream, problemsDuringImport, null); if (problemsDuringImport.hasErrors()) { problemsDuringImport.writeTo(LOGGER); return null; } return cndImporter; }
@Before public void beforeEach() { context = new QueryContext(new ExecutionContext(), mock(RepositoryCache.class), Collections.singleton("workspace"), mock(Schemata.class), mock(RepositoryIndexes.class), mock(NodeTypes.class), mock(BufferManager.class)); rule = PushSelectCriteria.INSTANCE; }
@Before public void beforeEach() { rule = RewriteAsRangeCriteria.INSTANCE; rules = new LinkedList<OptimizerRule>(); rules.add(rule); context = new QueryContext(new ExecutionContext(), mock(RepositoryCache.class), Collections.singleton("workspace"), mock(Schemata.class), mock(RepositoryIndexes.class), mock(NodeTypes.class), mock(BufferManager.class)); print = false; }
@Before public void beforeEach() { context = new QueryContext(new ExecutionContext(), mock(RepositoryCache.class), Collections.singleton("workspace"), mock(Schemata.class), mock(RepositoryIndexes.class), mock(NodeTypes.class), mock(BufferManager.class)); bestRule = ChooseJoinAlgorithm.USE_BEST_JOIN_ALGORITHM; nestedRule = ChooseJoinAlgorithm.USE_ONLY_NESTED_JOIN_ALGORITHM; }
@Before public void beforeEach() { context = new QueryContext(new ExecutionContext(), mock(RepositoryCache.class), Collections.singleton("workspace"), mock(Schemata.class), mock(RepositoryIndexes.class), mock(NodeTypes.class), mock(BufferManager.class)); rule = AddAccessNodes.INSTANCE; }
@Before public void beforeEach() { context = new QueryContext(new ExecutionContext(), mock(RepositoryCache.class), Collections.singleton("workspace"), mock(Schemata.class), mock(RepositoryIndexes.class), mock(NodeTypes.class), mock(BufferManager.class)); rule = AddJoinConditionColumnsToSources.INSTANCE; context.getHints().hasJoin = true; }
SystemNamespaceRegistry( JcrRepository.RunningState repository ) { this.repository = repository; this.cache = new SimpleNamespaceRegistry(); // Pre-load all of the built-in namespaces ... this.cache.register(new ExecutionContext().getNamespaceRegistry().getNamespaces()); }
SystemNamespaceRegistry( JcrRepository.RunningState repository ) { this.repository = repository; this.cache = new SimpleNamespaceRegistry(); // Pre-load all of the built-in namespaces ... this.cache.register(new ExecutionContext().getNamespaceRegistry().getNamespaces()); }
protected MockJcrTypeSystem( JcrValueFactory valueFactory ) { this.executionContext = new ExecutionContext(); this.valueFactory = valueFactory; this.delegate = this.executionContext.getValueFactories().getTypeSystem(); }
@Before public void before() { MockitoAnnotations.initMocks(this); context = new ExecutionContext(); factories = context.getValueFactories(); value = new JcrValue(factories, PropertyType.BOOLEAN, Boolean.TRUE); }
@Override @Before public void beforeEach() { super.beforeEach(); this.context = new ExecutionContext(); this.bufferMgr = new BufferManager(context); }
@Before @Override public void beforeEach() { super.beforeEach(); print = false; context = new ExecutionContext(); cache = createCache(); }
@Before public void beforeEach() { context = new ExecutionContext(); mgr = new BufferManager(context); types = context.getValueFactories().getTypeSystem(); }
@Test( expected = IllegalArgumentException.class ) public void shouldFailToParseUnknownLanguage() { TypeSystem typeSystem = new ExecutionContext().getValueFactories().getTypeSystem(); parsers.parse(typeSystem, "unknown language", "This is a bogus query"); }
@Before public void beforeEach() { context = new ExecutionContext(); db = DBMaker.newMemoryDB().make(); serializers = MapDB.serializers(context.getValueFactories()); }
@Override @Before public void beforeEach() { super.beforeEach(); this.context = new ExecutionContext(); this.bufferMgr = new BufferManager(context); this.types = new ValueTypeSystem(context.getValueFactories()); }
@Override @Before public void beforeEach() { super.beforeEach(); this.context = new ExecutionContext(); this.bufferMgr = new BufferManager(context); this.types = new ValueTypeSystem(context.getValueFactories()); }
@Override @Before public void beforeEach() { super.beforeEach(); this.context = new ExecutionContext(); this.bufferMgr = new BufferManager(context); this.types = new ValueTypeSystem(context.getValueFactories()); }
@Before public void beforeEach() { problems = new SimpleProblems(); context = new ExecutionContext(); context.getNamespaceRegistry().register(ModeShapeLexicon.Namespace.PREFIX, ModeShapeLexicon.Namespace.URI); context.getNamespaceRegistry().register(JcrLexicon.Namespace.PREFIX, JcrLexicon.Namespace.URI); context.getNamespaceRegistry().register(JcrNtLexicon.Namespace.PREFIX, JcrNtLexicon.Namespace.URI); // Set up the importer ... importer = new CndImporter(context); }
@Test public void shouldConvertValuesToCoreTypes() { ExecutionContext ctx = new ExecutionContext(); Name n1 = ctx.getValueFactories().getNameFactory().create("mix:title"); Name n2 = ctx.getValueFactories().getNameFactory().create("mix:titl"); index.add(key("key8"), "mixinTypes", new Object[]{n1}); index.commit(); SetCriteria sc = new SetCriteria(propertyValue(def4), new Literal(n1), new Literal(n2)); validate(sc, "key8"); }