本文整理汇总了Java中org.pentaho.ui.xul.util.XulDialogCallback类的典型用法代码示例。如果您正苦于以下问题:Java XulDialogCallback类的具体用法?Java XulDialogCallback怎么用?Java XulDialogCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XulDialogCallback类属于org.pentaho.ui.xul.util包,在下文中一共展示了XulDialogCallback类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: shouldShowSuccessWhenPushSucceeds
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void shouldShowSuccessWhenPushSucceeds() throws Exception {
XulMessageBox message = spy( new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT ) );
when( document.createElement( MESSAGEBOX ) ).thenReturn( message );
doReturn( true ).when( uiGit ).hasRemote();
PushResult result = mock( PushResult.class );
doReturn( new URIish( "https://test.example.com" ) ).when( result ).getURI();
RemoteRefUpdate update = mock( RemoteRefUpdate.class );
when( update.getStatus() ).thenReturn( Status.OK );
when( result.getRemoteUpdates() ).thenReturn( Arrays.asList( update ) );
controller.push();
controller.push( IVCS.TYPE_BRANCH );
verify( uiGit ).push( "default" );
verify( uiGit ).push( IVCS.TYPE_BRANCH );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:18,代码来源:GitControllerTest.java
示例2: testVisualDiff
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void testVisualDiff() throws Exception {
XulMessageBox message = spy( new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT ) );
when( document.createElement( MESSAGEBOX ) ).thenReturn( message );
UIFile file = new UIFile( "test.txt", ChangeType.MODIFY, true );
doReturn( Collections.singletonList( file ) ).when( controller ).getSelectedChangedFiles();
controller.visualdiff();
verify( message ).setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) );
// .ktr
file = new UIFile( "test.ktr", ChangeType.MODIFY, true );
doReturn( Collections.singletonList( file ) ).when( controller ).getSelectedChangedFiles();
doReturn( new FileInputStream( new File( "src/test/resources/r1.ktr" ) ) ).when( uiGit ).open( "test.ktr", Constants.HEAD );
doReturn( new FileInputStream( new File( "src/test/resources/r2.ktr" ) ) ).when( uiGit ).open( "test.ktr", IVCS.WORKINGTREE );
controller.visualdiff();
verify( uiGit ).open( "test.ktr", Constants.HEAD );
verify( uiGit ).open( "test.ktr", IVCS.WORKINGTREE );
verify( controller ).loadMainPerspective();
// conflicted ktr
file = new UIFile( "test.kjb.ours", ChangeType.ADD, false );
File dir = File.createTempFile( "git_test_", "_controller" );
dir.delete();
dir.mkdir();
File ours = new File( dir.getPath(), "test.kjb.ours" );
File theirs = new File( dir.getPath(), "test.kjb.theirs" );
FileUtils.copyFile( new File( "src/test/resources/r1.kjb" ), ours );
FileUtils.copyFile( new File( "src/test/resources/r2.kjb" ), theirs );
doReturn( dir.getPath() ).when( uiGit ).getDirectory();
doReturn( Collections.singletonList( file ) ).when( controller ).getSelectedChangedFiles();
doReturn( new FileInputStream( ours ) ).when( uiGit ).open( "test.kjb.ours", IVCS.WORKINGTREE );
doReturn( new FileInputStream( theirs ) ).when( uiGit ).open( "test.kjb.theirs", IVCS.WORKINGTREE );
controller.visualdiff();
FileUtils.deleteDirectory( dir );
verify( uiGit ).open( "test.kjb.ours", IVCS.WORKINGTREE );
verify( uiGit ).open( "test.kjb.theirs", IVCS.WORKINGTREE );
verify( controller, times( 2 ) ).loadMainPerspective();
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:39,代码来源:GitControllerTest.java
示例3: shouldInitializeGitOnAccept
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void shouldInitializeGitOnAccept() throws Exception {
XulConfirmBox confirm = new XulConfirmBoxMock( XulDialogCallback.Status.ACCEPT );
when( document.createElement( CONFIRMBOX ) ).thenReturn( confirm );
XulMessageBox message = new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT );
when( document.createElement( MESSAGEBOX ) ).thenReturn( message );
controller.initGit( "random-path" );
verify( uiGit ).initRepo( anyString() );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:12,代码来源:GitControllerTest.java
示例4: shouldNotInitializeGitOnCencel
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void shouldNotInitializeGitOnCencel() throws Exception {
XulConfirmBox confirm = new XulConfirmBoxMock( XulDialogCallback.Status.CANCEL );
when( document.createElement( CONFIRMBOX ) ).thenReturn( confirm );
controller.initGit( "random-path" );
verify( uiGit, never() ).initRepo( anyString() );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:10,代码来源:GitControllerTest.java
示例5: shouldNotCommitWhenNoStagedObjects
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void shouldNotCommitWhenNoStagedObjects() throws Exception {
XulMessageBox message = new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT );
when( document.createElement( MESSAGEBOX ) ).thenReturn( message );
doReturn( false ).when( uiGit ).hasStagedFiles();
controller.commit();
verify( uiGit, never() ).commit( any(), anyString() );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:11,代码来源:GitControllerTest.java
示例6: shouldCommit
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void shouldCommit() throws Exception {
XulMessageBox message = new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT );
when( document.getElementById( MESSAGEBOX ) ).thenReturn( message );
doReturn( true ).when( uiGit ).hasStagedFiles();
controller.commit();
verify( uiGit ).commit( any(), anyString() );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:11,代码来源:GitControllerTest.java
示例7: shouldNotEditRemoteOnCancel
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void shouldNotEditRemoteOnCancel() throws Exception {
XulPromptBox prompt = new XulPromptBoxMock( XulDialogCallback.Status.CANCEL );
when( document.createElement( PROMPTBOX ) ).thenReturn( prompt );
controller.editRemote();
verify( uiGit, never() ).addRemote( anyString() );
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:10,代码来源:GitControllerTest.java
示例8: open
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Override
public int open() {
for ( XulDialogCallback<String> callback : callbacks ) {
callback.onClose( null, status, null );
}
return 0;
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:8,代码来源:GitControllerTest.java
示例9: shouldNotCreateFolderOnCloseCreationDialog
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void shouldNotCreateFolderOnCloseCreationDialog() throws Exception {
XulPromptBox prompt = new XulPromptBoxMock( XulDialogCallback.Status.CANCEL );
when( document.createElement( PROMPTBOX ) ).thenReturn( prompt );
controller.createFolder();
assertTrue( directoryMap.isEmpty() );
verify( selectedFolder, never() ).createFolder( anyString() );
verify( directoryBinding, never() ).fireSourceChanged();
verify( selectedItemsBinding, never() ).fireSourceChanged();
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:13,代码来源:BrowseControllerTest.java
示例10: shouldCreateFolderOnAcceptCreationDialog
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Test
public void shouldCreateFolderOnAcceptCreationDialog() throws Exception {
XulPromptBox prompt = new XulPromptBoxMock( XulDialogCallback.Status.ACCEPT );
when( document.createElement( PROMPTBOX ) ).thenReturn( prompt );
controller.createFolder();
assertFalse( directoryMap.isEmpty() );
verify( selectedFolder ).createFolder( anyString() );
verify( directoryBinding ).fireSourceChanged();
verify( selectedItemsBinding ).fireSourceChanged();
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:13,代码来源:BrowseControllerTest.java
示例11: open
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
@Override
public int open() {
for ( XulDialogCallback<String> callback : callbacks ) {
callback.onClose( null, status, FOLDER_NAME );
}
return 0;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:8,代码来源:BrowseControllerTest.java
示例12: XulConfirmBoxMock
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
public XulConfirmBoxMock( XulDialogCallback.Status status ) {
super( CONFIRMBOX );
this.status = status;
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:5,代码来源:GitControllerTest.java
示例13: XulMessageBoxMock
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
public XulMessageBoxMock( XulDialogCallback.Status status ) {
super( MESSAGEBOX );
this.status = status;
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:5,代码来源:GitControllerTest.java
示例14: XulPromptBoxMock
import org.pentaho.ui.xul.util.XulDialogCallback; //导入依赖的package包/类
public XulPromptBoxMock( XulDialogCallback.Status status ) {
super( PROMPTBOX );
this.status = status;
}
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:5,代码来源:GitControllerTest.java
注:本文中的org.pentaho.ui.xul.util.XulDialogCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论