當前位置: 首頁>>代碼示例>>Java>>正文


Java SQLDataSetDef類代碼示例

本文整理匯總了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 );
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:SQLDataSetDefValidator.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefWizardScreenTest.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefWizardScreenTest.java

示例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));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:DataSetDefWizardScreenTest.java

示例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();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:21,代碼來源:SQLDataSetDefAttributesEditorTest.java

示例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();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:21,代碼來源:SQLDataSetDefAttributesEditorTest.java

示例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;
        }
    };
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:26,代碼來源:DB2TestSettings.java

示例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;
        }
    };
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:21,代碼來源:OracleTestSettings.java

示例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;
        }
    };
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:25,代碼來源:SybaseTestSettings.java

示例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;
        }
    };
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:25,代碼來源:PostgresTestSettings.java

示例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;
        }
    };
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:21,代碼來源:MonetDBTestSettings.java

示例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;
        }
    };
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:21,代碼來源:SQLServerTestSettings.java

示例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;
        }
    };
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:25,代碼來源:MariaDbTestSettings.java

示例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;
        }
    };
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:21,代碼來源:MySqlTestSettings.java

示例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 );
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:10,代碼來源:SQLDataSetDefValidator.java


注:本文中的org.dashbuilder.dataset.def.SQLDataSetDef類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。