target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testEquality() { LibraryVersion testee1 = new LibraryVersion("10.0.1-1234"); LibraryVersion testee2 = new LibraryVersion(10, 0, 1, 1234); assertTrue(testee1.equals(testee2)); assertEquals(testee1, testee2); assertFalse(new LibraryVersion("10.1.1-1234").equals(new LibraryVersion(10, 1, 1, 123))); asser...
public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); }
LibraryVersion { public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); } }
LibraryVersion { public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); } LibraryVersion(String version); LibraryVersion(int major, int minor, int sub, int build); LibraryVersion(int major, int minor, int sub); LibraryVersion(int major, int minor); LibraryVersion(int major); }
LibraryVersion { public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); } LibraryVersion(String version); LibraryVersion(int major, int minor, int sub, int build); LibraryVersion(int major, int minor, int sub); LibraryVersion(int major, int minor); LibraryVersion(int major); boolean ...
LibraryVersion { public boolean equals(LibraryVersion v) { return v.toString().equals(this.toString()); } LibraryVersion(String version); LibraryVersion(int major, int minor, int sub, int build); LibraryVersion(int major, int minor, int sub); LibraryVersion(int major, int minor); LibraryVersion(int major); boolean ...
@Test public void testSwagger() throws JsonProcessingException { String response = testee.getSwagger(); assertTrue(response.contains("getHello")); }
public final String getSwagger() throws JsonProcessingException { Swagger swagger = new Reader(new Swagger()).read(this.application.getClasses()); return Json.mapper().writeValueAsString(swagger); }
RESTService extends Service { public final String getSwagger() throws JsonProcessingException { Swagger swagger = new Reader(new Swagger()).read(this.application.getClasses()); return Json.mapper().writeValueAsString(swagger); } }
RESTService extends Service { public final String getSwagger() throws JsonProcessingException { Swagger swagger = new Reader(new Swagger()).read(this.application.getClasses()); return Json.mapper().writeValueAsString(swagger); } RESTService(); }
RESTService extends Service { public final String getSwagger() throws JsonProcessingException { Swagger swagger = new Reader(new Swagger()).read(this.application.getClasses()); return Json.mapper().writeValueAsString(swagger); } RESTService(); final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[]...
RESTService extends Service { public final String getSwagger() throws JsonProcessingException { Swagger swagger = new Reader(new Swagger()).read(this.application.getClasses()); return Json.mapper().writeValueAsString(swagger); } RESTService(); final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[]...
@Test public void testStringRepresentation() { assertEquals("10.0.1-1234", new LibraryVersion(10, 0, 1, 1234).toString()); assertEquals("10.0-1234", new LibraryVersion("10.0-1234").toString()); assertEquals("10-1234", new LibraryVersion("10-1234").toString()); assertEquals("10.0.1", new LibraryVersion(10, 0, 1).toStrin...
@Override public String toString() { String result = "" + major; if (minor != null) { result += "." + minor; if (sub != null) result += "." + sub; } if (build != null) result += "-" + build; return result; }
LibraryVersion { @Override public String toString() { String result = "" + major; if (minor != null) { result += "." + minor; if (sub != null) result += "." + sub; } if (build != null) result += "-" + build; return result; } }
LibraryVersion { @Override public String toString() { String result = "" + major; if (minor != null) { result += "." + minor; if (sub != null) result += "." + sub; } if (build != null) result += "-" + build; return result; } LibraryVersion(String version); LibraryVersion(int major, int minor, int sub, int build); Lib...
LibraryVersion { @Override public String toString() { String result = "" + major; if (minor != null) { result += "." + minor; if (sub != null) result += "." + sub; } if (build != null) result += "-" + build; return result; } LibraryVersion(String version); LibraryVersion(int major, int minor, int sub, int build); Lib...
LibraryVersion { @Override public String toString() { String result = "" + major; if (minor != null) { result += "." + minor; if (sub != null) result += "." + sub; } if (build != null) result += "-" + build; return result; } LibraryVersion(String version); LibraryVersion(int major, int minor, int sub, int build); Lib...
@Test public void testEquality() { assertEquals(new LibraryIdentifier("testname;version=\"1.0.1-22\""), "testname;version=\"1.0.1-22\""); assertFalse(new LibraryIdentifier("testname;version=\"1.0.1-22\"").equals("tstname;version=\"1.0.1-22\"")); }
public boolean equals(LibraryIdentifier i) { return this.toString().equals(i.toString()); }
LibraryIdentifier { public boolean equals(LibraryIdentifier i) { return this.toString().equals(i.toString()); } }
LibraryIdentifier { public boolean equals(LibraryIdentifier i) { return this.toString().equals(i.toString()); } LibraryIdentifier(String name); LibraryIdentifier(String name, String version); LibraryIdentifier(String name, LibraryVersion version); }
LibraryIdentifier { public boolean equals(LibraryIdentifier i) { return this.toString().equals(i.toString()); } LibraryIdentifier(String name); LibraryIdentifier(String name, String version); LibraryIdentifier(String name, LibraryVersion version); static LibraryIdentifier fromFilename(String filename); LibraryVersion...
LibraryIdentifier { public boolean equals(LibraryIdentifier i) { return this.toString().equals(i.toString()); } LibraryIdentifier(String name); LibraryIdentifier(String name, String version); LibraryIdentifier(String name, LibraryVersion version); static LibraryIdentifier fromFilename(String filename); LibraryVersion...
@Test public void testFromFilename() { try { LibraryIdentifier testFull = LibraryIdentifier .fromFilename("service/i5.las2peer.services.testService-4.2.jar"); Assert.assertEquals("i5.las2peer.services.testService", testFull.getName()); Assert.assertEquals("4.2", testFull.getVersion().toString()); LibraryIdentifier test...
public static LibraryIdentifier fromFilename(String filename) { String fileNameWithOutExt = new File(filename).getName().replaceFirst("[.][^.]+$", ""); Pattern versionPattern = Pattern.compile("-[0-9]+(?:.[0-9]+(?:.[0-9]+)?)?(?:-[0-9]+)?$"); Matcher m = versionPattern.matcher(fileNameWithOutExt); String sName = null; S...
LibraryIdentifier { public static LibraryIdentifier fromFilename(String filename) { String fileNameWithOutExt = new File(filename).getName().replaceFirst("[.][^.]+$", ""); Pattern versionPattern = Pattern.compile("-[0-9]+(?:.[0-9]+(?:.[0-9]+)?)?(?:-[0-9]+)?$"); Matcher m = versionPattern.matcher(fileNameWithOutExt); St...
LibraryIdentifier { public static LibraryIdentifier fromFilename(String filename) { String fileNameWithOutExt = new File(filename).getName().replaceFirst("[.][^.]+$", ""); Pattern versionPattern = Pattern.compile("-[0-9]+(?:.[0-9]+(?:.[0-9]+)?)?(?:-[0-9]+)?$"); Matcher m = versionPattern.matcher(fileNameWithOutExt); St...
LibraryIdentifier { public static LibraryIdentifier fromFilename(String filename) { String fileNameWithOutExt = new File(filename).getName().replaceFirst("[.][^.]+$", ""); Pattern versionPattern = Pattern.compile("-[0-9]+(?:.[0-9]+(?:.[0-9]+)?)?(?:-[0-9]+)?$"); Matcher m = versionPattern.matcher(fileNameWithOutExt); St...
LibraryIdentifier { public static LibraryIdentifier fromFilename(String filename) { String fileNameWithOutExt = new File(filename).getName().replaceFirst("[.][^.]+$", ""); Pattern versionPattern = Pattern.compile("-[0-9]+(?:.[0-9]+(?:.[0-9]+)?)?(?:-[0-9]+)?$"); Matcher m = versionPattern.matcher(fileNameWithOutExt); St...
@Test public void testStringGetter() throws IOException, LibraryNotFoundException, ResourceNotFoundException { LoadedJarLibrary testee = LoadedJarLibrary .createFromJar("export/jars/i5.las2peer.classLoaders.testPackage1-1.1.jar"); String test = testee.getResourceAsString("i5/las2peer/classLoaders/testPackage1/test.prop...
public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVersion = jfFile.getManifest().getMainAttribu...
LoadedJarLibrary extends LoadedLibrary { public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVers...
LoadedJarLibrary extends LoadedLibrary { public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVers...
LoadedJarLibrary extends LoadedLibrary { public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVers...
LoadedJarLibrary extends LoadedLibrary { public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVers...
@Test public void testBinaryContent() throws IOException, LibraryNotFoundException, ResourceNotFoundException { LoadedJarLibrary testee = LoadedJarLibrary .createFromJar("export/jars/i5.las2peer.classLoaders.testPackage1-1.1.jar"); byte[] result = testee.getResourceAsBinary("i5/las2peer/classLoaders/testPackage1/test.p...
public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVersion = jfFile.getManifest().getMainAttribu...
LoadedJarLibrary extends LoadedLibrary { public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVers...
LoadedJarLibrary extends LoadedLibrary { public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVers...
LoadedJarLibrary extends LoadedLibrary { public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVers...
LoadedJarLibrary extends LoadedLibrary { public static LoadedJarLibrary createFromJar(String filename) throws IllegalArgumentException, IOException { JarFile jfFile = new JarFile(filename); String sName = jfFile.getManifest().getMainAttributes() .getValue(LibraryIdentifier.MANIFEST_LIBRARY_NAME_ATTRIBUTE); String sVers...
@Test public void testResourceToClassName() { assertEquals("test.bla.Class", LoadedLibrary.resourceToClassName("test/bla/Class.class")); try { LoadedLibrary.resourceToClassName("test.clas"); fail("IllegalArgumentException should have been thrown"); } catch (IllegalArgumentException e) { } }
public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); }
LoadedLibrary { public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); } }
LoadedLibrary { public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); } LoadedLibrary(String libraryIdentifier); LoadedLibrary(Library...
LoadedLibrary { public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); } LoadedLibrary(String libraryIdentifier); LoadedLibrary(Library...
LoadedLibrary { public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); } LoadedLibrary(String libraryIdentifier); LoadedLibrary(Library...
@Test public void testClassToResourceName() { assertEquals("test/bla/Class.class", LoadedLibrary.classToResourceName("test.bla.Class")); assertEquals("Class.class", LoadedLibrary.classToResourceName("Class")); }
public static String classToResourceName(String className) { return className.replace('.', '/') + ".class"; }
LoadedLibrary { public static String classToResourceName(String className) { return className.replace('.', '/') + ".class"; } }
LoadedLibrary { public static String classToResourceName(String className) { return className.replace('.', '/') + ".class"; } LoadedLibrary(String libraryIdentifier); LoadedLibrary(LibraryIdentifier lib); }
LoadedLibrary { public static String classToResourceName(String className) { return className.replace('.', '/') + ".class"; } LoadedLibrary(String libraryIdentifier); LoadedLibrary(LibraryIdentifier lib); LibraryIdentifier getLibraryIdentifier(); abstract URL getResourceAsUrl(String name); String getResourceAsString(...
LoadedLibrary { public static String classToResourceName(String className) { return className.replace('.', '/') + ".class"; } LoadedLibrary(String libraryIdentifier); LoadedLibrary(LibraryIdentifier lib); LibraryIdentifier getLibraryIdentifier(); abstract URL getResourceAsUrl(String name); String getResourceAsString(...
@Test public void testGetLastModified() throws InterruptedException { File f = new File("export" + File.separator + "jars" + File.separator); long date1 = FileSystemRepository.getLastModified(f, true); assertTrue(date1 > 0); Thread.sleep(2000); new File("export" + File.separator + "jars" + File.separator + "i5.las2peer...
public static long getLastModified(File dir, boolean recursive) { File[] files = dir.listFiles(); if (files == null || files.length == 0) { return dir.lastModified(); } long lastModified = 0; for (File f : files) { if (f.isDirectory() && recursive) { long ll = getLastModified(f, recursive); if (lastModified < ll) { las...
FileSystemRepository implements Repository { public static long getLastModified(File dir, boolean recursive) { File[] files = dir.listFiles(); if (files == null || files.length == 0) { return dir.lastModified(); } long lastModified = 0; for (File f : files) { if (f.isDirectory() && recursive) { long ll = getLastModifie...
FileSystemRepository implements Repository { public static long getLastModified(File dir, boolean recursive) { File[] files = dir.listFiles(); if (files == null || files.length == 0) { return dir.lastModified(); } long lastModified = 0; for (File f : files) { if (f.isDirectory() && recursive) { long ll = getLastModifie...
FileSystemRepository implements Repository { public static long getLastModified(File dir, boolean recursive) { File[] files = dir.listFiles(); if (files == null || files.length == 0) { return dir.lastModified(); } long lastModified = 0; for (File f : files) { if (f.isDirectory() && recursive) { long ll = getLastModifie...
FileSystemRepository implements Repository { public static long getLastModified(File dir, boolean recursive) { File[] files = dir.listFiles(); if (files == null || files.length == 0) { return dir.lastModified(); } long lastModified = 0; for (File f : files) { if (f.isDirectory() && recursive) { long ll = getLastModifie...
@Test public void testParent2() { L2pLogger logger = L2pLogger.getInstance(L2pLoggerTest.class.getName()); assertTrue(logger instanceof L2pLogger); Logger parent = logger.getParent(); assertNotNull(parent); assertTrue(parent instanceof L2pLogger); }
public static L2pLogger getInstance(Class<?> cls) throws ClassCastException { return getInstance(cls.getCanonicalName()); }
L2pLogger extends Logger implements NodeObserver { public static L2pLogger getInstance(Class<?> cls) throws ClassCastException { return getInstance(cls.getCanonicalName()); } }
L2pLogger extends Logger implements NodeObserver { public static L2pLogger getInstance(Class<?> cls) throws ClassCastException { return getInstance(cls.getCanonicalName()); } protected L2pLogger(String name, String resourceBundleName); }
L2pLogger extends Logger implements NodeObserver { public static L2pLogger getInstance(Class<?> cls) throws ClassCastException { return getInstance(cls.getCanonicalName()); } protected L2pLogger(String name, String resourceBundleName); synchronized void printStackTrace(Throwable e); static void setGlobalLogDirectory(S...
L2pLogger extends Logger implements NodeObserver { public static L2pLogger getInstance(Class<?> cls) throws ClassCastException { return getInstance(cls.getCanonicalName()); } protected L2pLogger(String name, String resourceBundleName); synchronized void printStackTrace(Throwable e); static void setGlobalLogDirectory(S...
@Test public void testLogin() { try { Node node = new LocalNodeManager().launchNode(); UserAgentManager l = node.getUserManager(); UserAgentImpl a = UserAgentImpl.createUserAgent("pass"); a.unlock("pass"); a.setLoginName("login"); node.storeAgent(a); assertEquals(a.getIdentifier(), l.getAgentIdByLogin("login")); UserAg...
public String getAgentIdByLogin(String name) throws AgentNotFoundException, AgentOperationFailedException { if (name.equalsIgnoreCase(AnonymousAgent.LOGIN_NAME)) { return AnonymousAgentImpl.getInstance().getIdentifier(); } try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_NAME + name.toLowerCase()); return (St...
UserAgentManager { public String getAgentIdByLogin(String name) throws AgentNotFoundException, AgentOperationFailedException { if (name.equalsIgnoreCase(AnonymousAgent.LOGIN_NAME)) { return AnonymousAgentImpl.getInstance().getIdentifier(); } try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_NAME + name.toLower...
UserAgentManager { public String getAgentIdByLogin(String name) throws AgentNotFoundException, AgentOperationFailedException { if (name.equalsIgnoreCase(AnonymousAgent.LOGIN_NAME)) { return AnonymousAgentImpl.getInstance().getIdentifier(); } try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_NAME + name.toLower...
UserAgentManager { public String getAgentIdByLogin(String name) throws AgentNotFoundException, AgentOperationFailedException { if (name.equalsIgnoreCase(AnonymousAgent.LOGIN_NAME)) { return AnonymousAgentImpl.getInstance().getIdentifier(); } try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_NAME + name.toLower...
UserAgentManager { public String getAgentIdByLogin(String name) throws AgentNotFoundException, AgentOperationFailedException { if (name.equalsIgnoreCase(AnonymousAgent.LOGIN_NAME)) { return AnonymousAgentImpl.getInstance().getIdentifier(); } try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_NAME + name.toLower...
@Test public void testMainUsage() { ServiceAgentGenerator.main(new String[0]); assertTrue(("" + standardError.toString()).contains("usage:")); assertEquals("", standardOut.toString()); }
public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least " + PW_MIN_LENGTH + " s...
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least...
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least...
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least...
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least...
@Test public void testEmail() { try { Node node = new LocalNodeManager().launchNode(); UserAgentManager l = node.getUserManager(); UserAgentImpl a = UserAgentImpl.createUserAgent("pass"); a.unlock("pass"); a.setEmail("email@example.com"); node.storeAgent(a); assertEquals(a.getIdentifier(), l.getAgentIdByEmail("email@ex...
public String getAgentIdByEmail(String email) throws AgentNotFoundException, AgentOperationFailedException { try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_MAIL + email.toLowerCase()); return (String) env.getContent(); } catch (EnvelopeNotFoundException e) { throw new AgentNotFoundException("Email not found...
UserAgentManager { public String getAgentIdByEmail(String email) throws AgentNotFoundException, AgentOperationFailedException { try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_MAIL + email.toLowerCase()); return (String) env.getContent(); } catch (EnvelopeNotFoundException e) { throw new AgentNotFoundExcepti...
UserAgentManager { public String getAgentIdByEmail(String email) throws AgentNotFoundException, AgentOperationFailedException { try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_MAIL + email.toLowerCase()); return (String) env.getContent(); } catch (EnvelopeNotFoundException e) { throw new AgentNotFoundExcepti...
UserAgentManager { public String getAgentIdByEmail(String email) throws AgentNotFoundException, AgentOperationFailedException { try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_MAIL + email.toLowerCase()); return (String) env.getContent(); } catch (EnvelopeNotFoundException e) { throw new AgentNotFoundExcepti...
UserAgentManager { public String getAgentIdByEmail(String email) throws AgentNotFoundException, AgentOperationFailedException { try { EnvelopeVersion env = node.fetchEnvelope(PREFIX_USER_MAIL + email.toLowerCase()); return (String) env.getContent(); } catch (EnvelopeNotFoundException e) { throw new AgentNotFoundExcepti...
@Test public void testUnlocking() throws NoSuchAlgorithmException, CryptoException, AgentAccessDeniedException, InternalSecurityException, AgentLockedException, AgentOperationFailedException { String passphrase = "A passphrase to unlock"; UserAgentImpl a = UserAgentImpl.createUserAgent(passphrase); try { a.decryptSymme...
public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); }
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } }
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected UserAg...
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected UserAg...
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected UserAg...
@Test public void testPassphraseChange() throws NoSuchAlgorithmException, InternalSecurityException, CryptoException, AgentAccessDeniedException, AgentLockedException, AgentOperationFailedException { String passphrase = "a passphrase"; UserAgentImpl a = UserAgentImpl.createUserAgent(passphrase); String sndPass = "ein a...
public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); }
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } }
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected UserAg...
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected UserAg...
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected UserAg...
@Test public void testWrongRecipient() { try { UserAgentImpl eve = MockAgentFactory.getEve(); eve.unlock("evespass"); UserAgentImpl adam = MockAgentFactory.getAdam(); adam.unlock("adamspass"); Mediator testee = new Mediator(null, eve); Message m = new Message(eve, adam, "a message"); try { testee.receiveMessage(m, null...
@Override public void receiveMessage(Message message, AgentContext c) throws MessageException { if (!message.getRecipientId().equalsIgnoreCase(myAgent.getIdentifier())) { throw new MessageException("I'm not responsible for the receiver (something went very wrong)!"); } try { message.open(myAgent, c); if (getMyNode() !=...
Mediator implements MessageReceiver { @Override public void receiveMessage(Message message, AgentContext c) throws MessageException { if (!message.getRecipientId().equalsIgnoreCase(myAgent.getIdentifier())) { throw new MessageException("I'm not responsible for the receiver (something went very wrong)!"); } try { messag...
Mediator implements MessageReceiver { @Override public void receiveMessage(Message message, AgentContext c) throws MessageException { if (!message.getRecipientId().equalsIgnoreCase(myAgent.getIdentifier())) { throw new MessageException("I'm not responsible for the receiver (something went very wrong)!"); } try { messag...
Mediator implements MessageReceiver { @Override public void receiveMessage(Message message, AgentContext c) throws MessageException { if (!message.getRecipientId().equalsIgnoreCase(myAgent.getIdentifier())) { throw new MessageException("I'm not responsible for the receiver (something went very wrong)!"); } try { messag...
Mediator implements MessageReceiver { @Override public void receiveMessage(Message message, AgentContext c) throws MessageException { if (!message.getRecipientId().equalsIgnoreCase(myAgent.getIdentifier())) { throw new MessageException("I'm not responsible for the receiver (something went very wrong)!"); } try { messag...
@Test public void testServiceDiscovery() throws CryptoException, InternalSecurityException, AgentAlreadyRegisteredException, AgentException, MalformedXMLException, IOException, EncodingFailedException, SerializationException, InterruptedException, TimeoutException, AgentAccessDeniedException { LocalNode node = new Loca...
public static long serviceNameToTopicId(String service) { return SimpleTools.longHash(service); }
ServiceAgentImpl extends PassphraseAgentImpl implements ServiceAgent { public static long serviceNameToTopicId(String service) { return SimpleTools.longHash(service); } }
ServiceAgentImpl extends PassphraseAgentImpl implements ServiceAgent { public static long serviceNameToTopicId(String service) { return SimpleTools.longHash(service); } protected ServiceAgentImpl(ServiceNameVersion service, KeyPair pair, String passphrase, byte[] salt); protected ServiceAgentImpl(ServiceNameVersion s...
ServiceAgentImpl extends PassphraseAgentImpl implements ServiceAgent { public static long serviceNameToTopicId(String service) { return SimpleTools.longHash(service); } protected ServiceAgentImpl(ServiceNameVersion service, KeyPair pair, String passphrase, byte[] salt); protected ServiceAgentImpl(ServiceNameVersion s...
ServiceAgentImpl extends PassphraseAgentImpl implements ServiceAgent { public static long serviceNameToTopicId(String service) { return SimpleTools.longHash(service); } protected ServiceAgentImpl(ServiceNameVersion service, KeyPair pair, String passphrase, byte[] salt); protected ServiceAgentImpl(ServiceNameVersion s...
@Test public void testRequestAgent() throws MalformedXMLException, IOException, InternalSecurityException, CryptoException, SerializationException, AgentException, NodeException, AgentAccessDeniedException { LocalNode node = new LocalNodeManager().newNode(); UserAgentImpl adam = MockAgentFactory.getAdam(); adam.unlock(...
public Agent requestAgent(String agentId) throws AgentAccessDeniedException, AgentNotFoundException, AgentOperationFailedException { if (agentId.equalsIgnoreCase(getMainAgent().getIdentifier())) { return getMainAgent(); } else { try { return requestGroupAgent(agentId); } catch (AgentAccessDeniedException e) { throw new...
AgentContext implements AgentStorage { public Agent requestAgent(String agentId) throws AgentAccessDeniedException, AgentNotFoundException, AgentOperationFailedException { if (agentId.equalsIgnoreCase(getMainAgent().getIdentifier())) { return getMainAgent(); } else { try { return requestGroupAgent(agentId); } catch (Ag...
AgentContext implements AgentStorage { public Agent requestAgent(String agentId) throws AgentAccessDeniedException, AgentNotFoundException, AgentOperationFailedException { if (agentId.equalsIgnoreCase(getMainAgent().getIdentifier())) { return getMainAgent(); } else { try { return requestGroupAgent(agentId); } catch (Ag...
AgentContext implements AgentStorage { public Agent requestAgent(String agentId) throws AgentAccessDeniedException, AgentNotFoundException, AgentOperationFailedException { if (agentId.equalsIgnoreCase(getMainAgent().getIdentifier())) { return getMainAgent(); } else { try { return requestGroupAgent(agentId); } catch (Ag...
AgentContext implements AgentStorage { public Agent requestAgent(String agentId) throws AgentAccessDeniedException, AgentNotFoundException, AgentOperationFailedException { if (agentId.equalsIgnoreCase(getMainAgent().getIdentifier())) { return getMainAgent(); } else { try { return requestGroupAgent(agentId); } catch (Ag...
@Test public void testHasAccess() throws MalformedXMLException, IOException, InternalSecurityException, CryptoException, SerializationException, AgentException, NodeException, AgentAccessDeniedException { LocalNode node = new LocalNodeManager().newNode(); UserAgentImpl adam = MockAgentFactory.getAdam(); adam.unlock("ad...
public boolean hasAccess(String agentId) throws AgentNotFoundException { if (agent.getIdentifier().equals(agentId)) { return true; } AgentImpl a; try { a = getAgent(agentId); } catch (AgentException e) { throw new AgentNotFoundException("Agent could not be found!", e); } if (a instanceof GroupAgentImpl) { return isMemb...
AgentContext implements AgentStorage { public boolean hasAccess(String agentId) throws AgentNotFoundException { if (agent.getIdentifier().equals(agentId)) { return true; } AgentImpl a; try { a = getAgent(agentId); } catch (AgentException e) { throw new AgentNotFoundException("Agent could not be found!", e); } if (a ins...
AgentContext implements AgentStorage { public boolean hasAccess(String agentId) throws AgentNotFoundException { if (agent.getIdentifier().equals(agentId)) { return true; } AgentImpl a; try { a = getAgent(agentId); } catch (AgentException e) { throw new AgentNotFoundException("Agent could not be found!", e); } if (a ins...
AgentContext implements AgentStorage { public boolean hasAccess(String agentId) throws AgentNotFoundException { if (agent.getIdentifier().equals(agentId)) { return true; } AgentImpl a; try { a = getAgent(agentId); } catch (AgentException e) { throw new AgentNotFoundException("Agent could not be found!", e); } if (a ins...
AgentContext implements AgentStorage { public boolean hasAccess(String agentId) throws AgentNotFoundException { if (agent.getIdentifier().equals(agentId)) { return true; } AgentImpl a; try { a = getAgent(agentId); } catch (AgentException e) { throw new AgentNotFoundException("Agent could not be found!", e); } if (a ins...
@Test public void testCreation() { assertFalse(anonymousAgent.isLocked()); }
@Override public boolean isLocked() { return false; }
AnonymousAgentImpl extends AgentImpl implements AnonymousAgent { @Override public boolean isLocked() { return false; } }
AnonymousAgentImpl extends AgentImpl implements AnonymousAgent { @Override public boolean isLocked() { return false; } private AnonymousAgentImpl(); }
AnonymousAgentImpl extends AgentImpl implements AnonymousAgent { @Override public boolean isLocked() { return false; } private AnonymousAgentImpl(); static AnonymousAgentImpl getInstance(); @Override String toXmlString(); @Override void receiveMessage(Message message, AgentContext c); @Override void unlockPrivateKey(S...
AnonymousAgentImpl extends AgentImpl implements AnonymousAgent { @Override public boolean isLocked() { return false; } private AnonymousAgentImpl(); static AnonymousAgentImpl getInstance(); @Override String toXmlString(); @Override void receiveMessage(Message message, AgentContext c); @Override void unlockPrivateKey(S...
@Test public void testOperations() throws AgentNotFoundException, AgentException, InternalSecurityException { AnonymousAgent a = (AnonymousAgent) node.getAgent(AnonymousAgent.IDENTIFIER); assertEquals(a.getIdentifier(), AnonymousAgent.IDENTIFIER); a = (AnonymousAgent) node.getAgent(AnonymousAgent.LOGIN_NAME); assertEqu...
@Override public String getIdentifier() { return AnonymousAgent.IDENTIFIER; }
AnonymousAgentImpl extends AgentImpl implements AnonymousAgent { @Override public String getIdentifier() { return AnonymousAgent.IDENTIFIER; } }
AnonymousAgentImpl extends AgentImpl implements AnonymousAgent { @Override public String getIdentifier() { return AnonymousAgent.IDENTIFIER; } private AnonymousAgentImpl(); }
AnonymousAgentImpl extends AgentImpl implements AnonymousAgent { @Override public String getIdentifier() { return AnonymousAgent.IDENTIFIER; } private AnonymousAgentImpl(); static AnonymousAgentImpl getInstance(); @Override String toXmlString(); @Override void receiveMessage(Message message, AgentContext c); @Override...
AnonymousAgentImpl extends AgentImpl implements AnonymousAgent { @Override public String getIdentifier() { return AnonymousAgent.IDENTIFIER; } private AnonymousAgentImpl(); static AnonymousAgentImpl getInstance(); @Override String toXmlString(); @Override void receiveMessage(Message message, AgentContext c); @Override...
@Test public void testCollisionWithoutCollisionManager() { try { PastryNodeImpl node1 = nodes.get(0); UserAgentImpl smith = MockAgentFactory.getAdam(); smith.unlock("adamspass"); EnvelopeVersion envelope1 = node1.createUnencryptedEnvelope("test", smith.getPublicKey(), "Hello World 1!"); EnvelopeVersion envelope2 = node...
@Override public String toString() { return identifier + "#" + version; }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
@Test public void testMainNormal() { String className = "a.test.package.WithAService@1.0"; ServiceAgentGenerator.main(new String[] { className, "mypass" }); assertEquals("", standardError.toString()); String output = standardOut.toString(); assertTrue(output.contains("serviceclass=\"" + className + "\"")); }
public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least " + PW_MIN_LENGTH + " s...
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least...
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least...
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least...
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least...
@Test public void testCollisionWithMergeCancelation() { try { PastryNodeImpl node1 = nodes.get(0); UserAgentImpl smith = MockAgentFactory.getAdam(); smith.unlock("adamspass"); EnvelopeVersion envelope1 = node1.createUnencryptedEnvelope("test", smith.getPublicKey(), "Hello World 1!"); EnvelopeVersion envelope2 = node1.c...
@Override public String toString() { return identifier + "#" + version; }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
@Test public void testFetchNonExisting() { try { PastryNodeImpl node1 = nodes.get(0); System.out.println("Fetching artifact ..."); node1.fetchEnvelopeAsync("testtesttest", new StorageEnvelopeHandler() { @Override public void onEnvelopeReceived(EnvelopeVersion envelope) { Assert.fail("Unexpected result (" + envelope.toS...
@Override public String toString() { return identifier + "#" + version; }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
@Test public void testChangeContentType() { try { PastryNodeImpl node1 = nodes.get(0); UserAgentImpl smith = MockAgentFactory.getAdam(); smith.unlock("adamspass"); EnvelopeVersion envelope1 = node1.createUnencryptedEnvelope("test", smith.getPublicKey(), "Hello World!"); node1.storeEnvelope(envelope1, smith); EnvelopeVe...
@Override public String toString() { return identifier + "#" + version; }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
@Test public void testStoreAnonymous() { try { PastryNodeImpl node = nodes.get(0); AnonymousAgentImpl anonymous = AnonymousAgentImpl.getInstance(); node.storeAgent(anonymous); Assert.fail("Exception expected"); } catch (AgentException e) { } catch (Exception e) { e.printStackTrace(); Assert.fail(e.toString()); } }
@Override public String toString() { return identifier + "#" + version; }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } }
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
EnvelopeVersion implements Serializable, XmlAble { @Override public String toString() { return identifier + "#" + version; } private EnvelopeVersion(String identifier, long version, PublicKey authorPubKey, HashMap<PublicKey, byte[]> readerKeys, HashSet<String> readerGroupIds, byte[] rawContent); protected Envelope...
@Test public void testOpen() { try { UserAgentImpl a = UserAgentImpl.createUserAgent("passa"); UserAgentImpl b = UserAgentImpl.createUserAgent("passb"); BasicAgentStorage storage = new BasicAgentStorage(); storage.registerAgents(a, b); a.unlock("passa"); Message testee = new Message(a, b, "some content"); assertNull(te...
public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); }
Message implements XmlAble, Cloneable { public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); } }
Message implements XmlAble, Cloneable { public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); } Message(); Message(AgentImpl from, AgentImpl to, Serializable data); Message(AgentImpl from, AgentImpl to, Serializable data, long timeOutMs); Message(AgentImpl fro...
Message implements XmlAble, Cloneable { public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); } Message(); Message(AgentImpl from, AgentImpl to, Serializable data); Message(AgentImpl from, AgentImpl to, Serializable data, long timeOutMs); Message(AgentImpl fro...
Message implements XmlAble, Cloneable { public void open(AgentStorage storage) throws InternalSecurityException, AgentException { open(null, storage); } Message(); Message(AgentImpl from, AgentImpl to, Serializable data); Message(AgentImpl from, AgentImpl to, Serializable data, long timeOutMs); Message(AgentImpl fro...
@Test public void testPrintMessage() { try { UserAgentImpl eve = MockAgentFactory.getEve(); UserAgentImpl adam = MockAgentFactory.getAdam(); eve.unlock("evespass"); Message m = new Message(eve, adam, "a simple content string"); String xml = m.toXmlString(); System.out.println("------ XML message output ------"); System...
@Override public String toXmlString() { String response = ""; if (responseToId != null) { response = " responseTo=\"" + responseToId + "\""; } String sending = ""; if (sendingNodeId != null) { if (sendingNodeId instanceof Long || sendingNodeId instanceof NodeHandle) { try { sending = "\t<sendingNode encoding=\"base64\"...
Message implements XmlAble, Cloneable { @Override public String toXmlString() { String response = ""; if (responseToId != null) { response = " responseTo=\"" + responseToId + "\""; } String sending = ""; if (sendingNodeId != null) { if (sendingNodeId instanceof Long || sendingNodeId instanceof NodeHandle) { try { sendi...
Message implements XmlAble, Cloneable { @Override public String toXmlString() { String response = ""; if (responseToId != null) { response = " responseTo=\"" + responseToId + "\""; } String sending = ""; if (sendingNodeId != null) { if (sendingNodeId instanceof Long || sendingNodeId instanceof NodeHandle) { try { sendi...
Message implements XmlAble, Cloneable { @Override public String toXmlString() { String response = ""; if (responseToId != null) { response = " responseTo=\"" + responseToId + "\""; } String sending = ""; if (sendingNodeId != null) { if (sendingNodeId instanceof Long || sendingNodeId instanceof NodeHandle) { try { sendi...
Message implements XmlAble, Cloneable { @Override public String toXmlString() { String response = ""; if (responseToId != null) { response = " responseTo=\"" + responseToId + "\""; } String sending = ""; if (sendingNodeId != null) { if (sendingNodeId instanceof Long || sendingNodeId instanceof NodeHandle) { try { sendi...
@Test public void testStoreAnonymous() { try { AnonymousAgentImpl anonymous = AnonymousAgentImpl.getInstance(); context.storeAgent(anonymous); Assert.fail("Exception expected"); } catch (AgentAccessDeniedException e) { } catch (Exception e) { e.printStackTrace(); Assert.fail(e.toString()); } }
@Override public void storeAgent(Agent agent) throws AgentAccessDeniedException, AgentAlreadyExistsException, AgentOperationFailedException, AgentLockedException { if (agent.isLocked()) { throw new AgentLockedException(); } else if (agent instanceof AnonymousAgent) { throw new AgentAccessDeniedException("Anonymous agen...
ExecutionContext implements Context { @Override public void storeAgent(Agent agent) throws AgentAccessDeniedException, AgentAlreadyExistsException, AgentOperationFailedException, AgentLockedException { if (agent.isLocked()) { throw new AgentLockedException(); } else if (agent instanceof AnonymousAgent) { throw new Agen...
ExecutionContext implements Context { @Override public void storeAgent(Agent agent) throws AgentAccessDeniedException, AgentAlreadyExistsException, AgentOperationFailedException, AgentLockedException { if (agent.isLocked()) { throw new AgentLockedException(); } else if (agent instanceof AnonymousAgent) { throw new Agen...
ExecutionContext implements Context { @Override public void storeAgent(Agent agent) throws AgentAccessDeniedException, AgentAlreadyExistsException, AgentOperationFailedException, AgentLockedException { if (agent.isLocked()) { throw new AgentLockedException(); } else if (agent instanceof AnonymousAgent) { throw new Agen...
ExecutionContext implements Context { @Override public void storeAgent(Agent agent) throws AgentAccessDeniedException, AgentAlreadyExistsException, AgentOperationFailedException, AgentLockedException { if (agent.isLocked()) { throw new AgentLockedException(); } else if (agent instanceof AnonymousAgent) { throw new Agen...
@Test public void testInvocation() throws SecurityException, IllegalArgumentException, ServiceMethodNotFoundException, IllegalAccessException, InvocationTargetException, InternalSecurityException { TestService testee = new TestService(); assertEquals(10, ServiceHelper.execute(testee, "getInt")); assertEquals(4, Service...
public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } static Class<?> getWrapperClass(Class<?> c); static boolean isWrapperClass(...
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } static Class<?> getWrapperClass(Class<?> c); static boolean isWrapperClass(...
@Test public void testSubclassParam() throws SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, InternalSecurityException, ServiceMethodNotFoundException { TestService testee = new TestService(); assertEquals("testnachricht", ServiceHelper.execute(testee, "subclass", new Sec...
public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } static Class<?> getWrapperClass(Class<?> c); static boolean isWrapperClass(...
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } static Class<?> getWrapperClass(Class<?> c); static boolean isWrapperClass(...
@Test public void testExceptions() throws SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, InternalSecurityException { TestService testee = new TestService(); try { ServiceHelper.execute(testee, "privateMethod"); fail("ServiceMethodNotFoundException expected"); } catch (Se...
public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } }
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } static Class<?> getWrapperClass(Class<?> c); static boolean isWrapperClass(...
ServiceHelper { public static Object execute(Service service, String method) throws ServiceMethodNotFoundException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { return execute(service, method, new Object[0]); } static Class<?> getWrapperClass(Class<?> c); static boolean isWrapperClass(...
@Test public void testJoin() { assertEquals("", SimpleTools.join((Object[]) null, "abc")); assertEquals("", SimpleTools.join(new Object[0], "dkefde")); assertEquals("a, b, c", SimpleTools.join(new Object[] { "a", 'b', "c" }, ", ")); assertEquals("10.20.30", SimpleTools.join(new Integer[] { 10, 20, 30 }, ".")); }
public static String join(Object[] objects, String glue) { if (objects == null) { return ""; } return SimpleTools.join(Arrays.asList(objects), glue); }
SimpleTools { public static String join(Object[] objects, String glue) { if (objects == null) { return ""; } return SimpleTools.join(Arrays.asList(objects), glue); } }
SimpleTools { public static String join(Object[] objects, String glue) { if (objects == null) { return ""; } return SimpleTools.join(Arrays.asList(objects), glue); } }
SimpleTools { public static String join(Object[] objects, String glue) { if (objects == null) { return ""; } return SimpleTools.join(Arrays.asList(objects), glue); } static long longHash(String s); static String createRandomString(int length); static String join(Object[] objects, String glue); static String join(Itera...
SimpleTools { public static String join(Object[] objects, String glue) { if (objects == null) { return ""; } return SimpleTools.join(Arrays.asList(objects), glue); } static long longHash(String s); static String createRandomString(int length); static String join(Object[] objects, String glue); static String join(Itera...
@Test public void testNotMethodService() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse response = c.sendRequest("GET", "service1/asdag", ""); Assert.assertEquals(404, response.getHttpCode()); } catch (Excepti...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testLogin() { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); try { c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("get", "test/ok", ""); Assert.assertEquals("OK", result.getResponse().trim()); } catch (Exception e) { e.prin...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testExceptions() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "doesNotExist", ""); Assert.assertEquals(404, result.getHttpCode()); result = c.sendRequest("GET"...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testCrossOriginHeader() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse response = c.sendRequest("GET", "asdag", ""); Assert.assertEquals(connector.crossOriginResourceDomain, response.getHeade...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testPath() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "version/path", ""); Assert.assertEquals(Status.OK.getStatusCode(), result.getHttpCode()); Assert.asser...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testSwagger() { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); try { c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "swaggertest/swagger.json", ""); Assert.assertTrue(result.getResponse().trim().contains("createSomet...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testResponseCode() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("PUT", "swaggertest/create/notfound", ""); Assert.assertEquals(404, result.getHttpCode()); result = c....
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testSubresource() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "swaggertest/subresource/content", ""); Assert.assertEquals(200, result.getHttpCode()); Assert.a...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testUploadLimit() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); byte[] testContent = new byte[WebConnector.DEFAULT_MAX_REQUEST_BODY_SIZE]; new Random().nextBytes(testContent); String base64 = Base64.getEnc...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testSecurityContextIntegration() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); ClientResponse result = c.sendRequest("GET", "security/name", ""); System.out.println("RESPONSE: " + result.getResponse()); Assert.assertEquals("no principal", result.getRespo...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testRepeat() { assertEquals("", SimpleTools.repeat("", 11)); assertEquals("", SimpleTools.repeat("adwdw", 0)); assertEquals("", SimpleTools.repeat("adwdw", -10)); assertNull(SimpleTools.repeat(null, 100)); assertEquals("xxxx", SimpleTools.repeat("x", 4)); assertEquals("101010", SimpleTools.repeat(10, ...
public static String repeat(String string, int count) { if (string == null) { return null; } else if (string.isEmpty() || count <= 0) { return ""; } StringBuffer result = new StringBuffer(); for (int i = 0; i < count; i++) { result.append(string); } return result.toString(); }
SimpleTools { public static String repeat(String string, int count) { if (string == null) { return null; } else if (string.isEmpty() || count <= 0) { return ""; } StringBuffer result = new StringBuffer(); for (int i = 0; i < count; i++) { result.append(string); } return result.toString(); } }
SimpleTools { public static String repeat(String string, int count) { if (string == null) { return null; } else if (string.isEmpty() || count <= 0) { return ""; } StringBuffer result = new StringBuffer(); for (int i = 0; i < count; i++) { result.append(string); } return result.toString(); } }
SimpleTools { public static String repeat(String string, int count) { if (string == null) { return null; } else if (string.isEmpty() || count <= 0) { return ""; } StringBuffer result = new StringBuffer(); for (int i = 0; i < count; i++) { result.append(string); } return result.toString(); } static long longHash(String...
SimpleTools { public static String repeat(String string, int count) { if (string == null) { return null; } else if (string.isEmpty() || count <= 0) { return ""; } StringBuffer result = new StringBuffer(); for (int i = 0; i < count; i++) { result.append(string); } return result.toString(); } static long longHash(String...
@Test public void testClassLoading() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "classloader/test", ""); Assert.assertEquals(200, result.getHttpCode()); Assert.assertEquals("O...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testEmptyResponse() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "test/empty", ""); Assert.assertEquals(200, result.getHttpCode()); } catch (Exception e) { e.p...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testAuthParamSanitization() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "test/requesturi?param1=sadf&access-token=secret", ""); Assert.assertEquals(200, resul...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testEncoding() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "test/encoding", ""); Assert.assertEquals(200, result.getHttpCode()); final String header = result....
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testBody() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); String body = "This is a test."; ClientResponse result = c.sendRequest("POST", "test/body", body); Assert.assertEquals(200, result.getHttpCode()); A...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testPathResolve() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "deep/path/test", ""); Assert.assertEquals(200, result.getHttpCode()); Assert.assertTrue(result....
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testFavicon() { try { MiniClient c = new MiniClient(); c.setConnectorEndpoint(connector.getHttpEndpoint()); c.setLogin(testAgent.getIdentifier(), testPass); ClientResponse result = c.sendRequest("GET", "favicon.ico", ""); Assert.assertEquals(200, result.getHttpCode()); Assert.assertArrayEquals(SimpleT...
public String getHttpEndpoint() { return "http: }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); }
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
WebConnector extends Connector { public String getHttpEndpoint() { return "http: } WebConnector(); WebConnector(boolean http, int httpPort, boolean https, int httpsPort); WebConnector(Integer httpPort); void setLogFile(String filename); void setHttpPort(Integer port); void setHttpsPort(Integer port); void enableHttpH...
@Test public void testTwoNodes() { try { UserAgentImpl adam = MockAgentFactory.getAdam(); UserAgentImpl eve = MockAgentFactory.getEve(); adam.unlock("adamspass"); eve.unlock("evespass"); LocalNodeManager manager = new LocalNodeManager(); LocalNode testee1 = manager.launchAgent(adam); manager.launchAgent(eve); assertTru...
@Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(localNodeManager.findFirstNod...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
@Test public void testTimeout() { try { UserAgentImpl adam = MockAgentFactory.getAdam(); adam.unlock("adamspass"); UserAgentImpl eve = MockAgentFactory.getEve(); LocalNodeManager manager = new LocalNodeManager(); LocalNode testee1 = manager.launchAgent(adam); MessageResultListener l = new MessageResultListener(2000) { ...
@Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(localNodeManager.findFirstNod...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
@Test public void testPending() { try { UserAgentImpl adam = MockAgentFactory.getAdam(); adam.unlock("adamspass"); UserAgentImpl eve = MockAgentFactory.getEve(); eve.unlock("evespass"); LocalNodeManager manager = new LocalNodeManager(); LocalNode node1 = manager.launchAgent(adam); MessageResultListener resultListener =...
@Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(localNodeManager.findFirstNod...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
LocalNode extends Node { @Override public void sendMessage(Message message, MessageResultListener listener, SendMode mode) { message.setSendingNodeId(this.getNodeId()); registerAnswerListener(message.getId(), listener); try { switch (mode) { case ANYCAST: if (!message.isTopic()) { localNodeManager.localSendMessage(loca...
@Test public void print() { }
public static void print(String title, String message, int type) { switch (type) { case Log.DEBUG: Log.d("EntireNews (" + title + ")", message); break; case Log.ERROR: Log.e("EntireNews (" + title + ")", message); break; case Log.INFO: Log.i("EntireNews (" + title + ")", message); break; case Log.VERBOSE: Log.v("Entire...
Utils { public static void print(String title, String message, int type) { switch (type) { case Log.DEBUG: Log.d("EntireNews (" + title + ")", message); break; case Log.ERROR: Log.e("EntireNews (" + title + ")", message); break; case Log.INFO: Log.i("EntireNews (" + title + ")", message); break; case Log.VERBOSE: Log.v...
Utils { public static void print(String title, String message, int type) { switch (type) { case Log.DEBUG: Log.d("EntireNews (" + title + ")", message); break; case Log.ERROR: Log.e("EntireNews (" + title + ")", message); break; case Log.INFO: Log.i("EntireNews (" + title + ")", message); break; case Log.VERBOSE: Log.v...
Utils { public static void print(String title, String message, int type) { switch (type) { case Log.DEBUG: Log.d("EntireNews (" + title + ")", message); break; case Log.ERROR: Log.e("EntireNews (" + title + ")", message); break; case Log.INFO: Log.i("EntireNews (" + title + ")", message); break; case Log.VERBOSE: Log.v...
Utils { public static void print(String title, String message, int type) { switch (type) { case Log.DEBUG: Log.d("EntireNews (" + title + ")", message); break; case Log.ERROR: Log.e("EntireNews (" + title + ")", message); break; case Log.INFO: Log.i("EntireNews (" + title + ")", message); break; case Log.VERBOSE: Log.v...
@Test public void createSlug() { String input = "This is a title"; String expected = "this-is-a-title"; String output = Utils.createSlug(input); assertEquals(expected,output); }
public static String createSlug(final String slug) { return slug.replaceAll("[^\\w\\s]", "").trim().toLowerCase().replaceAll("\\W+", "-"); }
Utils { public static String createSlug(final String slug) { return slug.replaceAll("[^\\w\\s]", "").trim().toLowerCase().replaceAll("\\W+", "-"); } }
Utils { public static String createSlug(final String slug) { return slug.replaceAll("[^\\w\\s]", "").trim().toLowerCase().replaceAll("\\W+", "-"); } }
Utils { public static String createSlug(final String slug) { return slug.replaceAll("[^\\w\\s]", "").trim().toLowerCase().replaceAll("\\W+", "-"); } static void print(String title, String message, int type); static void print(final String title, final int message); static void print(final String title, final String me...
Utils { public static String createSlug(final String slug) { return slug.replaceAll("[^\\w\\s]", "").trim().toLowerCase().replaceAll("\\W+", "-"); } static void print(String title, String message, int type); static void print(final String title, final int message); static void print(final String title, final String me...
@Test public void main() throws Exception { PlaygroundApplication playgroundApplication = new PlaygroundApplication(); playgroundApplication.main(new String[]{}); }
public static void main(String[] args) { SpringApplication.run(PlaygroundApplication.class, args); }
PlaygroundApplication { public static void main(String[] args) { SpringApplication.run(PlaygroundApplication.class, args); } }
PlaygroundApplication { public static void main(String[] args) { SpringApplication.run(PlaygroundApplication.class, args); } }
PlaygroundApplication { public static void main(String[] args) { SpringApplication.run(PlaygroundApplication.class, args); } static void main(String[] args); }
PlaygroundApplication { public static void main(String[] args) { SpringApplication.run(PlaygroundApplication.class, args); } static void main(String[] args); }
@Test public void getProductInfo() throws Exception { Long productId = 99999830L; given(tdBProductRepository.findOne(productId)).willReturn(mockDiscnt(productId)); TdBProduct productInfo = productService.getProductInfo(99999830L); assertThat(productInfo.getProductId()).isEqualTo(productId); }
public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; }
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; } }
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; } }
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; } TdBProduct getProductInfo(Long productId); }
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; } TdBProduct getProductInfo(Long productId); }
@Test(expected = ResourceNotFoundException.class) public void getProductInfoResourceNotFoundException() throws Exception { Long productId = 1L; productService.getProductInfo(99999830L); }
public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; }
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; } }
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; } }
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; } TdBProduct getProductInfo(Long productId); }
ProductService { public TdBProduct getProductInfo(Long productId) { TdBProduct tdBProduct = tdBProductRepository.findOne(productId); if (tdBProduct == null) { throw new ResourceNotFoundException(String.format("不存在 productId=%s", productId)); } return tdBProduct; } TdBProduct getProductInfo(Long productId); }
@Test public void rootRedirect() throws Exception { ResponseEntity<String> result = restTemplate.exchange("/", HttpMethod.GET, new HttpEntity(null), String.class); logger.info(result.toString()); assertThat(result.getStatusCode()).isEqualTo(HttpStatus.OK); }
@RequestMapping(value = {"/"}, method = RequestMethod.GET) public String rootRedirect() { return "index"; }
RootController { @RequestMapping(value = {"/"}, method = RequestMethod.GET) public String rootRedirect() { return "index"; } }
RootController { @RequestMapping(value = {"/"}, method = RequestMethod.GET) public String rootRedirect() { return "index"; } }
RootController { @RequestMapping(value = {"/"}, method = RequestMethod.GET) public String rootRedirect() { return "index"; } @RequestMapping(value = {"/"}, method = RequestMethod.GET) String rootRedirect(); }
RootController { @RequestMapping(value = {"/"}, method = RequestMethod.GET) public String rootRedirect() { return "index"; } @RequestMapping(value = {"/"}, method = RequestMethod.GET) String rootRedirect(); }
@Test public void getProductInfo() throws Exception { ResponseEntity<ProductDTO> result = restTemplate.getForEntity(baseurl + "/products/99999830", ProductDTO.class); logger.info(result.toString()); assertThat(result.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(result.getBody().getProductId()).isEqualTo(999998...
@Cacheable("getProductInfo") @HystrixCommand( fallbackMethod = "", ignoreExceptions = {Exception.class} ) @ApiOperation(value = "查询产品配置") @RequestMapping(value = "/{productId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ProductDTO getProductInfo(@ApiParam(value = "产品编码", defau...
ProductController { @Cacheable("getProductInfo") @HystrixCommand( fallbackMethod = "", ignoreExceptions = {Exception.class} ) @ApiOperation(value = "查询产品配置") @RequestMapping(value = "/{productId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ProductDTO getProductInfo(@ApiParam(v...
ProductController { @Cacheable("getProductInfo") @HystrixCommand( fallbackMethod = "", ignoreExceptions = {Exception.class} ) @ApiOperation(value = "查询产品配置") @RequestMapping(value = "/{productId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ProductDTO getProductInfo(@ApiParam(v...
ProductController { @Cacheable("getProductInfo") @HystrixCommand( fallbackMethod = "", ignoreExceptions = {Exception.class} ) @ApiOperation(value = "查询产品配置") @RequestMapping(value = "/{productId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ProductDTO getProductInfo(@ApiParam(v...
ProductController { @Cacheable("getProductInfo") @HystrixCommand( fallbackMethod = "", ignoreExceptions = {Exception.class} ) @ApiOperation(value = "查询产品配置") @RequestMapping(value = "/{productId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ProductDTO getProductInfo(@ApiParam(v...
@Test public void testParsePlain() throws ParseException { SemanticVersion v = new SemanticVersion("1.2.3"); assertEquals(1, v.major); assertEquals(2, v.minor); assertEquals(3, v.patch); assertEquals("1.2.3", v.toString()); v = new SemanticVersion("11.22.33"); assertEquals(11, v.major); assertEquals(22, v.minor); asser...
@Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.toString(); }
SemanticVersion implements Comparable<SemanticVersion>, Serializable { @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.to...
SemanticVersion implements Comparable<SemanticVersion>, Serializable { @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.to...
SemanticVersion implements Comparable<SemanticVersion>, Serializable { @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.to...
SemanticVersion implements Comparable<SemanticVersion>, Serializable { @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.to...
@Test public void shouldGetDetailsLinkFromCommentsIfNotSetFromRssGuid() throws Exception { NewznabXmlItem rssItem = buildBasicRssItem(); rssItem.setRssGuid(new NewznabXmlGuid("someguid", false)); rssItem.setComments("http: SearchResultItem item = testee.createSearchResultItem(rssItem); assertThat(item.getDetails(), is(...
protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDetails(item.getRssGuid().getGuid(...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
@Test public void shouldNotSetGroupOrPosterIfNotAvailable() throws Exception { NewznabXmlItem rssItem = buildBasicRssItem(); rssItem.getNewznabAttributes().clear(); rssItem.getNewznabAttributes().add(new NewznabAttribute("group", "not available")); rssItem.getNewznabAttributes().add(new NewznabAttribute("poster", "not ...
protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDetails(item.getRssGuid().getGuid(...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
@Test public void shouldReadGroupFromDescription() throws Exception { NewznabXmlItem rssItem = buildBasicRssItem(); rssItem.setDescription("<b>Group:</b> alt.binaries.tun<br />"); assertThat(testee.createSearchResultItem(rssItem).getGroup().get(), is("alt.binaries.tun")); }
protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDetails(item.getRssGuid().getGuid(...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
@Test public void shouldRemoveTrailingWords() throws Exception { baseConfig.getSearching().setRemoveTrailing(Arrays.asList("English", "-Obfuscated", " spanish")); NewznabXmlItem rssItem = buildBasicRssItem(); rssItem.setTitle("Some title English"); assertThat(testee.createSearchResultItem(rssItem).getTitle(), is("Some ...
protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDetails(item.getRssGuid().getGuid(...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
Newznab extends Indexer<Xml> { protected SearchResultItem createSearchResultItem(NewznabXmlItem item) throws NzbHydraException { SearchResultItem searchResultItem = new SearchResultItem(); String link = getEnclosureUrl(item); searchResultItem.setLink(link); if (item.getRssGuid().isPermaLink()) { searchResultItem.setDet...
@Test public void shouldComputeCategory() throws Exception { when(categoryProviderMock.fromResultNewznabCategories(any())).thenReturn(otherCategory); testee.config.getCategoryMapping().setAnime(1010); SearchResultItem item = new SearchResultItem(); testee.computeCategory(item, Arrays.asList(1000, 1010)); assertThat(ite...
protected void computeCategory(SearchResultItem searchResultItem, List<Integer> newznabCategories) { if (!newznabCategories.isEmpty()) { Integer mostSpecific = newznabCategories.stream().max(Integer::compareTo).get(); IndexerCategoryConfig mapping = config.getCategoryMapping(); Category category; if (mapping == null) {...
Newznab extends Indexer<Xml> { protected void computeCategory(SearchResultItem searchResultItem, List<Integer> newznabCategories) { if (!newznabCategories.isEmpty()) { Integer mostSpecific = newznabCategories.stream().max(Integer::compareTo).get(); IndexerCategoryConfig mapping = config.getCategoryMapping(); Category c...
Newznab extends Indexer<Xml> { protected void computeCategory(SearchResultItem searchResultItem, List<Integer> newznabCategories) { if (!newznabCategories.isEmpty()) { Integer mostSpecific = newznabCategories.stream().max(Integer::compareTo).get(); IndexerCategoryConfig mapping = config.getCategoryMapping(); Category c...
Newznab extends Indexer<Xml> { protected void computeCategory(SearchResultItem searchResultItem, List<Integer> newznabCategories) { if (!newznabCategories.isEmpty()) { Integer mostSpecific = newznabCategories.stream().max(Integer::compareTo).get(); IndexerCategoryConfig mapping = config.getCategoryMapping(); Category c...
Newznab extends Indexer<Xml> { protected void computeCategory(SearchResultItem searchResultItem, List<Integer> newznabCategories) { if (!newznabCategories.isEmpty()) { Integer mostSpecific = newznabCategories.stream().max(Integer::compareTo).get(); IndexerCategoryConfig mapping = config.getCategoryMapping(); Category c...
@Test public void shouldNotUseMoreThan6WordsForNzbGeek() throws Exception { String query = "1 2 3 4 5 6 7 8 9"; assertThat(testee.cleanupQuery(query), is("1 2 3 4 5 6")); }
@Override protected String cleanupQuery(String query) { String[] split = query.split(" "); if (query.split(" ").length > 6) { query = Joiner.on(" ").join(Arrays.copyOfRange(split, 0, 6)); } return query.replace("\"", ""); }
NzbGeek extends Newznab { @Override protected String cleanupQuery(String query) { String[] split = query.split(" "); if (query.split(" ").length > 6) { query = Joiner.on(" ").join(Arrays.copyOfRange(split, 0, 6)); } return query.replace("\"", ""); } }
NzbGeek extends Newznab { @Override protected String cleanupQuery(String query) { String[] split = query.split(" "); if (query.split(" ").length > 6) { query = Joiner.on(" ").join(Arrays.copyOfRange(split, 0, 6)); } return query.replace("\"", ""); } }
NzbGeek extends Newznab { @Override protected String cleanupQuery(String query) { String[] split = query.split(" "); if (query.split(" ").length > 6) { query = Joiner.on(" ").join(Arrays.copyOfRange(split, 0, 6)); } return query.replace("\"", ""); } }
NzbGeek extends Newznab { @Override protected String cleanupQuery(String query) { String[] split = query.split(" "); if (query.split(" ").length > 6) { query = Joiner.on(" ").join(Arrays.copyOfRange(split, 0, 6)); } return query.replace("\"", ""); } }
@Test public void shouldCleanup() { testee.cleanup(); assertThat(indexerConfigDisabledTempOutsideTimeWindow.getState()).isEqualTo(IndexerConfig.State.ENABLED); assertThat(indexerConfigDisabledTempOutsideTimeWindow.getDisabledUntil()).isNull(); assertThat(indexerConfigDisabledTempOutsideTimeWindow.getLastError()).isNull...
@HydraTask(configId = "cleanUpIndexerStatuses", name = "Clean up indexer statuses", interval = MINUTE) public void cleanup() { boolean anyChanges = false; for (IndexerConfig config : configProvider.getBaseConfig().getIndexers()) { if (config.getState() == IndexerConfig.State.DISABLED_SYSTEM_TEMPORARY && config.getDisab...
IndexerStatusesCleanupTask { @HydraTask(configId = "cleanUpIndexerStatuses", name = "Clean up indexer statuses", interval = MINUTE) public void cleanup() { boolean anyChanges = false; for (IndexerConfig config : configProvider.getBaseConfig().getIndexers()) { if (config.getState() == IndexerConfig.State.DISABLED_SYSTEM...
IndexerStatusesCleanupTask { @HydraTask(configId = "cleanUpIndexerStatuses", name = "Clean up indexer statuses", interval = MINUTE) public void cleanup() { boolean anyChanges = false; for (IndexerConfig config : configProvider.getBaseConfig().getIndexers()) { if (config.getState() == IndexerConfig.State.DISABLED_SYSTEM...
IndexerStatusesCleanupTask { @HydraTask(configId = "cleanUpIndexerStatuses", name = "Clean up indexer statuses", interval = MINUTE) public void cleanup() { boolean anyChanges = false; for (IndexerConfig config : configProvider.getBaseConfig().getIndexers()) { if (config.getState() == IndexerConfig.State.DISABLED_SYSTEM...
IndexerStatusesCleanupTask { @HydraTask(configId = "cleanUpIndexerStatuses", name = "Clean up indexer statuses", interval = MINUTE) public void cleanup() { boolean anyChanges = false; for (IndexerConfig config : configProvider.getBaseConfig().getIndexers()) { if (config.getState() == IndexerConfig.State.DISABLED_SYSTEM...
@Test public void shouldUseIndexerUserAgent() throws Exception{ testee.get(new URI("http: Map<String, String> headers = headersCaptor.getValue(); assertThat(headers).contains(entry("User-Agent", "indexerUa")); }
@SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexerConfig); @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexe...
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexerConfig); @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexe...
@Test public void shouldUseGlobalUserAgentIfNoIndexerUaIsSet() throws Exception{ indexerConfig.setUserAgent(null); testee.get(new URI("http: Map<String, String> headers = headersCaptor.getValue(); assertThat(headers).contains(entry("User-Agent", "globalUa")); }
@SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexerConfig); @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexe...
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexerConfig); @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexe...
@Test public void shouldUseIndexerTimeout() throws Exception{ testee.get(new URI("http: assertThat(timeoutCaptor.getValue()).isEqualTo(10); }
@SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexerConfig); @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexe...
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexerConfig); @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexe...
@Test public void shouldIgnoreHitLimitIfNotYetReached() { indexerConfigMock.setHitLimit(10); when(queryMock.getResultList()).thenReturn(Collections.emptyList()); boolean result = testee.checkIndexerHitLimit(indexer); assertTrue(result); verify(entityManagerMock).createNativeQuery(anyString()); }
protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime comparisonTime; LocalDateTime now = ...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
@Test public void shouldUseGlobalTimeoutNoIndexerTimeoutIsSet() throws Exception{ indexerConfig.setTimeout(null); testee.get(new URI("http: assertThat(timeoutCaptor.getValue()).isEqualTo(100); }
@SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } }
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexerConfig); @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexe...
IndexerWebAccess { @SuppressWarnings("unchecked") public <T> T get(URI uri, IndexerConfig indexerConfig) throws IndexerAccessException { return get(uri, indexerConfig, null); } @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexerConfig); @SuppressWarnings("unchecked") T get(URI uri, IndexerConfig indexe...
@Test public void shouldBuildCorrectlyForLocalAccessWithHttp() { prepareConfig(false, false, "/"); prepareHeaders("127.0.0.1:5076", null, null, null); prepareServlet("http: UriComponentsBuilder builder = testee.buildLocalBaseUriBuilder(requestMock); assertThat(builder.build().getScheme()).isEqualTo("http"); assertThat(...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForLocalAccessWithContextPath() { prepareConfig(false, false, "/nzbhydra2"); prepareHeaders("127.0.0.1:5076", null, null, null); prepareServlet("http: UriComponentsBuilder builder = testee.buildLocalBaseUriBuilder(requestMock); assertThat(builder.build().getScheme()).isEqualTo("htt...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForLocalAccessWithBindAllAccessedViaLocalhost() { prepareConfig(false, true, "/"); prepareHeaders("127.0.0.1:5076", null, null, null); prepareServlet("http: UriComponentsBuilder builder = testee.buildLocalBaseUriBuilder(requestMock); assertThat(builder.build().getScheme()).isEqualT...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForLocalAccessWithBindAllAccessedViaNetworkAddress() { prepareConfig(false, true, "/"); prepareHeaders("192.168.1.111:5076", null, null, null); prepareServlet("http: UriComponentsBuilder builder = testee.buildLocalBaseUriBuilder(requestMock); assertThat(builder.build().getScheme())...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForReverseProxyWithHttpAccessedViaLocalhost() { prepareConfig(false, false, "/nzbhydra2"); prepareHeaders("127.0.0.1", "127.0.0.1:4001", null, null); prepareServlet("http: UriComponentsBuilder builder = testee.buildLocalBaseUriBuilder(requestMock); assertThat(builder.build().getSch...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForReverseProxyWithHttpAccessedViaNetworkAddress() { prepareConfig(false, false, "/nzbhydra2"); prepareHeaders("192.168.1.111", "192.168.1.111:4001", null, null); prepareServlet("192.168.1.111:4001", "192.168.1.111", 80, "http", "/nzbhydra2"); UriComponentsBuilder builder = testee....
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForReverseProxySendingForwardedPort() { prepareConfig(false, false, "/nzbhydra2"); prepareHeaders("192.168.1.111", "192.168.1.111", null, "4001"); prepareServlet("192.168.1.111:4001", "192.168.1.111", 80, "http", "/nzbhydra2"); UriComponentsBuilder builder = testee.buildLocalBaseUr...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForReverseProxyWithHttpsAccessedViaLocalhost() { prepareConfig(false, false, "/nzbhydra2"); prepareHeaders("127.0.0.1:4001", "127.0.0.1:4001", "https", null); prepareServlet("http: UriComponentsBuilder builder = testee.buildLocalBaseUriBuilder(requestMock); assertThat(builder.build...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForReverseProxyWithHttpsAccessedViaNetworkAddress() { prepareConfig(false, false, "/nzbhydra2"); prepareHeaders("192.168.1.111:4001", "192.168.1.111:4001", "https", null); prepareServlet("192.168.1.111:4001", "192.168.1.111", 80, "http", "/nzbhydra2"); UriComponentsBuilder builder ...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldFollowApiHitLimit() { indexerConfigMock.setHitLimit(1); when(queryMock.getResultList()).thenReturn(Arrays.asList(Timestamp.from(Instant.now().minus(10, ChronoUnit.MILLIS)))); boolean result = testee.checkIndexerHitLimit(indexer); assertFalse(result); verify(entityManagerMock).createNativeQuery(a...
protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime comparisonTime; LocalDateTime now = ...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
@Test public void shouldBuildCorrectlyForReverseProxyWithHttpsOnPort443() { prepareConfig(false, false, "/nzbhydra2"); prepareHeaders("localhost", "localhost", "https", null); prepareServlet("localhost", "localhost", 443, "http", "/nzbhydra2"); UriComponentsBuilder builder = testee.buildLocalBaseUriBuilder(requestMock)...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void shouldBuildCorrectlyForReverseProxyWithHttpOnPort80AndNoPath() { prepareConfig(false, false, "/"); prepareHeaders("localhost", "localhost", "http", null); prepareServlet("localhost", "localhost", 80, "http", "/"); UriComponentsBuilder builder = testee.buildLocalBaseUriBuilder(requestMock); assertThat(...
protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolean.parseBoolean(e...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
UrlCalculator { protected UriComponentsBuilder buildLocalBaseUriBuilder(HttpServletRequest request) { String scheme; String host; int port = -1; String path; if (request.isSecure()) { logger.debug(LoggingMarkers.URL_CALCULATION, "Using scheme HTTPS because request is deemed secure"); scheme = "https"; } else if (Boolea...
@Test public void canConvert() throws Exception { for (MediaIdType type : Arrays.asList(MediaIdType.IMDB, MediaIdType.TMDB, MediaIdType.MOVIETITLE)) { for (MediaIdType type2 : Arrays.asList(MediaIdType.IMDB, MediaIdType.TMDB, MediaIdType.MOVIETITLE)) { assertTrue(testee.canConvert(type, type2)); } } for (MediaIdType ty...
public boolean canConvert(MediaIdType from, MediaIdType to) { return canConvertMap.get(from).contains(to); }
InfoProvider { public boolean canConvert(MediaIdType from, MediaIdType to) { return canConvertMap.get(from).contains(to); } }
InfoProvider { public boolean canConvert(MediaIdType from, MediaIdType to) { return canConvertMap.get(from).contains(to); } }
InfoProvider { public boolean canConvert(MediaIdType from, MediaIdType to) { return canConvertMap.get(from).contains(to); } boolean canConvert(MediaIdType from, MediaIdType to); static Set<MediaIdType> getConvertibleFrom(MediaIdType from); boolean canConvertAny(Set<MediaIdType> from, Set<MediaIdType> to); MediaInfo co...
InfoProvider { public boolean canConvert(MediaIdType from, MediaIdType to) { return canConvertMap.get(from).contains(to); } boolean canConvert(MediaIdType from, MediaIdType to); static Set<MediaIdType> getConvertibleFrom(MediaIdType from); boolean canConvertAny(Set<MediaIdType> from, Set<MediaIdType> to); MediaInfo co...
@Test public void canConvertAny() throws Exception { assertTrue(testee.canConvertAny(Sets.newSet(MediaIdType.TVMAZE, MediaIdType.TVDB), Sets.newSet(MediaIdType.TVRAGE))); assertTrue(testee.canConvertAny(Sets.newSet(MediaIdType.TVMAZE, MediaIdType.TVDB), Sets.newSet(MediaIdType.TVMAZE))); assertTrue(testee.canConvertAny...
public boolean canConvertAny(Set<MediaIdType> from, Set<MediaIdType> to) { return from.stream().anyMatch(x -> canConvertMap.containsKey(x) && canConvertMap.get(x).stream().anyMatch(to::contains)); }
InfoProvider { public boolean canConvertAny(Set<MediaIdType> from, Set<MediaIdType> to) { return from.stream().anyMatch(x -> canConvertMap.containsKey(x) && canConvertMap.get(x).stream().anyMatch(to::contains)); } }
InfoProvider { public boolean canConvertAny(Set<MediaIdType> from, Set<MediaIdType> to) { return from.stream().anyMatch(x -> canConvertMap.containsKey(x) && canConvertMap.get(x).stream().anyMatch(to::contains)); } }
InfoProvider { public boolean canConvertAny(Set<MediaIdType> from, Set<MediaIdType> to) { return from.stream().anyMatch(x -> canConvertMap.containsKey(x) && canConvertMap.get(x).stream().anyMatch(to::contains)); } boolean canConvert(MediaIdType from, MediaIdType to); static Set<MediaIdType> getConvertibleFrom(MediaIdT...
InfoProvider { public boolean canConvertAny(Set<MediaIdType> from, Set<MediaIdType> to) { return from.stream().anyMatch(x -> canConvertMap.containsKey(x) && canConvertMap.get(x).stream().anyMatch(to::contains)); } boolean canConvert(MediaIdType from, MediaIdType to); static Set<MediaIdType> getConvertibleFrom(MediaIdT...
@Test public void shouldCatchUnexpectedError() throws Exception { when(tvMazeHandlerMock.getInfos(anyString(), eq(MediaIdType.TVDB))).thenThrow(IllegalArgumentException.class); try { testee.convert("", MediaIdType.TVDB); fail("Should've failed"); } catch (Exception e) { assertEquals(InfoProviderException.class, e.getCl...
public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable to find any conv...
InfoProvider { public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable t...
InfoProvider { public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable t...
InfoProvider { public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable t...
InfoProvider { public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable t...
@Test public void shouldCallTvMaze() throws Exception { ArgumentCaptor<TvInfo> tvInfoArgumentCaptor = ArgumentCaptor.forClass(TvInfo.class); for (MediaIdType type : Arrays.asList(MediaIdType.TVMAZE, MediaIdType.TVDB, MediaIdType.TVRAGE, MediaIdType.TVTITLE, MediaIdType.TVIMDB)) { reset(tvMazeHandlerMock); when(tvMazeHa...
public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable to find any conv...
InfoProvider { public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable t...
InfoProvider { public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable t...
InfoProvider { public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable t...
InfoProvider { public MediaInfo convert(Map<MediaIdType, String> identifiers) throws InfoProviderException { for (MediaIdType idType : REAL_ID_TYPES) { if (identifiers.containsKey(idType) && identifiers.get(idType) != null) { return convert(identifiers.get(idType), idType); } } throw new InfoProviderException("Unable t...
@Test public void shouldSearch() throws Exception { testee.search("title", MediaIdType.TVTITLE); verify(tvMazeHandlerMock).search("title"); testee.search("title", MediaIdType.MOVIETITLE); verify(tmdbHandlerMock).search("title", null); }
@Cacheable(cacheNames = "titles", sync = true) public List<MediaInfo> search(String title, MediaIdType titleType) throws InfoProviderException { try { List<MediaInfo> infos; switch (titleType) { case TVTITLE: { List<TvMazeSearchResult> results = tvMazeHandler.search(title); infos = results.stream().map(MediaInfo::new)....
InfoProvider { @Cacheable(cacheNames = "titles", sync = true) public List<MediaInfo> search(String title, MediaIdType titleType) throws InfoProviderException { try { List<MediaInfo> infos; switch (titleType) { case TVTITLE: { List<TvMazeSearchResult> results = tvMazeHandler.search(title); infos = results.stream().map(M...
InfoProvider { @Cacheable(cacheNames = "titles", sync = true) public List<MediaInfo> search(String title, MediaIdType titleType) throws InfoProviderException { try { List<MediaInfo> infos; switch (titleType) { case TVTITLE: { List<TvMazeSearchResult> results = tvMazeHandler.search(title); infos = results.stream().map(M...
InfoProvider { @Cacheable(cacheNames = "titles", sync = true) public List<MediaInfo> search(String title, MediaIdType titleType) throws InfoProviderException { try { List<MediaInfo> infos; switch (titleType) { case TVTITLE: { List<TvMazeSearchResult> results = tvMazeHandler.search(title); infos = results.stream().map(M...
InfoProvider { @Cacheable(cacheNames = "titles", sync = true) public List<MediaInfo> search(String title, MediaIdType titleType) throws InfoProviderException { try { List<MediaInfo> infos; switch (titleType) { case TVTITLE: { List<TvMazeSearchResult> results = tvMazeHandler.search(title); infos = results.stream().map(M...
@Test public void shouldGetInfoWithMostIds() { TvInfo mostInfo = new TvInfo("abc", "abc", "abc", null, null, null, null); when(tvInfoRepositoryMock.findByTvrageIdOrTvmazeIdOrTvdbIdOrImdbId(anyString(), anyString(), anyString(), anyString())).thenReturn(Arrays.asList( mostInfo, new TvInfo("abc", "abc", null, null, null,...
public TvInfo findTvInfoInDatabase(Map<MediaIdType, String> ids) { Collection<TvInfo> matchingInfos = tvInfoRepository.findByTvrageIdOrTvmazeIdOrTvdbIdOrImdbId(ids.getOrDefault(TVRAGE, "-1"), ids.getOrDefault(TVMAZE, "-1"), ids.getOrDefault(TVDB, "-1"), ids.getOrDefault(IMDB, "-1")); return matchingInfos.stream().max(T...
InfoProvider { public TvInfo findTvInfoInDatabase(Map<MediaIdType, String> ids) { Collection<TvInfo> matchingInfos = tvInfoRepository.findByTvrageIdOrTvmazeIdOrTvdbIdOrImdbId(ids.getOrDefault(TVRAGE, "-1"), ids.getOrDefault(TVMAZE, "-1"), ids.getOrDefault(TVDB, "-1"), ids.getOrDefault(IMDB, "-1")); return matchingInfos...
InfoProvider { public TvInfo findTvInfoInDatabase(Map<MediaIdType, String> ids) { Collection<TvInfo> matchingInfos = tvInfoRepository.findByTvrageIdOrTvmazeIdOrTvdbIdOrImdbId(ids.getOrDefault(TVRAGE, "-1"), ids.getOrDefault(TVMAZE, "-1"), ids.getOrDefault(TVDB, "-1"), ids.getOrDefault(IMDB, "-1")); return matchingInfos...
InfoProvider { public TvInfo findTvInfoInDatabase(Map<MediaIdType, String> ids) { Collection<TvInfo> matchingInfos = tvInfoRepository.findByTvrageIdOrTvmazeIdOrTvdbIdOrImdbId(ids.getOrDefault(TVRAGE, "-1"), ids.getOrDefault(TVMAZE, "-1"), ids.getOrDefault(TVDB, "-1"), ids.getOrDefault(IMDB, "-1")); return matchingInfos...
InfoProvider { public TvInfo findTvInfoInDatabase(Map<MediaIdType, String> ids) { Collection<TvInfo> matchingInfos = tvInfoRepository.findByTvrageIdOrTvmazeIdOrTvdbIdOrImdbId(ids.getOrDefault(TVRAGE, "-1"), ids.getOrDefault(TVMAZE, "-1"), ids.getOrDefault(TVDB, "-1"), ids.getOrDefault(IMDB, "-1")); return matchingInfos...
@Test public void imdbToTmdb() throws Exception { TmdbSearchResult result = testee.getInfos("tt5895028", MediaIdType.IMDB); assertThat(result.getTmdbId(), is("407806")); assertThat(result.getTitle(), is("13th")); }
public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new IllegalArgumentExce...
TmdbHandler { public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new Illeg...
TmdbHandler { public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new Illeg...
TmdbHandler { public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new Illeg...
TmdbHandler { public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new Illeg...
@Test public void tmdbToImdb() throws Exception { TmdbSearchResult result = testee.getInfos("407806", MediaIdType.TMDB); assertThat(result.getImdbId(), is("tt5895028")); assertThat(result.getTitle(), is("13th")); }
public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new IllegalArgumentExce...
TmdbHandler { public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new Illeg...
TmdbHandler { public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new Illeg...
TmdbHandler { public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new Illeg...
TmdbHandler { public TmdbSearchResult getInfos(String value, MediaIdType idType) throws InfoProviderException { if (idType == MediaIdType.MOVIETITLE) { return fromTitle(value, null); } if (idType == MediaIdType.IMDB) { return fromImdb(value); } if (idType == MediaIdType.TMDB) { return fromTmdb(value); } throw new Illeg...
@Test public void shouldIgnoreDownloadLimitIfNotYetReached() { indexerConfigMock.setDownloadLimit(10); when(queryMock.getResultList()).thenReturn(Arrays.asList(Timestamp.from(Instant.now().minus(10, ChronoUnit.MILLIS)))); boolean result = testee.checkIndexerHitLimit(indexer); assertTrue(result); }
protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime comparisonTime; LocalDateTime now = ...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
IndexerForSearchSelector { protected boolean checkIndexerHitLimit(Indexer indexer) { Stopwatch stopwatch = Stopwatch.createStarted(); IndexerConfig indexerConfig = indexer.getConfig(); if (!indexerConfig.getHitLimit().isPresent() && !indexerConfig.getDownloadLimit().isPresent()) { return true; } LocalDateTime compariso...
@Test public void fromTitle() throws Exception { TmdbSearchResult result = testee.getInfos("gladiator", MediaIdType.MOVIETITLE); assertThat(result.getImdbId(), is("tt0172495")); result = testee.fromTitle("gladiator", 1992); assertThat(result.getImdbId(), is("tt0104346")); }
TmdbSearchResult fromTitle(String title, Integer year) throws InfoProviderException { Movie movie = getMovieByTitle(title, year); TmdbSearchResult result = getSearchResultFromMovie(movie); return result; }
TmdbHandler { TmdbSearchResult fromTitle(String title, Integer year) throws InfoProviderException { Movie movie = getMovieByTitle(title, year); TmdbSearchResult result = getSearchResultFromMovie(movie); return result; } }
TmdbHandler { TmdbSearchResult fromTitle(String title, Integer year) throws InfoProviderException { Movie movie = getMovieByTitle(title, year); TmdbSearchResult result = getSearchResultFromMovie(movie); return result; } }
TmdbHandler { TmdbSearchResult fromTitle(String title, Integer year) throws InfoProviderException { Movie movie = getMovieByTitle(title, year); TmdbSearchResult result = getSearchResultFromMovie(movie); return result; } TmdbSearchResult getInfos(String value, MediaIdType idType); List<TmdbSearchResult> search(String t...
TmdbHandler { TmdbSearchResult fromTitle(String title, Integer year) throws InfoProviderException { Movie movie = getMovieByTitle(title, year); TmdbSearchResult result = getSearchResultFromMovie(movie); return result; } TmdbSearchResult getInfos(String value, MediaIdType idType); List<TmdbSearchResult> search(String t...
@Test public void shouldRecognizeLocalIps() { assertThat(testee.isUriToBeIgnoredByProxy("localhost"), is(true)); assertThat(testee.isUriToBeIgnoredByProxy("127.0.0.1"), is(true)); assertThat(testee.isUriToBeIgnoredByProxy("192.168.1.1"), is(true)); assertThat(testee.isUriToBeIgnoredByProxy("192.168.240.3"), is(true)); ...
protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (ipToLong != null) { return ipToLong; } } if (mainConfig.getProxyIgnoreDomains() == null || mainConfig.getPr...
HydraOkHttp3ClientHttpRequestFactory implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory { protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (i...
HydraOkHttp3ClientHttpRequestFactory implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory { protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (i...
HydraOkHttp3ClientHttpRequestFactory implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory { protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (i...
HydraOkHttp3ClientHttpRequestFactory implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory { protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (i...
@Test public void shouldRecognizeIgnoredDomains() { assertThat(testee.isUriToBeIgnoredByProxy("mydomain.com"), is(true)); assertThat(testee.isUriToBeIgnoredByProxy("github.com"), is(true)); assertThat(testee.isUriToBeIgnoredByProxy("subdomain.otherdomain.net"), is(true)); assertThat(testee.isUriToBeIgnoredByProxy("subd...
protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (ipToLong != null) { return ipToLong; } } if (mainConfig.getProxyIgnoreDomains() == null || mainConfig.getPr...
HydraOkHttp3ClientHttpRequestFactory implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory { protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (i...
HydraOkHttp3ClientHttpRequestFactory implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory { protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (i...
HydraOkHttp3ClientHttpRequestFactory implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory { protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (i...
HydraOkHttp3ClientHttpRequestFactory implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory { protected boolean isUriToBeIgnoredByProxy(String host) { MainConfig mainConfig = configProvider.getBaseConfig().getMain(); if (mainConfig.isProxyIgnoreLocal()) { Boolean ipToLong = isHostInLocalNetwork(host); if (i...