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 testSetName() { RosterElement e = new RosterElement(JID.jidInstanceNS("a@b.c"), null, new String[] {}, null); assertNull(e.getName()); assertTrue(e.isModified()); e.getRosterElement(); assertFalse(e.isModified()); e.setName(null); assertFalse(e.isModified()); assertNull(e.getName()); e.setName("jeff")... | public final void setName(final String name) { if(name==this.name || (name!=null && this.name!=null && name.equals(this.name))){ return ; } else { this.name = name==null?null:XMLUtils.unescape(name); this.modified = true; } } | RosterElement { public final void setName(final String name) { if(name==this.name || (name!=null && this.name!=null && name.equals(this.name))){ return ; } else { this.name = name==null?null:XMLUtils.unescape(name); this.modified = true; } } } | RosterElement { public final void setName(final String name) { if(name==this.name || (name!=null && this.name!=null && name.equals(this.name))){ return ; } else { this.name = name==null?null:XMLUtils.unescape(name); this.modified = true; } } RosterElement(Element roster_el, XMPPResourceConnection session); RosterEleme... | RosterElement { public final void setName(final String name) { if(name==this.name || (name!=null && this.name!=null && name.equals(this.name))){ return ; } else { this.name = name==null?null:XMLUtils.unescape(name); this.modified = true; } } RosterElement(Element roster_el, XMPPResourceConnection session); RosterEleme... | RosterElement { public final void setName(final String name) { if(name==this.name || (name!=null && this.name!=null && name.equals(this.name))){ return ; } else { this.name = name==null?null:XMLUtils.unescape(name); this.modified = true; } } RosterElement(Element roster_el, XMPPResourceConnection session); RosterEleme... |
@Test public void testStorageOfflineMessageForBareJid() throws Exception { BareJID userJid = BareJID.bareJIDInstance("user1@example.com"); JID res1 = JID.jidInstance(userJid, "res1"); JID res2 = JID.jidInstance(userJid, "res2"); XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com/" + UUID.rand... | @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionForMessageDelivery(conn) ){ try { if (packet.getElemName() == tigase.server.Message.ELEM_NAM... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionFo... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionFo... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionFo... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionFo... |
@Test public void testStorageOfflineMessageForFullJid() throws Exception { BareJID userJid = BareJID.bareJIDInstance("user1@example.com"); JID res1 = JID.jidInstance(userJid, "res1"); JID res2 = JID.jidInstance(userJid, "res2"); XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com/" + UUID.rand... | @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionForMessageDelivery(conn) ){ try { if (packet.getElemName() == tigase.server.Message.ELEM_NAM... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionFo... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionFo... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionFo... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { @Override public void postProcess( final Packet packet, final XMPPResourceConnection conn, final NonAuthUserRepository repo, final Queue<Packet> queue, Map<String, Object> settings ) { if ( conn == null || !message.hasConnectionFo... |
@Test public void testRestorePacketForOffLineUser() throws Exception { BareJID userJid = BareJID.bareJIDInstance("user1@example.com"); JID res1 = JID.jidInstance(userJid, "res1"); XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com/" + UUID.randomUUID().toString()), res1); assertEquals(Arrays.... | public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn, MsgRepositoryIfc repo ) throws UserNotFoundException, NotAuthorizedException { Queue<Element> elems = repo.loadMessagesToJID( conn, true ); if ( elems != null ){ LinkedList<Packet> pacs = new LinkedList<Packet>(); Element elem = null; while ... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn, MsgRepositoryIfc repo ) throws UserNotFoundException, NotAuthorizedException { Queue<Element> elems = repo.loadMessagesToJID( conn, true ); if ( elems ... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn, MsgRepositoryIfc repo ) throws UserNotFoundException, NotAuthorizedException { Queue<Element> elems = repo.loadMessagesToJID( conn, true ); if ( elems ... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn, MsgRepositoryIfc repo ) throws UserNotFoundException, NotAuthorizedException { Queue<Element> elems = repo.loadMessagesToJID( conn, true ); if ( elems ... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { public Queue<Packet> restorePacketForOffLineUser( XMPPResourceConnection conn, MsgRepositoryIfc repo ) throws UserNotFoundException, NotAuthorizedException { Queue<Element> elems = repo.loadMessagesToJID( conn, true ); if ( elems ... |
@Test public void testParseSizeInt() { System.out.println( "parseSizeInt" ); assertEquals( 1, DataTypes.parseSizeInt( "1", 1 ) ); assertEquals( 1024, DataTypes.parseSizeInt( "1k", 1 ) ); assertEquals( 1024 * 1024, DataTypes.parseSizeInt( "1m", 1 ) ); assertEquals( 1024 * 1024 * 1024, DataTypes.parseSizeInt( "1g", 1 ) )... | public static int parseSizeInt(String size, int def) { return parseNum(size, Integer.class, def); } | DataTypes { public static int parseSizeInt(String size, int def) { return parseNum(size, Integer.class, def); } } | DataTypes { public static int parseSizeInt(String size, int def) { return parseNum(size, Integer.class, def); } } | DataTypes { public static int parseSizeInt(String size, int def) { return parseNum(size, Integer.class, def); } static T parseNum(String num, Class<T> cls, T def); static int parseSizeInt(String size, int def); static boolean parseBool(final String val); static Object decodeValueType(char typeId, String value); static... | DataTypes { public static int parseSizeInt(String size, int def) { return parseNum(size, Integer.class, def); } static T parseNum(String num, Class<T> cls, T def); static int parseSizeInt(String size, int def); static boolean parseBool(final String val); static Object decodeValueType(char typeId, String value); static... |
@Test public void testLoadOfflineMessages() throws Exception { BareJID userJid = BareJID.bareJIDInstance("user1@example.com"); JID res1 = JID.jidInstance(userJid, "res1"); JID res2 = JID.jidInstance(userJid, "res2"); XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com/" + UUID.randomUUID().toS... | protected boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn ) { if ( ( conn == null ) || conn.isAnonymous() ){ return false; } if ( conn.getSessionData( ID ) != null ){ return false; } if (packet.getStanzaTo() != null) return false; if ( conn.getCommonSessionData(FlexibleOfflineMessageRetrieval.FL... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { protected boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn ) { if ( ( conn == null ) || conn.isAnonymous() ){ return false; } if ( conn.getSessionData( ID ) != null ){ return false; } if (packet.getStanzaTo(... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { protected boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn ) { if ( ( conn == null ) || conn.isAnonymous() ){ return false; } if ( conn.getSessionData( ID ) != null ){ return false; } if (packet.getStanzaTo(... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { protected boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn ) { if ( ( conn == null ) || conn.isAnonymous() ){ return false; } if ( conn.getSessionData( ID ) != null ){ return false; } if (packet.getStanzaTo(... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { protected boolean loadOfflineMessages( Packet packet, XMPPResourceConnection conn ) { if ( ( conn == null ) || conn.isAnonymous() ){ return false; } if ( conn.getSessionData( ID ) != null ){ return false; } if (packet.getStanzaTo(... |
@Test public void testIsAllowedForOfflineStorage() throws Exception { Packet packet = Packet.packetInstance(new Element("message", new Element[]{ new Element("body", "Test message") }, new String[] { "from", "to" }, new String[] { "from@example.com/res1", "to@example.com/res2" })); assertTrue(offlineProcessor.isAllowed... | protected boolean isAllowedForOfflineStorage(Packet pac) { for (ElementMatcher matcher : offlineStorageMatchers) { if (matcher.matches(pac)) return matcher.getValue(); } return isAllowedForOfflineStorageDefaults(pac); } | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { protected boolean isAllowedForOfflineStorage(Packet pac) { for (ElementMatcher matcher : offlineStorageMatchers) { if (matcher.matches(pac)) return matcher.getValue(); } return isAllowedForOfflineStorageDefaults(pac); } } | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { protected boolean isAllowedForOfflineStorage(Packet pac) { for (ElementMatcher matcher : offlineStorageMatchers) { if (matcher.matches(pac)) return matcher.getValue(); } return isAllowedForOfflineStorageDefaults(pac); } } | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { protected boolean isAllowedForOfflineStorage(Packet pac) { for (ElementMatcher matcher : offlineStorageMatchers) { if (matcher.matches(pac)) return matcher.getValue(); } return isAllowedForOfflineStorageDefaults(pac); } @Override... | OfflineMessages extends XMPPProcessor implements XMPPPostprocessorIfc, XMPPProcessorIfc { protected boolean isAllowedForOfflineStorage(Packet pac) { for (ElementMatcher matcher : offlineStorageMatchers) { if (matcher.matches(pac)) return matcher.getValue(); } return isAllowedForOfflineStorageDefaults(pac); } @Override... |
@Test public void testValidateListGood() { List<Element> items = new ArrayList<Element>(); Authorization result = null; items.add(new Element("item", new String[] { "type", "value", "action", "order" }, new String[] { "subscription", "both", "allow", "10" })); items.add(new Element("item", new String[] { "action", "ord... | public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String> groups = new HashSet<String>(); if (session != null) { JID[] jids = roster_util.getBuddies(session); if (jids... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... |
@Test public void testValidateListBadAction() { List<Element> items = new ArrayList<Element>(); Authorization result = null; items.add(new Element("item", new String[] { "type", "value", "action", "order" }, new String[] { "subscription", "both", "ignore", "10" })); items.add(new Element("item", new String[] { "action"... | public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String> groups = new HashSet<String>(); if (session != null) { JID[] jids = roster_util.getBuddies(session); if (jids... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... |
@Test public void testValidateListBadSubscription() { List<Element> items = new ArrayList<Element>(); Authorization result = null; items.add(new Element("item", new String[] { "type", "value", "action", "order" }, new String[] { "subscription", "or", "allow", "10" })); items.add(new Element("item", new String[] { "acti... | public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String> groups = new HashSet<String>(); if (session != null) { JID[] jids = roster_util.getBuddies(session); if (jids... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... |
@Test public void testValidateListBadType() { List<Element> items = new ArrayList<Element>(); Authorization result = null; items.add(new Element("item", new String[] { "type", "value", "action", "order" }, new String[] { "other", "both", "allow", "10" })); items.add(new Element("item", new String[] { "action", "order" ... | public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String> groups = new HashSet<String>(); if (session != null) { JID[] jids = roster_util.getBuddies(session); if (jids... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... |
@Test public void testValidateListOrderUnsignedInt() { List<Element> items = new ArrayList<Element>(); Authorization result = null; items.add(new Element("item", new String[] { "type", "value", "action", "order" }, new String[] { "subscription", "both", "allow", "-10" })); items.add(new Element("item", new String[] { "... | public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String> groups = new HashSet<String>(); if (session != null) { JID[] jids = roster_util.getBuddies(session); if (jids... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... |
@Test public void testValidateListOrderAttributeDuplicate() { List<Element> items = new ArrayList<Element>(); Authorization result = null; items.add(new Element("item", new String[] { "type", "value", "action", "order" }, new String[] { "subscription", "both", "allow", "10" })); items.add(new Element("item", new String... | public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String> groups = new HashSet<String>(); if (session != null) { JID[] jids = roster_util.getBuddies(session); if (jids... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { public static Authorization validateList(final XMPPResourceConnection session, final List<Element> items) { Authorization result = null; try { HashSet<Integer> orderSet = new HashSet<Integer>(); HashSet<String>... |
@Test public void testFilterPresenceOut() throws Exception { JID jid = JID.jidInstance("test@example/res-1"); JID connId = JID.jidInstance("c2s@example.com/asdasd"); XMPPResourceConnection session = getSession(connId, jid); Element list = new Element("list", new String[] { "name" }, new String[] { "default" }); Element... | protected boolean allowed(Packet packet, XMPPResourceConnection session) { try { if (allowedByDefault(packet, session)) return true; Element list = Privacy.getActiveList(session); if ((list == null) ) { list = Privacy.getDefaultList( session ); } if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "Using privcy l... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { protected boolean allowed(Packet packet, XMPPResourceConnection session) { try { if (allowedByDefault(packet, session)) return true; Element list = Privacy.getActiveList(session); if ((list == null) ) { list = ... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { protected boolean allowed(Packet packet, XMPPResourceConnection session) { try { if (allowedByDefault(packet, session)) return true; Element list = Privacy.getActiveList(session); if ((list == null) ) { list = ... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { protected boolean allowed(Packet packet, XMPPResourceConnection session) { try { if (allowedByDefault(packet, session)) return true; Element list = Privacy.getActiveList(session); if ((list == null) ) { list = ... | JabberIqPrivacy extends XMPPProcessor implements XMPPProcessorIfc, XMPPPreprocessorIfc, XMPPPacketFilterIfc { protected boolean allowed(Packet packet, XMPPResourceConnection session) { try { if (allowedByDefault(packet, session)) return true; Element list = Privacy.getActiveList(session); if ((list == null) ) { list = ... |
@Test public void testResourceSelectionForMessageDeliveryForBareJid() throws Exception { BareJID userJid = BareJID.bareJIDInstance("user1@example.com"); JID res1 = JID.jidInstance(userJid, "res1"); JID res2 = JID.jidInstance(userJid, "res2"); XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com... | @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == null) return; if (packet.getElemName() == Iq.ELEM_NAME) { boolean enable = packet.getElement().getChild(ENABLE_ELEM_NAME, XM... | MessageCarbons extends XMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc,
XMPPPresenceUpdateProcessorIfc { @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == ... | MessageCarbons extends XMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc,
XMPPPresenceUpdateProcessorIfc { @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == ... | MessageCarbons extends XMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc,
XMPPPresenceUpdateProcessorIfc { @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == ... | MessageCarbons extends XMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc,
XMPPPresenceUpdateProcessorIfc { @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == ... |
@Test public void testFind() { final HashMap<String, String> domains = new HashMap<String, String>(); domains.put("one.com", "one.com"); domains.put("a.two.com", "a.two.com"); domains.put("*.two.com", "*.two.com"); assertEquals("one.com", SSLContextContainer.find(domains, "one.com")); assertNull(SSLContextContainer.fin... | public static <T> T find(Map<String, T> data, String key) { if (data.containsKey(key)) { return data.get(key); } int idx = key.indexOf("."); if (idx >= 0) { String asteriskKey = "*" + key.substring(idx); T value = data.get(asteriskKey); if (value != null) { data.put(key, value); return value; } } return null; } | SSLContextContainer implements SSLContextContainerIfc { public static <T> T find(Map<String, T> data, String key) { if (data.containsKey(key)) { return data.get(key); } int idx = key.indexOf("."); if (idx >= 0) { String asteriskKey = "*" + key.substring(idx); T value = data.get(asteriskKey); if (value != null) { data.p... | SSLContextContainer implements SSLContextContainerIfc { public static <T> T find(Map<String, T> data, String key) { if (data.containsKey(key)) { return data.get(key); } int idx = key.indexOf("."); if (idx >= 0) { String asteriskKey = "*" + key.substring(idx); T value = data.get(asteriskKey); if (value != null) { data.p... | SSLContextContainer implements SSLContextContainerIfc { public static <T> T find(Map<String, T> data, String key) { if (data.containsKey(key)) { return data.get(key); } int idx = key.indexOf("."); if (idx >= 0) { String asteriskKey = "*" + key.substring(idx); T value = data.get(asteriskKey); if (value != null) { data.p... | SSLContextContainer implements SSLContextContainerIfc { public static <T> T find(Map<String, T> data, String key) { if (data.containsKey(key)) { return data.get(key); } int idx = key.indexOf("."); if (idx >= 0) { String asteriskKey = "*" + key.substring(idx); T value = data.get(asteriskKey); if (value != null) { data.p... |
@Test public void testResourceSelectionForMessageDeliveryForFullJid() throws Exception { BareJID userJid = BareJID.bareJIDInstance("user1@example.com"); JID res1 = JID.jidInstance(userJid, "res1"); JID res2 = JID.jidInstance(userJid, "res2"); XMPPResourceConnection session1 = getSession(JID.jidInstance("c2s@example.com... | @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == null) return; if (packet.getElemName() == Iq.ELEM_NAME) { boolean enable = packet.getElement().getChild(ENABLE_ELEM_NAME, XM... | MessageCarbons extends XMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc,
XMPPPresenceUpdateProcessorIfc { @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == ... | MessageCarbons extends XMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc,
XMPPPresenceUpdateProcessorIfc { @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == ... | MessageCarbons extends XMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc,
XMPPPresenceUpdateProcessorIfc { @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == ... | MessageCarbons extends XMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc,
XMPPPresenceUpdateProcessorIfc { @Override public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws XMPPException { if (session == ... |
@Test public void testAuthorizationForSingleDomain() throws TigaseStringprepException { Queue<Packet> results = new ArrayDeque<>(); handler = new S2SConnectionHandlerImpl(results); dialback.init(handler, new HashMap()); String key = UUID.randomUUID().toString(); S2SIOService serv = new S2SIOService(); serv.setSessionId... | @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "{0}, Proc... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... |
@Test public void testAuthorizationForSingleDomainFailure() throws TigaseStringprepException { Queue<Packet> results = new ArrayDeque<>(); handler = new S2SConnectionHandlerImpl(results); dialback.init(handler, new HashMap()); String key = UUID.randomUUID().toString(); S2SIOService serv = new S2SIOService(); serv.setSe... | @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "{0}, Proc... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... |
@Test public void testAuthorizationWithMultiplexing() throws TigaseStringprepException { Queue<Packet> results = new ArrayDeque<>(); handler = new S2SConnectionHandlerImpl(results); dialback.init(handler, new HashMap()); String key = UUID.randomUUID().toString(); S2SIOService serv = new S2SIOService(); serv.setSessionI... | @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "{0}, Proc... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... |
@Test public void testAuthorizationWithMultiplexingWithFailure() throws TigaseStringprepException { Queue<Packet> results = new ArrayDeque<>(); handler = new S2SConnectionHandlerImpl(results); dialback.init(handler, new HashMap()); String key = UUID.randomUUID().toString(); S2SIOService serv = new S2SIOService(); serv.... | @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "{0}, Proc... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... | Dialback extends S2SAbstractProcessor { @Override public boolean process(Packet p, S2SIOService serv, Queue<Packet> results) { CID cid = (CID) serv.getSessionData().get("cid"); boolean skipTLS = (cid == null) ? false : skipTLSForHost(cid.getRemoteHost()); if (p.getXMLNS() == XMLNS_DB_VAL) { if (log.isLoggable(Level.FIN... |
@Test public void testHandshakeFail() throws NoSuchAlgorithmException, IOException { final ByteBuffer tmp = ByteBuffer.allocate(2048); WebSocketXMPPIOService<Object> io = new WebSocketXMPPIOService<Object>(new WebSocketProtocolIfc[]{ new WebSocketHixie76() }) { @Override protected void writeBytes(ByteBuffer data) { tmp... | @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADER.length() * 2); response.append(RESPONSE_HEADER... | WebSocketHybi implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADE... | WebSocketHybi implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADE... | WebSocketHybi implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADE... | WebSocketHybi implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADE... |
@Test public void testHandshakeOK() throws NoSuchAlgorithmException, IOException { final ByteBuffer tmp = ByteBuffer.allocate(2048); WebSocketXMPPIOService<Object> io = new WebSocketXMPPIOService<Object>(new WebSocketProtocolIfc[]{ new WebSocketHixie76() }) { @Override protected void writeBytes(ByteBuffer data) { tmp.p... | @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADER.length() * 2); response.append(RESPONSE_HEADER... | WebSocketHybi implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADE... | WebSocketHybi implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADE... | WebSocketHybi implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADE... | WebSocketHybi implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (!headers.containsKey(WS_VERSION_KEY)) { return false; } StringBuilder response = new StringBuilder(RESPONSE_HEADE... |
@Test public void testHttpHeadersParsingWithSpaces() throws UnsupportedEncodingException { byte[] data = prepareHTTPRequest(headers, true); Map<String, String> parsedHeaders = new HashMap<>(); service.parseHttpHeaders(data, parsedHeaders); assertMaps(headers, parsedHeaders); } | protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringBuilder(64); String key = null; boolean skipWhitespace = fa... | WebSocketXMPPIOService extends XMPPIOService<RefObject> { protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringB... | WebSocketXMPPIOService extends XMPPIOService<RefObject> { protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringB... | WebSocketXMPPIOService extends XMPPIOService<RefObject> { protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringB... | WebSocketXMPPIOService extends XMPPIOService<RefObject> { protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringB... |
@Test public void testHttpHeadersParsingWithoutSpaces() throws UnsupportedEncodingException { byte[] data = prepareHTTPRequest(headers, false); Map<String, String> parsedHeaders = new HashMap<>(); service.parseHttpHeaders(data, parsedHeaders); assertMaps(headers, parsedHeaders); } | protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringBuilder(64); String key = null; boolean skipWhitespace = fa... | WebSocketXMPPIOService extends XMPPIOService<RefObject> { protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringB... | WebSocketXMPPIOService extends XMPPIOService<RefObject> { protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringB... | WebSocketXMPPIOService extends XMPPIOService<RefObject> { protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringB... | WebSocketXMPPIOService extends XMPPIOService<RefObject> { protected int parseHttpHeaders(byte[] buf, Map<String, String> headers) { int i = 0; while (buf[i] != '\n') { i++; } i++; if (log.isLoggable(Level.FINEST)) { log.log(Level.FINEST, "parsing request = \n{0}", new String(buf)); } StringBuilder builder = new StringB... |
@Test public void testHandshakeOK() throws NoSuchAlgorithmException, IOException { final ByteBuffer tmp = ByteBuffer.allocate(2048); WebSocketXMPPIOService<Object> io = new WebSocketXMPPIOService<Object>(new WebSocketProtocolIfc[]{ new WebSocketHixie76() }) { @Override protected void writeBytes(ByteBuffer data) { tmp.p... | @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeHyxie76SecKey(headers.get(WS_KEY1_KEY)); Long secKey... | WebSocketHixie76 implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeH... | WebSocketHixie76 implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeH... | WebSocketHixie76 implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeH... | WebSocketHixie76 implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeH... |
@Test public void testGetData() throws InterruptedException { System.out.println( "repo: " + repo ); if ( repo != null ){ LocalDateTime localNow = LocalDateTime.now(); long initalDelay = 5; ScheduledExecutorService scheduler = Executors.newScheduledThreadPool( 10 ); final int iter = 50; final int threads = 10; for ( in... | @Override public String getData(BareJID user_id, final String subnode, final String key, final String def) throws UserNotFoundException, TigaseDBException { try { long nid = getNodeNID(null, user_id, subnode); if (log.isLoggable(Level.FINEST)) { log.log( Level.FINEST, "Loading data for key: {0}, user: {1}, node: {2}, d... | JDBCRepository implements AuthRepository, UserRepository { @Override public String getData(BareJID user_id, final String subnode, final String key, final String def) throws UserNotFoundException, TigaseDBException { try { long nid = getNodeNID(null, user_id, subnode); if (log.isLoggable(Level.FINEST)) { log.log( Level.... | JDBCRepository implements AuthRepository, UserRepository { @Override public String getData(BareJID user_id, final String subnode, final String key, final String def) throws UserNotFoundException, TigaseDBException { try { long nid = getNodeNID(null, user_id, subnode); if (log.isLoggable(Level.FINEST)) { log.log( Level.... | JDBCRepository implements AuthRepository, UserRepository { @Override public String getData(BareJID user_id, final String subnode, final String key, final String def) throws UserNotFoundException, TigaseDBException { try { long nid = getNodeNID(null, user_id, subnode); if (log.isLoggable(Level.FINEST)) { log.log( Level.... | JDBCRepository implements AuthRepository, UserRepository { @Override public String getData(BareJID user_id, final String subnode, final String key, final String def) throws UserNotFoundException, TigaseDBException { try { long nid = getNodeNID(null, user_id, subnode); if (log.isLoggable(Level.FINEST)) { log.log( Level.... |
@Test public void testHandshakeFail() throws NoSuchAlgorithmException, IOException { final ByteBuffer tmp = ByteBuffer.allocate(2048); WebSocketXMPPIOService<Object> io = new WebSocketXMPPIOService<Object>(new WebSocketProtocolIfc[]{ new WebSocketHixie76() }) { @Override protected void writeBytes(ByteBuffer data) { tmp... | @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeHyxie76SecKey(headers.get(WS_KEY1_KEY)); Long secKey... | WebSocketHixie76 implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeH... | WebSocketHixie76 implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeH... | WebSocketHixie76 implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeH... | WebSocketHixie76 implements WebSocketProtocolIfc { @Override public boolean handshake(WebSocketXMPPIOService service, Map<String, String> headers, byte[] buf) throws NoSuchAlgorithmException, IOException { if (headers.containsKey(WS_VERSION_KEY)) { return false; } byte[] secBufArr = new byte[16]; Long secKey1 = decodeH... |
@Test @SuppressWarnings("deprecation") public void testGetMethodName() { SimpleParser parser = new SimpleParser(); DomBuilderHandler handler = new DomBuilderHandler(); char[] data = "<cluster to=\"sess-man@blue\" type=\"set\" id=\"cl-6627\" xmlns=\"tigase:cluster\" from=\"sess-man@green\"><control><visited-nodes><node-... | public String getMethodName() { return method_name; } | ClusterElement { public String getMethodName() { return method_name; } } | ClusterElement { public String getMethodName() { return method_name; } ClusterElement(Element elem); ClusterElement(JID from, JID to, StanzaType type, Packet packet); } | ClusterElement { public String getMethodName() { return method_name; } ClusterElement(Element elem); ClusterElement(JID from, JID to, StanzaType type, Packet packet); static Element clusterElement(JID from, JID to, StanzaType type); static Element createClusterElement(JID from, JID to, StanzaType type,
String pac... | ClusterElement { public String getMethodName() { return method_name; } ClusterElement(Element elem); ClusterElement(JID from, JID to, StanzaType type, Packet packet); static Element clusterElement(JID from, JID to, StanzaType type); static Element createClusterElement(JID from, JID to, StanzaType type,
String pac... |
@Test public void testSelectConnection() throws Exception { ClusterConnection conn = new ClusterConnection("test"); ClusterConnectionSelector selector = new ClusterConnectionSelector(); selector.setClusterConnectionHandler(new ClusterConnectionHandler() { @Override public int hashCodeForPacket(Packet packet) { return p... | @Override public XMPPIOService<Object> selectConnection(Packet p, ClusterConnection conn) { if (conn == null) return null; int code = Math.abs(handler.hashCodeForPacket(p)); List<XMPPIOService<Object>> conns = conn.getConnections(); if (conns.size() > 0) { if (conns.size() > sysConns) { if (p.getPriority() != null && p... | ClusterConnectionSelector implements ClusterConnectionSelectorIfc { @Override public XMPPIOService<Object> selectConnection(Packet p, ClusterConnection conn) { if (conn == null) return null; int code = Math.abs(handler.hashCodeForPacket(p)); List<XMPPIOService<Object>> conns = conn.getConnections(); if (conns.size() > ... | ClusterConnectionSelector implements ClusterConnectionSelectorIfc { @Override public XMPPIOService<Object> selectConnection(Packet p, ClusterConnection conn) { if (conn == null) return null; int code = Math.abs(handler.hashCodeForPacket(p)); List<XMPPIOService<Object>> conns = conn.getConnections(); if (conns.size() > ... | ClusterConnectionSelector implements ClusterConnectionSelectorIfc { @Override public XMPPIOService<Object> selectConnection(Packet p, ClusterConnection conn) { if (conn == null) return null; int code = Math.abs(handler.hashCodeForPacket(p)); List<XMPPIOService<Object>> conns = conn.getConnections(); if (conns.size() > ... | ClusterConnectionSelector implements ClusterConnectionSelectorIfc { @Override public XMPPIOService<Object> selectConnection(Packet p, ClusterConnection conn) { if (conn == null) return null; int code = Math.abs(handler.hashCodeForPacket(p)); List<XMPPIOService<Object>> conns = conn.getConnections(); if (conns.size() > ... |
@Test public void testParseRules() throws TigaseStringprepException, ParseException { System.out.println( "parseRules" ); Set<Rule> expResult = new TreeSet<>(); Rule rule = new Rule( 1, true, RuleType.self, null ); if ( rule != null ){ expResult.add( rule ); } rule = new Rule( 2, true, RuleType.jid, JID.jidInstance( "a... | public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); static Set<Rule> parseRules( String rules ); static Set<Rule> parseRules( String... | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); static Set<Rule> parseRules( String rules ); static Set<Rule> parseRules( String... |
@Test public void testParseRulesString() throws TigaseStringprepException, ParseException { System.out.println( "parseRules" ); String rulseString = "4|deny|all;1|allow|self;3|allow|jid|pubsub@test.com;2|allow|jid|admin@test2.com"; Set<Rule> expResult = new TreeSet<>(); Rule rule = new Rule( 1, true, RuleType.self, nul... | public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); static Set<Rule> parseRules( String rules ); static Set<Rule> parseRules( String... | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); static Set<Rule> parseRules( String rules ); static Set<Rule> parseRules( String... |
@Test(expected = ParseException.class) public void testParseRulesException() throws TigaseStringprepException, ParseException { String[] rules_fail = { "8|deny|||self,", "|||18|||deny,self::::" }; Set<Rule> result = CustomDomainFilter.parseRules( rules_fail ); } | public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); } | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); static Set<Rule> parseRules( String rules ); static Set<Rule> parseRules( String... | CustomDomainFilter { public static Set<Rule> parseRules( String rules ) throws ParseException { String[] rulesArr = rules.split( ";" ); if ( rulesArr != null ){ return parseRules( rulesArr ); } return null; } private CustomDomainFilter(); static Set<Rule> parseRules( String rules ); static Set<Rule> parseRules( String... |
@Test public void testIsAllowed() throws TigaseStringprepException, ParseException { JID jid1_r1 = JID.jidInstance( "user1", "domain1", "resource1" ); JID jid1_r2 = JID.jidInstance( "user1", "domain1", "resource2" ); JID jid2_r1 = JID.jidInstance( "user2", "domain1", "resource1" ); JID jid3_r1 = JID.jidInstance( "user3... | public static boolean isAllowed( JID source, JID destination, String rules ) { try { Set<Rule> parseRules = parseRules( rules ); if ( parseRules != null ){ return isAllowed( source, destination, parseRules ); } else { return true; } } catch ( ParseException e ) { return true; } } | CustomDomainFilter { public static boolean isAllowed( JID source, JID destination, String rules ) { try { Set<Rule> parseRules = parseRules( rules ); if ( parseRules != null ){ return isAllowed( source, destination, parseRules ); } else { return true; } } catch ( ParseException e ) { return true; } } } | CustomDomainFilter { public static boolean isAllowed( JID source, JID destination, String rules ) { try { Set<Rule> parseRules = parseRules( rules ); if ( parseRules != null ){ return isAllowed( source, destination, parseRules ); } else { return true; } } catch ( ParseException e ) { return true; } } private CustomDom... | CustomDomainFilter { public static boolean isAllowed( JID source, JID destination, String rules ) { try { Set<Rule> parseRules = parseRules( rules ); if ( parseRules != null ){ return isAllowed( source, destination, parseRules ); } else { return true; } } catch ( ParseException e ) { return true; } } private CustomDom... | CustomDomainFilter { public static boolean isAllowed( JID source, JID destination, String rules ) { try { Set<Rule> parseRules = parseRules( rules ); if ( parseRules != null ){ return isAllowed( source, destination, parseRules ); } else { return true; } } catch ( ParseException e ) { return true; } } private CustomDom... |
@Test public void testCreateNodeName() throws Exception { assertEquals("1|2", NodeNameUtil.createNodeName("1", "2")); assertEquals("*|2", NodeNameUtil.createNodeName(null, "2")); assertEquals("*|*", NodeNameUtil.createNodeName(null, null)); assertEquals("1|*", NodeNameUtil.createNodeName("1", null)); } | public static String createNodeName(String eventName, String xmlns) { return (eventName == null ? "*" : eventName) + "|" + (xmlns == null ? "*" : xmlns); } | NodeNameUtil { public static String createNodeName(String eventName, String xmlns) { return (eventName == null ? "*" : eventName) + "|" + (xmlns == null ? "*" : xmlns); } } | NodeNameUtil { public static String createNodeName(String eventName, String xmlns) { return (eventName == null ? "*" : eventName) + "|" + (xmlns == null ? "*" : xmlns); } private NodeNameUtil(); } | NodeNameUtil { public static String createNodeName(String eventName, String xmlns) { return (eventName == null ? "*" : eventName) + "|" + (xmlns == null ? "*" : xmlns); } private NodeNameUtil(); static String createNodeName(String eventName, String xmlns); static EventName parseNodeName(String nodeName); } | NodeNameUtil { public static String createNodeName(String eventName, String xmlns) { return (eventName == null ? "*" : eventName) + "|" + (xmlns == null ? "*" : xmlns); } private NodeNameUtil(); static String createNodeName(String eventName, String xmlns); static EventName parseNodeName(String nodeName); } |
@Test public void testParseNodeName() throws Exception { assertEquals(new EventName("1", "2"), NodeNameUtil.parseNodeName("1|2")); assertEquals(new EventName(null, "2"), NodeNameUtil.parseNodeName("*|2")); assertEquals(new EventName(null, null), NodeNameUtil.parseNodeName("*|*")); assertEquals(new EventName("1", null),... | public static EventName parseNodeName(String nodeName) { int i = nodeName.indexOf('|'); String n = nodeName.substring(0, i); String x = nodeName.substring(i + 1); return new EventName(n.equals("*") ? null : n, x.equals("*") ? null : x); } | NodeNameUtil { public static EventName parseNodeName(String nodeName) { int i = nodeName.indexOf('|'); String n = nodeName.substring(0, i); String x = nodeName.substring(i + 1); return new EventName(n.equals("*") ? null : n, x.equals("*") ? null : x); } } | NodeNameUtil { public static EventName parseNodeName(String nodeName) { int i = nodeName.indexOf('|'); String n = nodeName.substring(0, i); String x = nodeName.substring(i + 1); return new EventName(n.equals("*") ? null : n, x.equals("*") ? null : x); } private NodeNameUtil(); } | NodeNameUtil { public static EventName parseNodeName(String nodeName) { int i = nodeName.indexOf('|'); String n = nodeName.substring(0, i); String x = nodeName.substring(i + 1); return new EventName(n.equals("*") ? null : n, x.equals("*") ? null : x); } private NodeNameUtil(); static String createNodeName(String event... | NodeNameUtil { public static EventName parseNodeName(String nodeName) { int i = nodeName.indexOf('|'); String n = nodeName.substring(0, i); String x = nodeName.substring(i + 1); return new EventName(n.equals("*") ? null : n, x.equals("*") ? null : x); } private NodeNameUtil(); static String createNodeName(String event... |
@Test public void testEquals() throws Exception { assertEquals(new EventName(null, null), new EventName(null, null)); assertEquals(new EventName(null, "2"), new EventName(null, "2")); assertEquals(new EventName("1", "2"), new EventName("1", "2")); assertNotEquals(new EventName(null, null), new EventName("2", "2")); ass... | @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EventName other = (EventName) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (xmlns == null) { ... | EventName { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EventName other = (EventName) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (xmlns... | EventName { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EventName other = (EventName) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (xmlns... | EventName { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EventName other = (EventName) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (xmlns... | EventName { @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EventName other = (EventName) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; if (xmlns... |
@Test public void testRecipientDisabledFor2ResourcesMessage() throws TigaseStringprepException, NotAuthorizedException { String recipient = "recipient-1@localhost"; JID recp1 = JID.jidInstanceNS(recipient + "/res1"); JID recp2 = JID.jidInstanceNS(recipient + "/res2"); JID connId1 = JID.jidInstanceNS("c2s@localhost/reci... | @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() || (results == null) || (results.size() == 0)) { return; } StateHolder holder = threadState.g... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... |
@Test public void testRecipientEnabledFor2ResourcesMessage() throws TigaseStringprepException, NotAuthorizedException { String recipient = "recipient-1@localhost"; JID recp1 = JID.jidInstanceNS(recipient + "/res1"); JID recp2 = JID.jidInstanceNS(recipient + "/res2"); JID connId1 = JID.jidInstanceNS("c2s@localhost/recip... | @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() || (results == null) || (results.size() == 0)) { return; } StateHolder holder = threadState.g... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... |
@Test public void testRecipientDisabledFor2ResourcesPresence() throws TigaseStringprepException, NotAuthorizedException { String recipient = "recipient-1@localhost"; JID recp1 = JID.jidInstanceNS(recipient + "/res1"); JID recp2 = JID.jidInstanceNS(recipient + "/res2"); JID connId1 = JID.jidInstanceNS("c2s@localhost/rec... | @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() || (results == null) || (results.size() == 0)) { return; } StateHolder holder = threadState.g... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... | MobileV3 extends AnnotatedXMPPProcessor implements XMPPProcessorIfc, XMPPPacketFilterIfc { @Override @SuppressWarnings("unchecked") public void filter(Packet _packet, XMPPResourceConnection sessionFromSM, NonAuthUserRepository repo, Queue<Packet> results) { if ((sessionFromSM == null) ||!sessionFromSM.isAuthorized() ||... |
@Test(expected = IIOException.class) public void testResizeNullImage() throws Exception { cut.resize((BufferedImage) null); } | public byte[] resize(BufferedImage originalImage) throws IOException { if (originalImage == null) { throw new IIOException("Image is null. Did ImageIO fail to decode the image?"); } BufferedImage resized = ImageUtil.resizeImage(originalImage, size, size); originalImage.flush(); byte[] resizedBytes = com.github.dozedoff... | ImageResizer { public byte[] resize(BufferedImage originalImage) throws IOException { if (originalImage == null) { throw new IIOException("Image is null. Did ImageIO fail to decode the image?"); } BufferedImage resized = ImageUtil.resizeImage(originalImage, size, size); originalImage.flush(); byte[] resizedBytes = com.... | ImageResizer { public byte[] resize(BufferedImage originalImage) throws IOException { if (originalImage == null) { throw new IIOException("Image is null. Did ImageIO fail to decode the image?"); } BufferedImage resized = ImageUtil.resizeImage(originalImage, size, size); originalImage.flush(); byte[] resizedBytes = com.... | ImageResizer { public byte[] resize(BufferedImage originalImage) throws IOException { if (originalImage == null) { throw new IIOException("Image is null. Did ImageIO fail to decode the image?"); } BufferedImage resized = ImageUtil.resizeImage(originalImage, size, size); originalImage.flush(); byte[] resizedBytes = com.... | ImageResizer { public byte[] resize(BufferedImage originalImage) throws IOException { if (originalImage == null) { throw new IIOException("Image is null. Did ImageIO fail to decode the image?"); } BufferedImage resized = ImageUtil.resizeImage(originalImage, size, size); originalImage.flush(); byte[] resizedBytes = com.... |
@Test public void testGetByHashNotFound() throws Exception { assertThat(cut.getByHash(HASH_NEW_RECORD), hasSize(0)); } | @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteImageRepository... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteImageRepository... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getByHash(long hash) throws RepositoryException { try { return imageDao.queryForMatching(new ImageRecord(null, hash)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteImageRepository... |
@Test public void testGetByPathExists() throws Exception { assertThat(cut.getByPath(Paths.get(pathExisting)), is(imageExisting)); } | @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } | OrmliteImageRepository implements ImageRepository { @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } OrmliteImageRepository(Dao<ImageRecord, Strin... | OrmliteImageRepository implements ImageRepository { @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } OrmliteImageRepository(Dao<ImageRecord, Strin... | OrmliteImageRepository implements ImageRepository { @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } OrmliteImageRepository(Dao<ImageRecord, Strin... |
@Test public void testGetByPathNotFound() throws Exception { assertThat(cut.getByPath(Paths.get(pathNew)), is(nullValue())); } | @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } | OrmliteImageRepository implements ImageRepository { @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } OrmliteImageRepository(Dao<ImageRecord, Strin... | OrmliteImageRepository implements ImageRepository { @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } OrmliteImageRepository(Dao<ImageRecord, Strin... | OrmliteImageRepository implements ImageRepository { @Override public ImageRecord getByPath(Path path) throws RepositoryException { try { return imageDao.queryForId(path.toString()); } catch (SQLException e) { throw new RepositoryException("Failed to query for path", e); } } OrmliteImageRepository(Dao<ImageRecord, Strin... |
@Test public void testStartsWithPath() throws Exception { assertThat(cut.startsWithPath(Paths.get("exi")), containsInAnyOrder(imageExisting)); } | @Override public synchronized List<ImageRecord> startsWithPath(Path directory) throws RepositoryException { argStartsWithPath.setValue(directory.toString() + STRING_QUERY_WILDCARD); try { return imageDao.query(queryStartsWithPath); } catch (SQLException e) { throw new RepositoryException("Failed to query for starts wit... | OrmliteImageRepository implements ImageRepository { @Override public synchronized List<ImageRecord> startsWithPath(Path directory) throws RepositoryException { argStartsWithPath.setValue(directory.toString() + STRING_QUERY_WILDCARD); try { return imageDao.query(queryStartsWithPath); } catch (SQLException e) { throw new... | OrmliteImageRepository implements ImageRepository { @Override public synchronized List<ImageRecord> startsWithPath(Path directory) throws RepositoryException { argStartsWithPath.setValue(directory.toString() + STRING_QUERY_WILDCARD); try { return imageDao.query(queryStartsWithPath); } catch (SQLException e) { throw new... | OrmliteImageRepository implements ImageRepository { @Override public synchronized List<ImageRecord> startsWithPath(Path directory) throws RepositoryException { argStartsWithPath.setValue(directory.toString() + STRING_QUERY_WILDCARD); try { return imageDao.query(queryStartsWithPath); } catch (SQLException e) { throw new... | OrmliteImageRepository implements ImageRepository { @Override public synchronized List<ImageRecord> startsWithPath(Path directory) throws RepositoryException { argStartsWithPath.setValue(directory.toString() + STRING_QUERY_WILDCARD); try { return imageDao.query(queryStartsWithPath); } catch (SQLException e) { throw new... |
@Test public void testRemoveImageRecord() throws Exception { cut.remove(imageExisting); assertThat(imageDao.queryForMatching(imageExisting), hasSize(0)); } | @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } | OrmliteImageRepository implements ImageRepository { @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... | OrmliteImageRepository implements ImageRepository { @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... | OrmliteImageRepository implements ImageRepository { @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... |
@Test public void testRemoveImageRecordCollection() throws Exception { imageDao.create(imageNew); List<ImageRecord> toRemove = new LinkedList<ImageRecord>(); toRemove.add(imageExisting); toRemove.add(imageNew); assertThat(imageDao.queryForAll(), hasSize(2)); cut.remove(toRemove); assertThat(imageDao.queryForMatching(im... | @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } | OrmliteImageRepository implements ImageRepository { @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... | OrmliteImageRepository implements ImageRepository { @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... | OrmliteImageRepository implements ImageRepository { @Override public void remove(ImageRecord image) throws RepositoryException { try { imageDao.delete(image); } catch (SQLException e) { throw new RepositoryException("Failed to remove image", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... |
@Test public void testGetAll() throws Exception { imageDao.create(imageNew); assertThat(cut.getAll(), containsInAnyOrder(imageExisting, imageNew)); } | @Override public List<ImageRecord> getAll() throws RepositoryException { try { return imageDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAll() throws RepositoryException { try { return imageDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAll() throws RepositoryException { try { return imageDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAll() throws RepositoryException { try { return imageDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAll() throws RepositoryException { try { return imageDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } OrmliteImageRepository(Dao<ImageRecord, String> imageDao, Dao<IgnoreRe... |
@Test public void testGetAllWithoutIgnored() throws Exception { imageDao.create(imageNew); List<ImageRecord> result = cut.getAllWithoutIgnored(); assertThat(result, hasItem(imageNew)); assertThat(result, hasSize(1)); } | @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... |
@Test public void testGetAllWithoutIgnoredPath() throws Exception { imageDao.create(imageNew); List<ImageRecord> result = cut.getAllWithoutIgnored(Paths.get(pathNew)); assertThat(result, hasItem(imageNew)); assertThat(result, hasSize(1)); } | @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... |
@Test public void testGetAllWithoutIgnoredPathNoMatch() throws Exception { imageDao.create(imageNew); List<ImageRecord> result = cut.getAllWithoutIgnored(Paths.get(pathExisting)); assertThat(result, is(empty())); } | @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } } | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... | OrmliteImageRepository implements ImageRepository { @Override public List<ImageRecord> getAllWithoutIgnored() throws RepositoryException { try { return imageDao.query(queryNotIgnored); } catch (SQLException e) { throw new RepositoryException("Failed to query for non-ignored", e); } } OrmliteImageRepository(Dao<ImageRec... |
@Test public void testSetExtendedAttributePathStringString() throws Exception { ExtendedAttribute.setExtendedAttribute(tempFile, TEST_NAME, TEST_VALUE); } | public static void setExtendedAttribute(Path path, String name, String value) throws IOException { setExtendedAttribute(path, name, StandardCharsets.US_ASCII.encode(value)); } | ExtendedAttribute implements ExtendedAttributeQuery { public static void setExtendedAttribute(Path path, String name, String value) throws IOException { setExtendedAttribute(path, name, StandardCharsets.US_ASCII.encode(value)); } } | ExtendedAttribute implements ExtendedAttributeQuery { public static void setExtendedAttribute(Path path, String name, String value) throws IOException { setExtendedAttribute(path, name, StandardCharsets.US_ASCII.encode(value)); } } | ExtendedAttribute implements ExtendedAttributeQuery { public static void setExtendedAttribute(Path path, String name, String value) throws IOException { setExtendedAttribute(path, name, StandardCharsets.US_ASCII.encode(value)); } static String createName(String... names); static boolean supportsExtendedAttributes(Path... | ExtendedAttribute implements ExtendedAttributeQuery { public static void setExtendedAttribute(Path path, String name, String value) throws IOException { setExtendedAttribute(path, name, StandardCharsets.US_ASCII.encode(value)); } static String createName(String... names); static boolean supportsExtendedAttributes(Path... |
@Test public void testGetByName() throws Exception { Tag result = cut.getByName(TAG_EXSTING); assertThat(result, is(tagExsting)); } | @Override public synchronized Tag getByName(String name) throws RepositoryException { try { nameArg.setValue(name); return tagDao.queryForFirst(nameQuery); } catch (SQLException e) { throw new RepositoryException("Failed to query by name", e); } } | OrmliteTagRepository implements TagRepository { @Override public synchronized Tag getByName(String name) throws RepositoryException { try { nameArg.setValue(name); return tagDao.queryForFirst(nameQuery); } catch (SQLException e) { throw new RepositoryException("Failed to query by name", e); } } } | OrmliteTagRepository implements TagRepository { @Override public synchronized Tag getByName(String name) throws RepositoryException { try { nameArg.setValue(name); return tagDao.queryForFirst(nameQuery); } catch (SQLException e) { throw new RepositoryException("Failed to query by name", e); } } OrmliteTagRepository(Dao... | OrmliteTagRepository implements TagRepository { @Override public synchronized Tag getByName(String name) throws RepositoryException { try { nameArg.setValue(name); return tagDao.queryForFirst(nameQuery); } catch (SQLException e) { throw new RepositoryException("Failed to query by name", e); } } OrmliteTagRepository(Dao... | OrmliteTagRepository implements TagRepository { @Override public synchronized Tag getByName(String name) throws RepositoryException { try { nameArg.setValue(name); return tagDao.queryForFirst(nameQuery); } catch (SQLException e) { throw new RepositoryException("Failed to query by name", e); } } OrmliteTagRepository(Dao... |
@Test public void testStore() throws Exception { cut.store(tagNew); Tag result = cut.getByName(TAG_NEW); assertThat(result, is(tagNew)); } | @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } | OrmliteTagRepository implements TagRepository { @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } } | OrmliteTagRepository implements TagRepository { @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); } | OrmliteTagRepository implements TagRepository { @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); @Override synchronized Tag getByName(String... | OrmliteTagRepository implements TagRepository { @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); @Override synchronized Tag getByName(String... |
@Test(expected = RepositoryException.class) public void testStoreDuplicate() throws Exception { cut.store(tagNew); cut.store(new Tag(TAG_NEW)); } | @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } | OrmliteTagRepository implements TagRepository { @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } } | OrmliteTagRepository implements TagRepository { @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); } | OrmliteTagRepository implements TagRepository { @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); @Override synchronized Tag getByName(String... | OrmliteTagRepository implements TagRepository { @Override public void store(Tag tag) throws RepositoryException { try { tagDao.createOrUpdate(tag); } catch (SQLException e) { throw new RepositoryException("Failed to store", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); @Override synchronized Tag getByName(String... |
@Test public void testRemove() throws Exception { cut.remove(tagExsting); Tag result = cut.getByName(TAG_EXSTING); assertThat(result, is(nullValue())); } | @Override public void remove(Tag tag) throws RepositoryException { try { tagDao.delete(tag); } catch (SQLException e) { throw new RepositoryException("Failed to delete", e); } } | OrmliteTagRepository implements TagRepository { @Override public void remove(Tag tag) throws RepositoryException { try { tagDao.delete(tag); } catch (SQLException e) { throw new RepositoryException("Failed to delete", e); } } } | OrmliteTagRepository implements TagRepository { @Override public void remove(Tag tag) throws RepositoryException { try { tagDao.delete(tag); } catch (SQLException e) { throw new RepositoryException("Failed to delete", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); } | OrmliteTagRepository implements TagRepository { @Override public void remove(Tag tag) throws RepositoryException { try { tagDao.delete(tag); } catch (SQLException e) { throw new RepositoryException("Failed to delete", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); @Override synchronized Tag getByName(String name)... | OrmliteTagRepository implements TagRepository { @Override public void remove(Tag tag) throws RepositoryException { try { tagDao.delete(tag); } catch (SQLException e) { throw new RepositoryException("Failed to delete", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); @Override synchronized Tag getByName(String name)... |
@Test public void testGetAll() throws Exception { List<Tag> results = cut.getAll(); assertThat(results, containsInAnyOrder(tagContext, tagExsting)); } | @Override public List<Tag> getAll() throws RepositoryException { try { return tagDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } | OrmliteTagRepository implements TagRepository { @Override public List<Tag> getAll() throws RepositoryException { try { return tagDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } } | OrmliteTagRepository implements TagRepository { @Override public List<Tag> getAll() throws RepositoryException { try { return tagDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); } | OrmliteTagRepository implements TagRepository { @Override public List<Tag> getAll() throws RepositoryException { try { return tagDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); @Override synchronized Tag getByName(St... | OrmliteTagRepository implements TagRepository { @Override public List<Tag> getAll() throws RepositoryException { try { return tagDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query all", e); } } OrmliteTagRepository(Dao<Tag, Long> tagDao); @Override synchronized Tag getByName(St... |
@Test public void testGetWithContext() throws Exception { List<Tag> results = cut.getWithContext(); assertThat(results, containsInAnyOrder(tagContext)); } | @Override public List<Tag> getWithContext() throws RepositoryException { try { return tagDao.queryForMatching(new Tag(null, true)); } catch (SQLException e) { throw new RepositoryException("Failed to query by context flag", e); } } | OrmliteTagRepository implements TagRepository { @Override public List<Tag> getWithContext() throws RepositoryException { try { return tagDao.queryForMatching(new Tag(null, true)); } catch (SQLException e) { throw new RepositoryException("Failed to query by context flag", e); } } } | OrmliteTagRepository implements TagRepository { @Override public List<Tag> getWithContext() throws RepositoryException { try { return tagDao.queryForMatching(new Tag(null, true)); } catch (SQLException e) { throw new RepositoryException("Failed to query by context flag", e); } } OrmliteTagRepository(Dao<Tag, Long> tagD... | OrmliteTagRepository implements TagRepository { @Override public List<Tag> getWithContext() throws RepositoryException { try { return tagDao.queryForMatching(new Tag(null, true)); } catch (SQLException e) { throw new RepositoryException("Failed to query by context flag", e); } } OrmliteTagRepository(Dao<Tag, Long> tagD... | OrmliteTagRepository implements TagRepository { @Override public List<Tag> getWithContext() throws RepositoryException { try { return tagDao.queryForMatching(new Tag(null, true)); } catch (SQLException e) { throw new RepositoryException("Failed to query by context flag", e); } } OrmliteTagRepository(Dao<Tag, Long> tagD... |
@Test public void testGetByHash() throws Exception { List<FilterRecord> filters = cut.getByHash(HASH_TWO); assertThat(filters, containsInAnyOrder(new FilterRecord(HASH_TWO, TAG_TWO, null))); } | @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteFilt... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteFilt... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteFilt... |
@Test(expected = RepositoryException.class) public void testGetByHashException() throws Exception { deleteFilterTable(); cut.getByHash(HASH_TWO); } | @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteFilt... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteFilt... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByHash(long hash) throws RepositoryException { try { return filterDao.queryForMatching(new FilterRecord(hash, null, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by hash", e); } } OrmliteFilt... |
@Test public void testGetByTag() throws Exception { List<FilterRecord> filters = cut.getByTag(TAG_ONE); assertThat(filters, containsInAnyOrder(new FilterRecord(HASH_ONE, TAG_ONE, null))); } | @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } OrmliteFilterRe... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } OrmliteFilterRe... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } OrmliteFilterRe... |
@Test(expected = RepositoryException.class) public void testGetByTagException() throws Exception { deleteFilterTable(); cut.getByTag(TAG_ONE); } | @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } OrmliteFilterRe... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } OrmliteFilterRe... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getByTag(Tag tag) throws RepositoryException { try { return filterDao.queryForMatchingArgs(new FilterRecord(0, tag, null)); } catch (SQLException e) { throw new RepositoryException("Failed to query by tag", e); } } OrmliteFilterRe... |
@Test public void testReadExtendedAttributeAsString() throws Exception { ExtendedAttribute.setExtendedAttribute(tempFile, TEST_NAME, TEST_VALUE); assertThat(ExtendedAttribute.readExtendedAttributeAsString(tempFile, TEST_NAME), is(TEST_VALUE)); } | public static String readExtendedAttributeAsString(Path path, String name) throws IOException { ByteBuffer buffer = readExtendedAttribute(path, name); return StandardCharsets.US_ASCII.decode(buffer).toString(); } | ExtendedAttribute implements ExtendedAttributeQuery { public static String readExtendedAttributeAsString(Path path, String name) throws IOException { ByteBuffer buffer = readExtendedAttribute(path, name); return StandardCharsets.US_ASCII.decode(buffer).toString(); } } | ExtendedAttribute implements ExtendedAttributeQuery { public static String readExtendedAttributeAsString(Path path, String name) throws IOException { ByteBuffer buffer = readExtendedAttribute(path, name); return StandardCharsets.US_ASCII.decode(buffer).toString(); } } | ExtendedAttribute implements ExtendedAttributeQuery { public static String readExtendedAttributeAsString(Path path, String name) throws IOException { ByteBuffer buffer = readExtendedAttribute(path, name); return StandardCharsets.US_ASCII.decode(buffer).toString(); } static String createName(String... names); static bo... | ExtendedAttribute implements ExtendedAttributeQuery { public static String readExtendedAttributeAsString(Path path, String name) throws IOException { ByteBuffer buffer = readExtendedAttribute(path, name); return StandardCharsets.US_ASCII.decode(buffer).toString(); } static String createName(String... names); static bo... |
@Test public void testGetAll() throws Exception { List<FilterRecord> filters = cut.getAll(); assertThat(filters, containsInAnyOrder(allFilters.toArray(new FilterRecord[0]))); } | @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao... |
@Test(expected = RepositoryException.class) public void testGetAllException() throws Exception { deleteFilterTable(); cut.getAll(); } | @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } } | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao... | OrmliteFilterRepository implements FilterRepository { @Override public List<FilterRecord> getAll() throws RepositoryException { try { return filterDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to get all filters", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao... |
@Test(expected = RepositoryException.class) public void testStoreThumbnailException() throws Exception { TableUtils.dropTable(cs, Thumbnail.class, false); cut.store(new FilterRecord(HASH_NEW_THUMBNAIL, TAG_ONE, newThumbnail)); } | @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { throw new RepositoryException(STORE_FILTER_ERROR_MSG, e)... | OrmliteFilterRepository implements FilterRepository { @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { th... | OrmliteFilterRepository implements FilterRepository { @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { th... | OrmliteFilterRepository implements FilterRepository { @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { th... | OrmliteFilterRepository implements FilterRepository { @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { th... |
@Test(expected = RepositoryException.class) public void testStoreFilterException() throws Exception { TableUtils.dropTable(cs, FilterRecord.class, false); cut.store(new FilterRecord(HASH_NEW_THUMBNAIL, TAG_ONE, null)); } | @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { throw new RepositoryException(STORE_FILTER_ERROR_MSG, e)... | OrmliteFilterRepository implements FilterRepository { @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { th... | OrmliteFilterRepository implements FilterRepository { @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { th... | OrmliteFilterRepository implements FilterRepository { @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { th... | OrmliteFilterRepository implements FilterRepository { @Override public void store(FilterRecord toStore) throws RepositoryException { if (toStore.hasThumbnail()) { checkAndCreateThumbnail(toStore); } try { if (filterDao.queryForMatchingArgs(toStore).isEmpty()) { filterDao.create(toStore); } } catch (SQLException e) { th... |
@Test public void testRemove() throws Exception { FilterRecord toRemove = allFilters.get(0); cut.remove(toRemove); assertThat(cut.getAll(), not(hasItem(toRemove))); } | @Override public void remove(FilterRecord filter) throws RepositoryException { try { filterDao.delete(filter); } catch (SQLException e) { throw new RepositoryException("Failed to remove Filter", e); } } | OrmliteFilterRepository implements FilterRepository { @Override public void remove(FilterRecord filter) throws RepositoryException { try { filterDao.delete(filter); } catch (SQLException e) { throw new RepositoryException("Failed to remove Filter", e); } } } | OrmliteFilterRepository implements FilterRepository { @Override public void remove(FilterRecord filter) throws RepositoryException { try { filterDao.delete(filter); } catch (SQLException e) { throw new RepositoryException("Failed to remove Filter", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao, D... | OrmliteFilterRepository implements FilterRepository { @Override public void remove(FilterRecord filter) throws RepositoryException { try { filterDao.delete(filter); } catch (SQLException e) { throw new RepositoryException("Failed to remove Filter", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao, D... | OrmliteFilterRepository implements FilterRepository { @Override public void remove(FilterRecord filter) throws RepositoryException { try { filterDao.delete(filter); } catch (SQLException e) { throw new RepositoryException("Failed to remove Filter", e); } } OrmliteFilterRepository(Dao<FilterRecord, Integer> filterDao, D... |
@Test public void testStoreNew() throws Exception { cut.store(newIgnore); assertThat(dao.queryForAll(), hasItem(newIgnore)); } | @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... |
@Test public void testStoreDuplicate() throws Exception { cut.store(existingIgnore); assertThat(dao.queryForAll(), hasSize(1)); } | @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... |
@Test public void testStoreNewSize() throws Exception { cut.store(newIgnore); assertThat(dao.queryForAll(), hasSize(2)); } | @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void store(IgnoreRecord toStore) throws RepositoryException { try { ignoreDao.createIfNotExists(toStore); } catch (SQLException e) { throw new RepositoryException("Failed to store ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ig... |
@Test public void testRemove() throws Exception { cut.remove(existingIgnore); assertThat(dao.queryForAll(), not(hasItem(existingIgnore))); } | @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao... |
@Test public void testRemoveSize() throws Exception { cut.remove(existingIgnore); assertThat(dao.queryForAll(), is(empty())); } | @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public void remove(IgnoreRecord toRemove) throws RepositoryException { try { ignoreDao.delete(toRemove); } catch (SQLException e) { throw new RepositoryException("Failed to delete ignore", e); } } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao... |
@Test public void testExtendedAttributeIsNotSet() throws Exception { assertThat(ExtendedAttribute.isExtendedAttributeSet(tempFile, TEST_NAME), is(false)); } | public static boolean isExtendedAttributeSet(Path path, String name) throws IOException { return createUserDefinedFileAttributeView(path).list().contains(name); } | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean isExtendedAttributeSet(Path path, String name) throws IOException { return createUserDefinedFileAttributeView(path).list().contains(name); } } | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean isExtendedAttributeSet(Path path, String name) throws IOException { return createUserDefinedFileAttributeView(path).list().contains(name); } } | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean isExtendedAttributeSet(Path path, String name) throws IOException { return createUserDefinedFileAttributeView(path).list().contains(name); } static String createName(String... names); static boolean supportsExtendedAttributes(Path path); stati... | ExtendedAttribute implements ExtendedAttributeQuery { public static boolean isExtendedAttributeSet(Path path, String name) throws IOException { return createUserDefinedFileAttributeView(path).list().contains(name); } static String createName(String... names); static boolean supportsExtendedAttributes(Path path); stati... |
@Test public void testFindByPathPath() throws Exception { assertThat(cut.findByPath(toPath(PATH_A)), is(existingIgnore)); } | @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemo... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemo... |
@Test public void testFindByPathPathNotFound() throws Exception { assertThat(cut.findByPath(toPath(PATH_B)), is(nullValue())); } | @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemo... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemo... |
@Test public void testFindByPathString() throws Exception { assertThat(cut.findByPath(PATH_A), is(existingIgnore)); } | @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemo... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public IgnoreRecord findByPath(Path path) throws RepositoryException { return findByPath(path.toString()); } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemo... |
@Test public void testFindByPathStringNotFound() throws Exception { assertThat(cut.isPathIgnored(PATH_B), is(false)); } | @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemove)... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemove)... |
@Test public void testIsPathIgnoredString() throws Exception { assertThat(cut.isPathIgnored(PATH_A), is(true)); } | @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemove)... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemove)... |
@Test public void testIsPathIgnoredStringNope() throws Exception { assertThat(cut.isPathIgnored(PATH_B), is(false)); } | @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemove)... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemove)... |
@Test public void testIsPathIgnoredPath() throws Exception { assertThat(cut.isPathIgnored(toPath(PATH_A)), is(true)); } | @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemove)... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public boolean isPathIgnored(String path) throws RepositoryException { return findByPath(path) != null; } OrmliteIgnoreRepository(Dao<IgnoreRecord, String> ignoreDao); @Override void store(IgnoreRecord toStore); @Override void remove(IgnoreRecord toRemove)... |
@Test public void testGetAll() throws Exception { dao.create(newIgnore); assertThat(cut.getAll(), containsInAnyOrder(newIgnore, existingIgnore)); } | @Override public List<IgnoreRecord> getAll() throws RepositoryException { try { return ignoreDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all ingored images: " + e.toString(), e); } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public List<IgnoreRecord> getAll() throws RepositoryException { try { return ignoreDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all ingored images: " + e.toString(), e); } } } | OrmliteIgnoreRepository implements IgnoreRepository { @Override public List<IgnoreRecord> getAll() throws RepositoryException { try { return ignoreDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all ingored images: " + e.toString(), e); } } OrmliteIgnoreRepository(Dao<Ig... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public List<IgnoreRecord> getAll() throws RepositoryException { try { return ignoreDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all ingored images: " + e.toString(), e); } } OrmliteIgnoreRepository(Dao<Ig... | OrmliteIgnoreRepository implements IgnoreRepository { @Override public List<IgnoreRecord> getAll() throws RepositoryException { try { return ignoreDao.queryForAll(); } catch (SQLException e) { throw new RepositoryException("Failed to query for all ingored images: " + e.toString(), e); } } OrmliteIgnoreRepository(Dao<Ig... |
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(Tag.class).withIgnoredFields("userTagId") .suppress(Warning.NONFINAL_FIELDS).verify();; } | @Override public final boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Tag)) { return false; } Tag other = (Tag) obj; if (contextMenu != other.contextMenu) { return false; } if (tag == null) { if (other.tag != null) { return false; } } else if (!tag... | Tag { @Override public final boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Tag)) { return false; } Tag other = (Tag) obj; if (contextMenu != other.contextMenu) { return false; } if (tag == null) { if (other.tag != null) { return false; } } else if... | Tag { @Override public final boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Tag)) { return false; } Tag other = (Tag) obj; if (contextMenu != other.contextMenu) { return false; } if (tag == null) { if (other.tag != null) { return false; } } else if... | Tag { @Override public final boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Tag)) { return false; } Tag other = (Tag) obj; if (contextMenu != other.contextMenu) { return false; } if (tag == null) { if (other.tag != null) { return false; } } else if... | Tag { @Override public final boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Tag)) { return false; } Tag other = (Tag) obj; if (contextMenu != other.contextMenu) { return false; } if (tag == null) { if (other.tag != null) { return false; } } else if... |
@Test public void testTagStringName() throws Exception { assertThat(cut.getTag(), is(TEST_TAG)); } | public final String getTag() { return tag; } | Tag { public final String getTag() { return tag; } } | Tag { public final String getTag() { return tag; } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); } | Tag { public final String getTag() { return tag; } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); final String getTag(); final void setTag(String tag); final boolean isContextMenu(); boolean isMatchAll(); final void setContextMenu(boolean contextMenu); @Override String toString(); @Overrid... | Tag { public final String getTag() { return tag; } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); final String getTag(); final void setTag(String tag); final boolean isContextMenu(); boolean isMatchAll(); final void setContextMenu(boolean contextMenu); @Override String toString(); @Overrid... |
@Test public void testCreateName() throws Exception { assertThat(ExtendedAttribute.createName("foo", "bar"), is(ExtendedAttribute.SIMILARIMAGE_NAMESPACE + ".foo.bar")); } | public static String createName(String... names) { StringBuilder sb = new StringBuilder(SIMILARIMAGE_NAMESPACE); for (String name : names) { sb.append("."); sb.append(name); } return sb.toString(); } | ExtendedAttribute implements ExtendedAttributeQuery { public static String createName(String... names) { StringBuilder sb = new StringBuilder(SIMILARIMAGE_NAMESPACE); for (String name : names) { sb.append("."); sb.append(name); } return sb.toString(); } } | ExtendedAttribute implements ExtendedAttributeQuery { public static String createName(String... names) { StringBuilder sb = new StringBuilder(SIMILARIMAGE_NAMESPACE); for (String name : names) { sb.append("."); sb.append(name); } return sb.toString(); } } | ExtendedAttribute implements ExtendedAttributeQuery { public static String createName(String... names) { StringBuilder sb = new StringBuilder(SIMILARIMAGE_NAMESPACE); for (String name : names) { sb.append("."); sb.append(name); } return sb.toString(); } static String createName(String... names); static boolean support... | ExtendedAttribute implements ExtendedAttributeQuery { public static String createName(String... names) { StringBuilder sb = new StringBuilder(SIMILARIMAGE_NAMESPACE); for (String name : names) { sb.append("."); sb.append(name); } return sb.toString(); } static String createName(String... names); static boolean support... |
@Test public void testTagStringContextMenu() throws Exception { assertThat(cut.isContextMenu(), is(false)); } | public final boolean isContextMenu() { return contextMenu; } | Tag { public final boolean isContextMenu() { return contextMenu; } } | Tag { public final boolean isContextMenu() { return contextMenu; } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); } | Tag { public final boolean isContextMenu() { return contextMenu; } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); final String getTag(); final void setTag(String tag); final boolean isContextMenu(); boolean isMatchAll(); final void setContextMenu(boolean contextMenu); @Override String toSt... | Tag { public final boolean isContextMenu() { return contextMenu; } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); final String getTag(); final void setTag(String tag); final boolean isContextMenu(); boolean isMatchAll(); final void setContextMenu(boolean contextMenu); @Override String toSt... |
@Test public void testIsMatchAll() throws Exception { assertThat(cut.isMatchAll(), is(false)); } | public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } | Tag { public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } } | Tag { public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); } | Tag { public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); final String getTag(); final void setTag(String tag); final boolean isContextMenu(); boolean isMatchAll(); final void setContextMenu(boolean contextMenu); @Ove... | Tag { public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); final String getTag(); final void setTag(String tag); final boolean isContextMenu(); boolean isMatchAll(); final void setContextMenu(boolean contextMenu); @Ove... |
@Test public void testIsMatchAllAsterisk() throws Exception { cut = new Tag(StringUtil.MATCH_ALL_TAGS); assertThat(cut.isMatchAll(), is(true)); } | public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } | Tag { public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } } | Tag { public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); } | Tag { public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); final String getTag(); final void setTag(String tag); final boolean isContextMenu(); boolean isMatchAll(); final void setContextMenu(boolean contextMenu); @Ove... | Tag { public boolean isMatchAll() { return StringUtil.MATCH_ALL_TAGS.equals(tag); } @Deprecated Tag(); Tag(String tag); Tag(String tag, boolean contextMenu); final String getTag(); final void setTag(String tag); final boolean isContextMenu(); boolean isMatchAll(); final void setContextMenu(boolean contextMenu); @Ove... |
@Test public void testGetCs() throws Exception { assertThat(cut.getCs().isOpen(EMPTY_STRING), is(true)); } | @Override public ConnectionSource getCs() { return connectionSource; } | SQLiteDatabase implements Database { @Override public ConnectionSource getCs() { return connectionSource; } } | SQLiteDatabase implements Database { @Override public ConnectionSource getCs() { return connectionSource; } SQLiteDatabase(); SQLiteDatabase(Path dbPath); SQLiteDatabase(String dbPath); } | SQLiteDatabase implements Database { @Override public ConnectionSource getCs() { return connectionSource; } SQLiteDatabase(); SQLiteDatabase(Path dbPath); SQLiteDatabase(String dbPath); @Override ConnectionSource getCs(); @Override void close(); } | SQLiteDatabase implements Database { @Override public ConnectionSource getCs() { return connectionSource; } SQLiteDatabase(); SQLiteDatabase(Path dbPath); SQLiteDatabase(String dbPath); @Override ConnectionSource getCs(); @Override void close(); } |
@Ignore("Closing a closed connection when using pooled connections results in NPE") @Test public void testClose() throws Exception { ConnectionSource cs = cut.getCs(); assertThat(cs.isOpen(EMPTY_STRING), is(true)); cut.close(); assertThat(cs.isOpen(EMPTY_STRING), is(false)); } | @Override public void close() { connectionSource.closeQuietly(); } | SQLiteDatabase implements Database { @Override public void close() { connectionSource.closeQuietly(); } } | SQLiteDatabase implements Database { @Override public void close() { connectionSource.closeQuietly(); } SQLiteDatabase(); SQLiteDatabase(Path dbPath); SQLiteDatabase(String dbPath); } | SQLiteDatabase implements Database { @Override public void close() { connectionSource.closeQuietly(); } SQLiteDatabase(); SQLiteDatabase(Path dbPath); SQLiteDatabase(String dbPath); @Override ConnectionSource getCs(); @Override void close(); } | SQLiteDatabase implements Database { @Override public void close() { connectionSource.closeQuietly(); } SQLiteDatabase(); SQLiteDatabase(Path dbPath); SQLiteDatabase(String dbPath); @Override ConnectionSource getCs(); @Override void close(); } |
@Test public void testGetpHash() throws Exception { assertThat(filterRecord.getpHash(), is(HASH_ONE)); } | public long getpHash() { return pHash; } | FilterRecord { public long getpHash() { return pHash; } } | FilterRecord { public long getpHash() { return pHash; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); } | FilterRecord { public long getpHash() { return pHash; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); long getpHash(); void setpHash(long pHash); Tag getTag(); void setTag(Tag tag); Thumbnail getThumbnail(); final void setThumbnail(Thumbnail thu... | FilterRecord { public long getpHash() { return pHash; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); long getpHash(); void setpHash(long pHash); Tag getTag(); void setTag(Tag tag); Thumbnail getThumbnail(); final void setThumbnail(Thumbnail thu... |
@Test public void testSetpHash() throws Exception { assertThat(GUARD_MSG, filterRecord.getpHash(), is(HASH_ONE)); filterRecord.setpHash(HASH_TWO); assertThat(filterRecord.getpHash(), is(HASH_TWO)); } | public void setpHash(long pHash) { this.pHash = pHash; } | FilterRecord { public void setpHash(long pHash) { this.pHash = pHash; } } | FilterRecord { public void setpHash(long pHash) { this.pHash = pHash; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); } | FilterRecord { public void setpHash(long pHash) { this.pHash = pHash; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); long getpHash(); void setpHash(long pHash); Tag getTag(); void setTag(Tag tag); Thumbnail getThumbnail(); final void setThumbna... | FilterRecord { public void setpHash(long pHash) { this.pHash = pHash; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); long getpHash(); void setpHash(long pHash); Tag getTag(); void setTag(Tag tag); Thumbnail getThumbnail(); final void setThumbna... |
@Test public void testGetReason() throws Exception { assertThat(filterRecord.getTag(), is(TEST_TAG_ONE)); } | public Tag getTag() { return tag; } | FilterRecord { public Tag getTag() { return tag; } } | FilterRecord { public Tag getTag() { return tag; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); } | FilterRecord { public Tag getTag() { return tag; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); long getpHash(); void setpHash(long pHash); Tag getTag(); void setTag(Tag tag); Thumbnail getThumbnail(); final void setThumbnail(Thumbnail thumbnai... | FilterRecord { public Tag getTag() { return tag; } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, Thumbnail thumbnail); long getpHash(); void setpHash(long pHash); Tag getTag(); void setTag(Tag tag); Thumbnail getThumbnail(); final void setThumbnail(Thumbnail thumbnai... |
@Test public void testEqualsIsEqual() throws Exception { FilterRecord other = new FilterRecord(HASH_ONE, TEST_TAG_ONE, null); assertThat(filterRecord.equals(other), is(true)); } | @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return false; } } else i... | FilterRecord { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return fa... | FilterRecord { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return fa... | FilterRecord { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return fa... | FilterRecord { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return fa... |
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(FilterRecord.class).withIgnoredFields("id").suppress(Warning.NONFINAL_FIELDS).verify(); } | @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return false; } } else i... | FilterRecord { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return fa... | FilterRecord { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return fa... | FilterRecord { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return fa... | FilterRecord { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FilterRecord other = (FilterRecord) obj; if (pHash != other.pHash) { return false; } if (tag == null) { if (other.tag != null) { return fa... |
@Test public void testIsEaSupportedUseCache() throws Exception { assertThat(cut.isEaSupported(subDirectory), is(true)); when(eaQuery.isEaSupported(any(Path.class))).thenReturn(false); assertThat(cut.isEaSupported(subDirectory), is(true)); } | @Override public boolean isEaSupported(Path path) { Path parent = path.getParent(); if (path.getRoot() != null && path.equals(path.getRoot())) { parent = path; } if (parent == null) { return false; } return eaSupport.getUnchecked(parent); } | ExtendedAttributeDirectoryCache implements ExtendedAttributeQuery { @Override public boolean isEaSupported(Path path) { Path parent = path.getParent(); if (path.getRoot() != null && path.equals(path.getRoot())) { parent = path; } if (parent == null) { return false; } return eaSupport.getUnchecked(parent); } } | ExtendedAttributeDirectoryCache implements ExtendedAttributeQuery { @Override public boolean isEaSupported(Path path) { Path parent = path.getParent(); if (path.getRoot() != null && path.equals(path.getRoot())) { parent = path; } if (parent == null) { return false; } return eaSupport.getUnchecked(parent); } @Inject Ex... | ExtendedAttributeDirectoryCache implements ExtendedAttributeQuery { @Override public boolean isEaSupported(Path path) { Path parent = path.getParent(); if (path.getRoot() != null && path.equals(path.getRoot())) { parent = path; } if (parent == null) { return false; } return eaSupport.getUnchecked(parent); } @Inject Ex... | ExtendedAttributeDirectoryCache implements ExtendedAttributeQuery { @Override public boolean isEaSupported(Path path) { Path parent = path.getParent(); if (path.getRoot() != null && path.equals(path.getRoot())) { parent = path; } if (parent == null) { return false; } return eaSupport.getUnchecked(parent); } @Inject Ex... |
@Test public void testGetTags() throws Exception { FilterRecord.getTags(filterRepository, TEST_TAG_ONE); verify(filterRepository).getByTag(TEST_TAG_ONE); } | public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } | FilterRecord { public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } } | FilterRecord { public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, ... | FilterRecord { public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, ... | FilterRecord { public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, ... |
@Test public void testGetTagsAllTags() throws Exception { FilterRecord.getTags(filterRepository, new Tag(StringUtil.MATCH_ALL_TAGS)); verify(filterRepository).getAll(); } | public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } | FilterRecord { public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } } | FilterRecord { public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, ... | FilterRecord { public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, ... | FilterRecord { public static List<FilterRecord> getTags(FilterRepository repository, Tag tag) throws RepositoryException { if (tag.isMatchAll()) { return repository.getAll(); } else { return repository.getByTag(tag); } } @Deprecated FilterRecord(); FilterRecord(long hash, Tag tag); FilterRecord(long pHash, Tag tag, ... |
@Test public void testGetPathAsString() throws Exception { assertThat(cut.getImage(), is(IMAGE)); } | public ImageRecord getImage() { return image; } | IgnoreRecord { public ImageRecord getImage() { return image; } } | IgnoreRecord { public ImageRecord getImage() { return image; } @Deprecated IgnoreRecord(); IgnoreRecord(ImageRecord image); } | IgnoreRecord { public ImageRecord getImage() { return image; } @Deprecated IgnoreRecord(); IgnoreRecord(ImageRecord image); ImageRecord getImage(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); } | IgnoreRecord { public ImageRecord getImage() { return image; } @Deprecated IgnoreRecord(); IgnoreRecord(ImageRecord image); ImageRecord getImage(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static final String IMAGEPATH_FIELD_NAME; } |
@Test public void testEquals() throws Exception { assertThat(cut.equals(new IgnoreRecord(IMAGE)), is(true)); } | @Override public boolean equals(Object obj) { if (obj instanceof IgnoreRecord) { IgnoreRecord other = (IgnoreRecord) obj; return Objects.equals(this.image, other.image); } return false; } | IgnoreRecord { @Override public boolean equals(Object obj) { if (obj instanceof IgnoreRecord) { IgnoreRecord other = (IgnoreRecord) obj; return Objects.equals(this.image, other.image); } return false; } } | IgnoreRecord { @Override public boolean equals(Object obj) { if (obj instanceof IgnoreRecord) { IgnoreRecord other = (IgnoreRecord) obj; return Objects.equals(this.image, other.image); } return false; } @Deprecated IgnoreRecord(); IgnoreRecord(ImageRecord image); } | IgnoreRecord { @Override public boolean equals(Object obj) { if (obj instanceof IgnoreRecord) { IgnoreRecord other = (IgnoreRecord) obj; return Objects.equals(this.image, other.image); } return false; } @Deprecated IgnoreRecord(); IgnoreRecord(ImageRecord image); ImageRecord getImage(); @Override boolean equals(Objec... | IgnoreRecord { @Override public boolean equals(Object obj) { if (obj instanceof IgnoreRecord) { IgnoreRecord other = (IgnoreRecord) obj; return Objects.equals(this.image, other.image); } return false; } @Deprecated IgnoreRecord(); IgnoreRecord(ImageRecord image); ImageRecord getImage(); @Override boolean equals(Objec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.