Skip to content

Commit

Permalink
More work bitrepository module
Browse files Browse the repository at this point in the history
  • Loading branch information
Søren Vejrup Carlsen committed Sep 15, 2015
1 parent 618a86e commit 4cb48bb
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Expand Up @@ -5,10 +5,14 @@ jdk:

script: mvn test -B -fae


before_install:
- pip install --user codecov
after_success:
- codecov
#before_install:
# - mvn install:install-file -Dfile=sb-nexus/mg4j-1.0.1.jar -DpomFile=sb-nexus/mg4j-1.0.1.pom
# - mvn install:install-file -Dfile=sb-nexus/je-3.3.82.jar -DpomFile=sb-nexus/je-3.3.82.pom
# - mvn install:install-file -Dfile=sb-nexus/wayback-core-1.8.0-20130411.jar -DpomFile=sb-nexus/wayback-core-1.8.0-20130411.pom
# - mvn install:install-file -Dfile=sb-nexus/ia-web-commons-1.0-20130411.jar -DpomFile=sb-nexus/ia-web-commons-1.0-20130411.pom
# - mvn install:install-file -Dfile=sb-nexus/heritrix-1.14.4.jar -DpomFile=sb-nexus/heritrix-1.14.4.pom

Expand Up @@ -301,8 +301,8 @@ public boolean existsInCollection(String packageId, String collectionID) {

output.debug("Instantiation GetFileID outputFormatter.");
// TODO: change to non pagingClient
GetFileIDsOutputFormatter outputFormatter = new GetFileIDsInfoFormatter(output);

GetFileIDsInfoFormatter outputFormatter = new GetFileIDsInfoFormatter(output);
long timeout = getClientTimeout(bitmagSettings);

output.debug("Instantiation GetFileID paging client.");
Expand Down Expand Up @@ -461,17 +461,16 @@ public List<String> getFileIds(String regex, String collectionID) {

output.debug("Instantiation GetFileID outputFormatter.");
// TODO: change to non pagingClient
GetFileIDsOutputFormatter outputFormatter = new GetFileIDsInfoFormatter(output);
GetFileIDsListFormatter outputFormatter = new GetFileIDsListFormatter(output);

long timeout = getClientTimeout(bitmagSettings);

output.debug("Instantiation GetFileID paging client.");
PagingGetFileIDsClient pagingClient = new PagingGetFileIDsClient(
bitMagGetFileIDsClient, timeout, outputFormatter, output);

Boolean success = pagingClient.getFileIDs(collectionID, "packageId",
getCollectionPillars(collectionID));
return null;
return outputFormatter.getFoundIds();
}


Expand Down
@@ -0,0 +1,36 @@
package dk.netarkivet.common.distribute.arcrepository.bitrepository;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;


import org.bitrepository.commandline.output.OutputHandler;
import org.bitrepository.commandline.outputformatter.GetFileIDsOutputFormatter;
import org.bitrepository.commandline.resultmodel.FileIDsResult;

public class GetFileIDsListFormatter implements GetFileIDsOutputFormatter {

List<String> result = new ArrayList<String>();
//private OutputHandler outputHandler;

public GetFileIDsListFormatter(OutputHandler outputHandler) {
//this.outputHandler = outputHandler;
}

@Override
public void formatHeader() {
}

@Override
public void formatResult(Collection<FileIDsResult> results) {
for (FileIDsResult a: results) {
result.add(a.getID());
}
}

public List<String> getFoundIds() {
return result;
}

}
19 changes: 19 additions & 0 deletions pom.xml
Expand Up @@ -483,6 +483,25 @@
<autoversionsubmodules>true</autoversionsubmodules>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 4cb48bb

Please sign in to comment.