/** * @inheritDoc */ public String[] getColumnNames() throws RepositoryException { return result.getColumnNames(); }
/** {@inheritDoc} */ public String[] getColumnNames() throws RepositoryException, RemoteException { return result.getColumnNames(); }
/** * @inheritDoc */ public String[] getColumnNames() throws RepositoryException { return result.getColumnNames(); }
@Override public String[] getColumnNames() throws RepositoryException { return delegate.getColumnNames(); }
@Override public int getColumnCount() throws SQLException { try { return results.getColumnNames().length; } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage(), e); } }
@Override public String getColumnLabel( int column ) throws SQLException { try { return results.getColumnNames()[column - 1]; // column value is 1-based } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage(), e); } }
@Override public String getColumnLabel( int column ) throws SQLException { try { return results.getColumnNames()[column - 1]; // column value is 1-based } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage(), e); } }
public Object call(Query query) throws RepositoryException { QueryResult result = query.execute(); List<String> names = new ArrayList<String>(Arrays.asList(result.getColumnNames())); assertTrue("Missing column: " + propertyName1, names.remove(propertyName1)); for (Iterator<String> it = names.iterator(); it.hasNext(); ) { fail(it.next() + " was not declared as a column"); } return null; } });
@Override public int getColumnCount() throws SQLException { try { return results.getColumnNames().length; } catch (RepositoryException e) { throw new SQLException(e.getLocalizedMessage(), e); } }
public String[] execute() throws Exception { return getDelegate().getColumnNames(); } });
public String[] getColumnNames() throws RepositoryException { return getDelegate().getColumnNames(); }
/** * Verify that the jcr:path is present in the query result. */ public void testJcrPath() throws RepositoryException, NotExecutableException { String nodeTypeName = session.getRootNode().getPrimaryNodeType().getName(); String queryStatement = "select * from " + nodeTypeName; // execute the search query Query query = super.createQuery(queryStatement, qsSQL); QueryResult result = query.execute(); assertTrue("jcr:path must be present in query result row", Arrays.asList(result.getColumnNames()).contains(jcrPath)); } }
/** * Verify that the jcr:path is present in the query result. */ public void testJcrPath() throws RepositoryException, NotExecutableException { String nodeTypeName = session.getRootNode().getPrimaryNodeType().getName(); String queryStatement = "//element(*, " + nodeTypeName + ")"; // execute the search query Query query = session.getWorkspace().getQueryManager().createQuery(queryStatement, qsXPATH); QueryResult result = query.execute(); assertTrue("jcr:path must be present in query result row", Arrays.asList(result.getColumnNames()).contains(jcrPath)); } }
public Object call(Query query) throws RepositoryException { QueryResult result = query.execute(); NodeTypeManager ntMgr = superuser.getWorkspace().getNodeTypeManager(); NodeType nt = ntMgr.getNodeType(testNodeType); PropertyDefinition[] propDefs = nt.getPropertyDefinitions(); Set<String> names = new HashSet<String>(); for (int i = 0; i < propDefs.length; i++) { PropertyDefinition propDef = propDefs[i]; if (!propDef.isMultiple() && !propDef.getName().equals("*")) { String columnName = SELECTOR_1 + "." + propDef.getName(); names.add(columnName); } } for (String columnName : result.getColumnNames()) { names.remove(columnName); } assertTrue("Missing required column(s): " + names, names.isEmpty()); return null; } });
public FacetResult(QueryResult queryResult) { try { RowIterator rows = queryResult.getRows(); if (rows.hasNext()) { Row row = rows.nextRow(); parseJson(queryResult.getColumnNames(), columnName -> { Value value = row.getValue(columnName); return value == null ? null : value.getString(); }); } } catch (Exception e) { throw new RuntimeException(e); } }
protected void assertResultsHaveColumns( QueryResult result, String... columnNames ) throws RepositoryException { List<String> expectedNames = new ArrayList<String>(); for (String name : columnNames) { expectedNames.add(name); } List<String> actualNames = new ArrayList<String>(); for (String name : result.getColumnNames()) { actualNames.add(name); } Collections.sort(expectedNames); Collections.sort(actualNames); assertThat(actualNames, is(expectedNames)); }
protected void validateColumnNames( QueryResult result ) throws RepositoryException { if (columnNames != null) { List<String> expectedNames = new ArrayList<String>(); for (String name : columnNames) { expectedNames.add(name); } List<String> actualNames = new ArrayList<String>(); for (String name : result.getColumnNames()) { actualNames.add(name); } Collections.sort(expectedNames); Collections.sort(actualNames); assertThat(actualNames, is(expectedNames)); } }
@Before public void beforeEach() throws Exception { MockitoAnnotations.initMocks(this); stmt = new JcrStatement(connection); when(connection.getRepositoryDelegate()).thenReturn(new TestJcrCommRepositoryInterface()); when(queryResult.getColumnNames()).thenReturn(TestUtil.COLUMN_NAMES); }
@Override @Before public void beforeEach() throws Exception { super.beforeEach(); MockitoAnnotations.initMocks(this); driverInfo = new DriverInfo(JdbcLocalI18n.driverName.text(), JdbcLocalI18n.driverVendor.text(), JdbcLocalI18n.driverVendorUrl.text(), JdbcLocalI18n.driverVersion.text()); print = false; when(connection.getRepositoryDelegate()).thenReturn(delegate); Set<String> names = new HashSet<String>(); names.add("repo"); when(connection.getCatalog()).thenReturn("repo"); when(connection.driverInfo()).thenReturn(driverInfo); metadata = new JcrMetaData(connection); when(delegate.getConnectionInfo()).thenReturn(connInfo); when(delegate.execute(anyString(), anyString())).thenReturn(queryResult); when(connInfo.getRepositoryName()).thenReturn("repoName"); when(queryResult.getColumnNames()).thenReturn(TestUtil.COLUMN_NAMES); }
@Override @Before public void beforeEach() throws Exception { super.beforeEach(); MockitoAnnotations.initMocks(this); driverInfo = new DriverInfo(JdbcLocalI18n.driverName.text(), JdbcLocalI18n.driverVendor.text(), JdbcLocalI18n.driverVendorUrl.text(), JdbcLocalI18n.driverVersion.text()); print = false; when(connection.getRepositoryDelegate()).thenReturn(delegate); Set<String> names = new HashSet<String>(); names.add("repo"); when(connection.getCatalog()).thenReturn("repo"); when(connection.driverInfo()).thenReturn(driverInfo); metadata = new JcrMetaData(connection); when(delegate.getConnectionInfo()).thenReturn(connInfo); when(delegate.execute(anyString(), anyString())).thenReturn(queryResult); when(connInfo.getRepositoryName()).thenReturn("repoName"); when(connInfo.isTeiidSupport()).thenReturn(true); when(queryResult.getColumnNames()).thenReturn(TestUtil.COLUMN_NAMES); }