@Test public void testStatus() throws Exception { final ScmFileSet testFileSet = getScmFileSet(); File keptFile = new File( "kept/file" ); File keptAdded = new File( "kept/added" ); File keptDefunct = new File( "kept/defunct" ); File modifiedFile = new File( "modified/file" ); File modifiedAdded = new File( "modified/added" ); File missingFile = new File( "missing/file" ); File externalFile = new File( "external/file" ); when( accurev.stat( eq( basedir ), anyListOf( File.class ), eq( AccuRevStat.DEFUNCT ) ) ).thenReturn( Arrays.asList( keptDefunct ) ); when( accurev.stat( eq( basedir ), anyListOf( File.class ), eq( AccuRevStat.MODIFIED ) ) ).thenReturn( Arrays.asList( modifiedFile,modifiedAdded ) ); when( accurev.stat( eq( basedir ), anyListOf( File.class ), eq( AccuRevStat.KEPT ) ) ).thenReturn( Arrays.asList( keptDefunct, keptFile, keptAdded ) ); when( accurev.stat( eq( basedir ), anyListOf( File.class ), eq( AccuRevStat.MISSING ) ) ).thenReturn( Arrays.asList( missingFile ) ); when( accurev.stat( eq( basedir ), anyListOf( File.class ), eq( AccuRevStat.EXTERNAL ) ) ).thenReturn( Arrays.asList( externalFile ) ); CategorisedElements catElems = new CategorisedElements(); catElems.getMemberElements().addAll( Arrays.asList( modifiedFile, keptFile ) ); catElems.getNonMemberElements().addAll( Arrays.asList( modifiedAdded, keptAdded ) ); when( accurev.statBackingStream( eq( basedir ), (Collection<File>) argThat( hasItems( modifiedFile, modifiedAdded, keptFile, keptAdded ) ) ) ).thenReturn( catElems ); AccuRevStatusCommand command = new AccuRevStatusCommand( getLogger() ); CommandParameters commandParameters = new CommandParameters(); StatusScmResult result = command.status( repo, testFileSet, commandParameters ); assertThat( result.isSuccess(), is( true ) ); assertThat( result.getChangedFiles().size(), is( 7 ) ); assertThat( (List<ScmFile>) result.getChangedFiles(), not( Matchers.<ScmFile>hasItem( scmFile( "kept/defunct", ScmFileStatus.MODIFIED ) ) ) ); assertHasScmFile( result.getChangedFiles(), "kept/file", ScmFileStatus.MODIFIED ); assertHasScmFile( result.getChangedFiles(), "kept/added", ScmFileStatus.ADDED ); assertHasScmFile( result.getChangedFiles(), "kept/defunct", ScmFileStatus.DELETED ); assertHasScmFile( result.getChangedFiles(), "modified/file", ScmFileStatus.MODIFIED ); assertHasScmFile( result.getChangedFiles(), "modified/added", ScmFileStatus.ADDED ); assertHasScmFile( result.getChangedFiles(), "missing/file", ScmFileStatus.MISSING ); assertHasScmFile( result.getChangedFiles(), "external/file", ScmFileStatus.UNKNOWN ); }
public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (StatusScmResult) execute( repository, fileSet, parameters ); }
AccuRevStatusCommand extends AbstractAccuRevCommand { public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (StatusScmResult) execute( repository, fileSet, parameters ); } }
AccuRevStatusCommand extends AbstractAccuRevCommand { public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (StatusScmResult) execute( repository, fileSet, parameters ); } AccuRevStatusCommand( ScmLogger logger ); }
AccuRevStatusCommand extends AbstractAccuRevCommand { public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (StatusScmResult) execute( repository, fileSet, parameters ); } AccuRevStatusCommand( ScmLogger logger ); StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ); }
AccuRevStatusCommand extends AbstractAccuRevCommand { public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (StatusScmResult) execute( repository, fileSet, parameters ); } AccuRevStatusCommand( ScmLogger logger ); StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters );  }