本文整理匯總了Java中org.dashbuilder.dataset.def.SQLDataSetDef類的典型用法代碼示例。如果您正苦於以下問題:Java SQLDataSetDef類的具體用法?Java SQLDataSetDef怎麽用?Java SQLDataSetDef使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SQLDataSetDef類屬於org.dashbuilder.dataset.def包,在下文中一共展示了SQLDataSetDef類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validate
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public Iterable<ConstraintViolation<?>> validate( SQLDataSetDef dataSetDef,
boolean isCacheEnabled,
boolean isPushEnabled,
boolean isRefreshEnabled,
Object... params ) {
assert params != null && params.length == 1;
final Boolean isQuery = (Boolean) params[0];
Set<ConstraintViolation<SQLDataSetDef>> _violations = validator.validate( dataSetDef,
getValidationGroups( isCacheEnabled,
isPushEnabled,
isRefreshEnabled,
SQLDataSetDefValidation.class,
isQuery ? SQLDataSetDefDbSQLValidation.class : SQLDataSetDefDbTableValidation.class ) );
return toIterable( _violations );
}
示例2: testOnTabChangedEvent_ConfigurationTab
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Test
public void testOnTabChangedEvent_ConfigurationTab() {
when(editWorkflow.getEditor()).thenReturn(dataSetDefEditor);
TabChangedEvent event = mock(TabChangedEvent.class);
when(event.getContext()).thenReturn(dataSetDefEditor);
when(event.getTabId()).thenReturn(DataSetEditor.TAB_CONFIGURATION);
presenter.currentWorkflow = editWorkflow;
presenter.onTabChangedEvent(event);
verify(editWorkflow, times(1)).clearButtons();
verify(editWorkflow, times(1)).showTestButton();
verify(editWorkflow, times(0)).showNextButton();
verify(editWorkflow, times(0)).showBackButton();
verify(editWorkflow, times(0)).edit(any(SQLDataSetDef.class), any(List.class));
verify(errorPopupPresenter, times(0)).showMessage(anyString());
verify(view, times(0)).setWidget(any(IsWidget.class));
}
示例3: testOnTabChangedEvent_PreviewTab
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Test
public void testOnTabChangedEvent_PreviewTab() {
when(editWorkflow.getEditor()).thenReturn(dataSetDefEditor);
TabChangedEvent event = mock(TabChangedEvent.class);
when(event.getContext()).thenReturn(dataSetDefEditor);
when(event.getTabId()).thenReturn(DataSetEditor.TAB_PREVIEW);
presenter.currentWorkflow = editWorkflow;
presenter.onTabChangedEvent(event);
verify(editWorkflow, times(1)).clearButtons();
verify(editWorkflow, times(1)).showNextButton();
verify(editWorkflow, times(1)).showBackButton();
verify(editWorkflow, times(0)).showTestButton();
verify(editWorkflow, times(0)).edit(any(SQLDataSetDef.class), any(List.class));
verify(errorPopupPresenter, times(0)).showMessage(anyString());
verify(view, times(0)).setWidget(any(IsWidget.class));
}
示例4: testOnTabChangedEvent_AdvancedTab
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Test
public void testOnTabChangedEvent_AdvancedTab() {
when(editWorkflow.getEditor()).thenReturn(dataSetDefEditor);
TabChangedEvent event = mock(TabChangedEvent.class);
when(event.getContext()).thenReturn(dataSetDefEditor);
when(event.getTabId()).thenReturn(DataSetEditor.TAB_ADVANCED);
presenter.currentWorkflow = editWorkflow;
presenter.onTabChangedEvent(event);
verify(editWorkflow, times(1)).clearButtons();
verify(editWorkflow, times(1)).showNextButton();
verify(editWorkflow, times(1)).showBackButton();
verify(editWorkflow, times(0)).showTestButton();
verify(editWorkflow, times(0)).edit(any(SQLDataSetDef.class), any(List.class));
verify(errorPopupPresenter, times(0)).showMessage(anyString());
verify(view, times(0)).setWidget(any(IsWidget.class));
}
示例5: testSetValueUsingTable
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Test
public void testSetValueUsingTable() {
final SQLDataSetDef dataSetDef = mock(SQLDataSetDef.class);
when(dataSetDef.getUUID()).thenReturn("uuid1");
when(dataSetDef.getName()).thenReturn("name1");
when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.SQL);
when(dataSetDef.getDbTable()).thenReturn("table1");
when(dataSetDef.getDbSQL()).thenReturn(null);
presenter.setValue(dataSetDef);
assertEquals(false, presenter.isUsingQuery());
verify(view, times(1)).table();
verify(view, times(0)).init(presenter);
verify(view, times(0)).initWidgets(any(DropDownEditor.View.class), any(ValueBoxEditor.View.class),
any(ValueBoxEditor.View.class) ,any(ValueBoxEditor.View.class));
verify(dataSource, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
verify(dbSchema, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
verify(dbTable, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
verify(dbSQL, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
verify(view, times(0)).query();
}
示例6: testSetValueUsingQuery
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Test
public void testSetValueUsingQuery() {
final SQLDataSetDef dataSetDef = mock(SQLDataSetDef.class);
when(dataSetDef.getUUID()).thenReturn("uuid1");
when(dataSetDef.getName()).thenReturn("name1");
when(dataSetDef.getProvider()).thenReturn(DataSetProviderType.SQL);
when(dataSetDef.getDbTable()).thenReturn(null);
when(dataSetDef.getDbSQL()).thenReturn("query1");
presenter.setValue(dataSetDef);
assertEquals(true, presenter.isUsingQuery());
verify(view, times(1)).query();
verify(view, times(0)).init(presenter);
verify(view, times(0)).initWidgets(any(DropDownEditor.View.class), any(ValueBoxEditor.View.class),
any(ValueBoxEditor.View.class) ,any(ValueBoxEditor.View.class));
verify(dataSource, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
verify(dbSchema, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
verify(dbTable, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
verify(dbSQL, times(0)).addHelpContent(anyString(), anyString(), any(Placement.class));
verify(view, times(0)).table();
}
示例7: getDataSourceLocator
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public SQLDataSourceLocator getDataSourceLocator() {
return new SQLDataSourceLocator() {
public DataSource lookup(SQLDataSetDef def) throws Exception {
String server = connectionSettings.getProperty("server");
String database = connectionSettings.getProperty("database");
String port = connectionSettings.getProperty("port");
String user = connectionSettings.getProperty("user");
String password = connectionSettings.getProperty("password");
DB2SimpleDataSource ds = new DB2SimpleDataSource();
ds.setDriverType(4);
ds.setServerName(server);
ds.setDatabaseName(database);
ds.setPortNumber(Integer.parseInt(port));
if (!StringUtils.isBlank(user)) {
ds.setUser(user);
}
if (!StringUtils.isBlank(password)) {
ds.setPassword(password);
}
return ds;
}
};
}
示例8: getDataSourceLocator
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public SQLDataSourceLocator getDataSourceLocator() {
return new SQLDataSourceLocator() {
public DataSource lookup(SQLDataSetDef def) throws Exception {
String url = connectionSettings.getProperty("url");
String user = connectionSettings.getProperty("user");
String password = connectionSettings.getProperty("password");
OracleXADataSource ds = new OracleXADataSource();
ds.setURL(url);
if (!StringUtils.isBlank(user)) {
ds.setUser(user);
}
if (!StringUtils.isBlank(password)) {
ds.setPassword(password);
}
return ds;
}
};
}
示例9: getDataSourceLocator
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public SQLDataSourceLocator getDataSourceLocator() {
return new SQLDataSourceLocator() {
public DataSource lookup(SQLDataSetDef def) throws Exception {
String server = connectionSettings.getProperty("server");
String database = connectionSettings.getProperty("database");
String port = connectionSettings.getProperty("port");
String user = connectionSettings.getProperty("user");
String password = connectionSettings.getProperty("password");
SybDataSource ds = new SybDataSource();
ds.setServerName(server);
ds.setDatabaseName(database);
ds.setPortNumber(Integer.parseInt(port));
if (!StringUtils.isBlank(user)) {
ds.setUser(user);
}
if (!StringUtils.isBlank(password)) {
ds.setPassword(password);
}
return ds;
}
};
}
示例10: getDataSourceLocator
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public SQLDataSourceLocator getDataSourceLocator() {
return new SQLDataSourceLocator() {
public DataSource lookup(SQLDataSetDef def) throws Exception {
String server = connectionSettings.getProperty("server");
String database = connectionSettings.getProperty("database");
String port = connectionSettings.getProperty("port");
String user = connectionSettings.getProperty("user");
String password = connectionSettings.getProperty("password");
PGSimpleDataSource ds = new PGSimpleDataSource();
ds.setServerName(server);
ds.setDatabaseName(database);
ds.setPortNumber(Integer.parseInt(port));
if (!StringUtils.isBlank(user)) {
ds.setUser(user);
}
if (!StringUtils.isBlank(password)) {
ds.setPassword(password);
}
return ds;
}
};
}
示例11: getDataSourceLocator
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public SQLDataSourceLocator getDataSourceLocator() {
return new SQLDataSourceLocator() {
public DataSource lookup(SQLDataSetDef def) throws Exception {
String url = connectionSettings.getProperty("url");
String user = connectionSettings.getProperty("user");
String password = connectionSettings.getProperty("password");
MonetDataSource ds = new MonetDataSource();
ds.setDatabaseName(url);
if (!StringUtils.isBlank(user)) {
ds.setUser(user);
}
if (!StringUtils.isBlank(password)) {
ds.setPassword(password);
}
return ds;
}
};
}
示例12: getDataSourceLocator
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public SQLDataSourceLocator getDataSourceLocator() {
return new SQLDataSourceLocator() {
public DataSource lookup(SQLDataSetDef def) throws Exception {
String url = connectionSettings.getProperty("url");
String user = connectionSettings.getProperty("user");
String password = connectionSettings.getProperty("password");
SQLServerDataSource ds = new SQLServerDataSource();
ds.setURL(url);
if (!StringUtils.isBlank(user)) {
ds.setUser(user);
}
if (!StringUtils.isBlank(password)) {
ds.setPassword(password);
}
return ds;
}
};
}
示例13: getDataSourceLocator
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public SQLDataSourceLocator getDataSourceLocator() {
return new SQLDataSourceLocator() {
public DataSource lookup(SQLDataSetDef def) throws Exception {
String server = connectionSettings.getProperty("server");
String database = connectionSettings.getProperty("database");
String port = connectionSettings.getProperty("port");
String user = connectionSettings.getProperty("user");
String password = connectionSettings.getProperty("password");
MariaDbDataSource ds = new MariaDbDataSource();
ds.setServerName(server);
ds.setDatabaseName(database);
ds.setPortNumber(Integer.parseInt(port));
if (!StringUtils.isBlank(user)) {
ds.setUser(user);
}
if (!StringUtils.isBlank(password)) {
ds.setPassword(password);
}
return ds;
}
};
}
示例14: getDataSourceLocator
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public SQLDataSourceLocator getDataSourceLocator() {
return new SQLDataSourceLocator() {
public DataSource lookup(SQLDataSetDef def) throws Exception {
String url = connectionSettings.getProperty("url");
String user = connectionSettings.getProperty("user");
String password = connectionSettings.getProperty("password");
MysqlDataSource ds = new MysqlDataSource();
ds.setURL(url);
if (!StringUtils.isBlank(user)) {
ds.setUser(user);
}
if (!StringUtils.isBlank(password)) {
ds.setPassword(password);
}
return ds;
}
};
}
示例15: validateCustomAttributes
import org.dashbuilder.dataset.def.SQLDataSetDef; //導入依賴的package包/類
@Override
public Iterable<ConstraintViolation<?>> validateCustomAttributes( SQLDataSetDef dataSetDef, Object... params ) {
assert params != null && params.length == 1;
final Boolean isQuery = (Boolean) params[0];
Set<ConstraintViolation<SQLDataSetDef>> _violations = validator.validate( dataSetDef,
SQLDataSetDefValidation.class,
isQuery ? SQLDataSetDefDbSQLValidation.class : SQLDataSetDefDbTableValidation.class );
return toIterable( _violations );
}