Program: 6311
Project: 6311
Buggy source:
@Test public void testSystemArtifacts() throws Exception {
  Id.Artifact defaultId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),addAppArtifact(defaultId,WordCountApp.class).getStatusLine().getStatusCode());
  Id.Artifact systemId=Id.Artifact.from(Id.Namespace.SYSTEM,"String_Node_Str","String_Node_Str");
  File systemArtifact=buildAppArtifact(WordCountApp.class,"String_Node_Str");
  artifactRepository.addArtifact(systemId,systemArtifact,Sets.<ArtifactRange>newHashSet());
  Set<ArtifactSummary> expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.USER),new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.SYSTEM));
  Set<ArtifactSummary> actualArtifacts=getArtifacts(Id.Namespace.DEFAULT);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.SYSTEM));
  actualArtifacts=getArtifacts(Id.Namespace.DEFAULT,ArtifactScope.SYSTEM);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.USER));
  actualArtifacts=getArtifacts(Id.Namespace.DEFAULT,ArtifactScope.USER);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.USER));
  actualArtifacts=getArtifacts(Id.Namespace.DEFAULT,"String_Node_Str",ArtifactScope.USER);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.SYSTEM));
  actualArtifacts=getArtifacts(Id.Namespace.DEFAULT,"String_Node_Str",ArtifactScope.SYSTEM);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  ArtifactClasses classes=ArtifactClasses.builder().addApp(new ApplicationClass(WordCountApp.class.getName(),"String_Node_Str",null)).build();
  ArtifactInfo expectedInfo=new ArtifactInfo("String_Node_Str","String_Node_Str",ArtifactScope.USER,classes,ImmutableMap.<String,String>of());
  ArtifactInfo actualInfo=getArtifact(defaultId,ArtifactScope.USER);
  Assert.assertEquals(expectedInfo,actualInfo);
  expectedInfo=new ArtifactInfo("String_Node_Str","String_Node_Str",ArtifactScope.SYSTEM,classes,ImmutableMap.<String,String>of());
  actualInfo=getArtifact(defaultId,ArtifactScope.SYSTEM);
  Assert.assertEquals(expectedInfo,actualInfo);
}

Fixed version (ground truth):
@Test public void testSystemArtifacts() throws Exception {
  Id.Artifact defaultId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),addAppArtifact(defaultId,WordCountApp.class).getStatusLine().getStatusCode());
  Id.Artifact systemId=Id.Artifact.from(Id.Namespace.SYSTEM,"String_Node_Str","String_Node_Str");
  File systemArtifact=buildAppArtifact(WordCountApp.class,"String_Node_Str");
  artifactRepository.addArtifact(systemId,systemArtifact,new HashSet<ArtifactRange>());
  Set<ArtifactSummary> expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.USER),new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.SYSTEM));
  Set<ArtifactSummary> actualArtifacts=getArtifacts(Id.Namespace.DEFAULT);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.SYSTEM));
  actualArtifacts=getArtifacts(Id.Namespace.DEFAULT,ArtifactScope.SYSTEM);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.USER));
  actualArtifacts=getArtifacts(Id.Namespace.DEFAULT,ArtifactScope.USER);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.USER));
  actualArtifacts=getArtifacts(Id.Namespace.DEFAULT,"String_Node_Str",ArtifactScope.USER);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  expectedArtifacts=Sets.newHashSet(new ArtifactSummary("String_Node_Str","String_Node_Str",ArtifactScope.SYSTEM));
  actualArtifacts=getArtifacts(Id.Namespace.DEFAULT,"String_Node_Str",ArtifactScope.SYSTEM);
  Assert.assertEquals(expectedArtifacts,actualArtifacts);
  ArtifactClasses classes=ArtifactClasses.builder().addApp(new ApplicationClass(WordCountApp.class.getName(),"String_Node_Str",null)).build();
  ArtifactInfo expectedInfo=new ArtifactInfo("String_Node_Str","String_Node_Str",ArtifactScope.USER,classes,ImmutableMap.<String,String>of());
  ArtifactInfo actualInfo=getArtifact(defaultId,ArtifactScope.USER);
  Assert.assertEquals(expectedInfo,actualInfo);
  expectedInfo=new ArtifactInfo("String_Node_Str","String_Node_Str",ArtifactScope.SYSTEM,classes,ImmutableMap.<String,String>of());
  actualInfo=getArtifact(defaultId,ArtifactScope.SYSTEM);
  Assert.assertEquals(expectedInfo,actualInfo);
}