projects
/
Sone.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c8b9bb5
)
Rename fetch action methods
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Thu, 8 Feb 2018 05:40:25 +0000
(06:40 +0100)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Thu, 8 Feb 2018 05:40:25 +0000
(06:40 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/core/SoneDownloader.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
patch
|
blob
|
history
src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java
patch
|
blob
|
history
diff --git
a/src/main/java/net/pterodactylus/sone/core/Core.java
b/src/main/java/net/pterodactylus/sone/core/Core.java
index
327a53c
..
ccf633c
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/Core.java
+++ b/
src/main/java/net/pterodactylus/sone/core/Core.java
@@
-691,7
+691,7
@@
public class Core extends AbstractService implements SoneProvider, PostProvider,
}
database.storeSone(sone);
soneDownloader.addSone(sone);
}
database.storeSone(sone);
soneDownloader.addSone(sone);
- soneDownloaders.execute(soneDownloader.fetchSone
WithUri
Action(sone));
+ soneDownloaders.execute(soneDownloader.fetchSone
AsUsk
Action(sone));
return sone;
}
return sone;
}
@@
-1650,7
+1650,7
@@
public class Core extends AbstractService implements SoneProvider, PostProvider,
}
}
soneDownloader.addSone(sone);
}
}
soneDownloader.addSone(sone);
- soneDownloaders.execute(soneDownloader.fetchSoneAction(sone));
+ soneDownloaders.execute(soneDownloader.fetchSoneA
sSskA
ction(sone));
}
/**
}
/**
diff --git
a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java
b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java
index
161536d
..
7c71ab7
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/SoneDownloader.java
+++ b/
src/main/java/net/pterodactylus/sone/core/SoneDownloader.java
@@
-19,7
+19,7
@@
public interface SoneDownloader extends Service {
void addSone(Sone sone);
Sone fetchSone(Sone sone, FreenetURI soneUri, boolean fetchOnly);
void addSone(Sone sone);
Sone fetchSone(Sone sone, FreenetURI soneUri, boolean fetchOnly);
- Runnable fetchSone
WithUri
Action(Sone sone);
- Runnable fetchSoneAction(Sone sone);
+ Runnable fetchSone
AsUsk
Action(Sone sone);
+ Runnable fetchSoneA
sSskA
ction(Sone sone);
}
}
diff --git
a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
index
8470e49
..
9f0559c
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
+++ b/
src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
@@
-127,7
+127,7
@@
public class SoneDownloaderImpl extends AbstractService implements SoneDownloade
sone, key, newKnownGood, newSlotToo));
if (edition > sone.getLatestEdition()) {
sone.setLatestEdition(edition);
sone, key, newKnownGood, newSlotToo));
if (edition > sone.getLatestEdition()) {
sone.setLatestEdition(edition);
- new Thread(fetchSoneAction(sone),
+ new Thread(fetchSoneA
sSskA
ction(sone),
"Sone Downloader").start();
}
}
"Sone Downloader").start();
}
}
@@
-155,7
+155,7
@@
public class SoneDownloaderImpl extends AbstractService implements SoneDownloade
return (currentTimeMillis() - sone.getTime()) < DAYS.toMillis(7);
}
return (currentTimeMillis() - sone.getTime()) < DAYS.toMillis(7);
}
- private void fetchSone(Sone sone) {
+ private void fetchSone
AsSsk
(Sone sone) {
fetchSone(sone, sone.getRequestUri().sskForUSK(), false);
}
fetchSone(sone, sone.getRequestUri().sskForUSK(), false);
}
@@
-231,7
+231,7
@@
public class SoneDownloaderImpl extends AbstractService implements SoneDownloade
}
@Override
}
@Override
- public Runnable fetchSone
WithUri
Action(final Sone sone) {
+ public Runnable fetchSone
AsUsk
Action(final Sone sone) {
return new Runnable() {
@Override
public void run() {
return new Runnable() {
@Override
public void run() {
@@
-241,11
+241,11
@@
public class SoneDownloaderImpl extends AbstractService implements SoneDownloade
}
@Override
}
@Override
- public Runnable fetchSoneAction(final Sone sone) {
+ public Runnable fetchSoneA
sSskA
ction(final Sone sone) {
return new Runnable() {
@Override
public void run() {
return new Runnable() {
@Override
public void run() {
- fetchSone(sone);
+ fetchSone
AsSsk
(sone);
}
};
}
}
};
}
diff --git
a/src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java
b/src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java
index
be697b3
..
f879cac
100644
(file)
--- a/
src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java
+++ b/
src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java
@@
-109,7
+109,7
@@
public class SoneDownloaderTest {
FreenetURI finalRequestUri = requestUri.sskForUSK()
.setMetaString(new String[] { "sone.xml" });
setupSoneAsUnknown();
FreenetURI finalRequestUri = requestUri.sskForUSK()
.setMetaString(new String[] { "sone.xml" });
setupSoneAsUnknown();
- soneDownloader.fetchSoneAction(sone).run();
+ soneDownloader.fetchSoneA
sSskA
ction(sone).run();
verify(freenetInterface).fetchUri(finalRequestUri);
verifyThatSoneStatusWasChangedToDownloadingAndBackTo(unknown);
verify(core, never()).updateSone(any(Sone.class));
verify(freenetInterface).fetchUri(finalRequestUri);
verifyThatSoneStatusWasChangedToDownloadingAndBackTo(unknown);
verify(core, never()).updateSone(any(Sone.class));
@@
-126,7
+126,7
@@
public class SoneDownloaderTest {
public void notBeingAbleToFetchAKnownSoneDoesNotUpdateCore() {
FreenetURI finalRequestUri = requestUri.sskForUSK()
.setMetaString(new String[] { "sone.xml" });
public void notBeingAbleToFetchAKnownSoneDoesNotUpdateCore() {
FreenetURI finalRequestUri = requestUri.sskForUSK()
.setMetaString(new String[] { "sone.xml" });
- soneDownloader.fetchSoneAction(sone).run();
+ soneDownloader.fetchSoneA
sSskA
ction(sone).run();
verify(freenetInterface).fetchUri(finalRequestUri);
verifyThatSoneStatusWasChangedToDownloadingAndBackTo(idle);
verify(core, never()).updateSone(any(Sone.class));
verify(freenetInterface).fetchUri(finalRequestUri);
verifyThatSoneStatusWasChangedToDownloadingAndBackTo(idle);
verify(core, never()).updateSone(any(Sone.class));
@@
-139,7
+139,7
@@
public class SoneDownloaderTest {
setupSoneAsUnknown();
when(freenetInterface.fetchUri(finalRequestUri)).thenThrow(NullPointerException.class);
try {
setupSoneAsUnknown();
when(freenetInterface.fetchUri(finalRequestUri)).thenThrow(NullPointerException.class);
try {
- soneDownloader.fetchSoneAction(sone).run();
+ soneDownloader.fetchSoneA
sSskA
ction(sone).run();
} finally {
verify(freenetInterface).fetchUri(finalRequestUri);
verifyThatSoneStatusWasChangedToDownloadingAndBackTo(unknown);
} finally {
verify(freenetInterface).fetchUri(finalRequestUri);
verifyThatSoneStatusWasChangedToDownloadingAndBackTo(unknown);
@@
-153,7
+153,7
@@
public class SoneDownloaderTest {
.setMetaString(new String[] { "sone.xml" });
when(freenetInterface.fetchUri(finalRequestUri)).thenThrow( NullPointerException.class);
try {
.setMetaString(new String[] { "sone.xml" });
when(freenetInterface.fetchUri(finalRequestUri)).thenThrow( NullPointerException.class);
try {
- soneDownloader.fetchSoneAction(sone).run();
+ soneDownloader.fetchSoneA
sSskA
ction(sone).run();
} finally {
verify(freenetInterface).fetchUri(finalRequestUri);
verifyThatSoneStatusWasChangedToDownloadingAndBackTo(idle);
} finally {
verify(freenetInterface).fetchUri(finalRequestUri);
verifyThatSoneStatusWasChangedToDownloadingAndBackTo(idle);
@@
-165,7
+165,7
@@
public class SoneDownloaderTest {
public void fetchingSoneWithInvalidXmlWillNotUpdateTheCore() throws IOException {
final Fetched fetchResult = createFetchResult(requestUri, getClass().getResourceAsStream("sone-parser-not-xml.xml"));
when(freenetInterface.fetchUri(requestUri)).thenReturn(fetchResult);
public void fetchingSoneWithInvalidXmlWillNotUpdateTheCore() throws IOException {
final Fetched fetchResult = createFetchResult(requestUri, getClass().getResourceAsStream("sone-parser-not-xml.xml"));
when(freenetInterface.fetchUri(requestUri)).thenReturn(fetchResult);
- soneDownloader.fetchSoneAction(sone).run();
+ soneDownloader.fetchSoneA
sSskA
ction(sone).run();
verify(core, never()).updateSone(any(Sone.class));
}
verify(core, never()).updateSone(any(Sone.class));
}
@@
-174,7
+174,7
@@
public class SoneDownloaderTest {
final Fetched fetchResult = createFetchResult(requestUri, getClass().getResourceAsStream("sone-parser-no-payload.xml"));
when(core.soneBuilder()).thenReturn(null);
when(freenetInterface.fetchUri(requestUri)).thenReturn(fetchResult);
final Fetched fetchResult = createFetchResult(requestUri, getClass().getResourceAsStream("sone-parser-no-payload.xml"));
when(core.soneBuilder()).thenReturn(null);
when(freenetInterface.fetchUri(requestUri)).thenReturn(fetchResult);
- soneDownloader.fetchSoneAction(sone).run();
+ soneDownloader.fetchSoneA
sSskA
ction(sone).run();
verify(core, never()).updateSone(any(Sone.class));
}
verify(core, never()).updateSone(any(Sone.class));
}