test_class.file: server-core/src/test/java/io/onedev/server/search/commit/CommitQueryTest.java
test_class.identifier: CommitQueryTest
test_class.superclass: extends AbstractGitTest
test_case.body: @Test
  	public void testMatches() throws Exception {
  		addFileAndCommit("initial", "", "initial");
  		git.checkout().setCreateBranch(true).setName("dev").call();
  		addFileAndCommit("dev/file1", "", "dev1");
  		addFileAndCommit("dev/file2", "", "dev2");
  		git.checkout().setName("master").call();
  		
  		CommitQueryTest.this.user = new PersonIdent("bar", "bar@example.com");
  		
  		addFileAndCommit("master/file1", "", "master1");
  		addFileAndCommit("master/file2", "", "master2");
  		
  		Project project = new Project() {
  
  			private static final long serialVersionUID = 1L;
  
  			@Override
  			public Repository getRepository() {
  				return git.getRepository();
  			}
  
  		};
  		ObjectId newCommitId = git.getRepository().resolve("master");
  		ObjectId oldCommitId = git.getRepository().resolve("master~1");
  		RefUpdated event = new RefUpdated(project, "refs/heads/master", oldCommitId, newCommitId);
  		
  		User user = new User();
  		user.setEmail(CommitQueryTest.this.user.getEmailAddress());
  		User.push(user);
  		try {
  			assertTrue(CommitQuery.parse(project, null).matches(event));
  			assertFalse(CommitQuery.parse(project, "branch(dev)").matches(event));
  			assertTrue(CommitQuery.parse(project, "default-branch").matches(event));
  			assertTrue(CommitQuery.parse(project, "branch(master) path(master/*)").matches(event));
  			assertFalse(CommitQuery.parse(project, "path(master/file)").matches(event));
  			assertTrue(CommitQuery.parse(project, "path(master/)").matches(event));
  			assertTrue(CommitQuery.parse(project, "path(master/file) path(master/file*)").matches(event));
  			assertTrue(CommitQuery.parse(project, "message(dev) message(master)").matches(event));
  			assertTrue(CommitQuery.parse(project, "message(dev) message(m*s)").matches(event));
  			assertTrue(CommitQuery.parse(project, "authored-by-me author(foo@example.com)").matches(event));
  			assertFalse(CommitQuery.parse(project, "authored-by-me committer(foo@example.com)").matches(event));
  			assertTrue(CommitQuery.parse(project, "authored-by-me committer(bar@example.com)").matches(event));
  			assertTrue(CommitQuery.parse(project, "after(2 days ago) after(1 hour ago)").matches(event));
  			assertFalse(CommitQuery.parse(project, "before(1 hour ago) after(1 day ago)").matches(event));
  		} finally {
  			User.pop();
  		}
  	}
test_case.class_method_signature: CommitQueryTest.testMatches()
test_case.full_signature: @Test public void testMatches()
test_case.identifier: testMatches
test_case.invocations: addFileAndCommit call setName setCreateBranch checkout addFileAndCommit addFileAndCommit call setName checkout addFileAndCommit addFileAndCommit getRepository resolve getRepository resolve getRepository setEmail getEmailAddress push assertTrue matches parse assertFalse matches parse assertTrue matches parse assertTrue matches parse assertFalse matches parse assertTrue matches parse assertTrue matches parse assertTrue matches parse assertTrue matches parse assertTrue matches parse assertFalse matches parse assertTrue matches parse assertTrue matches parse assertFalse matches parse pop
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMatches()
focal_class.declarator: serialVersionUID = 1L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 1L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: criterias
focal_class.modifier: private final
focal_class.original_string: private final List<CommitCriteria> criterias;
focal_class.type: List<CommitCriteria>
focal_class.var_name: criterias
focal_class.file: server-core/src/main/java/io/onedev/server/search/commit/CommitQuery.java
focal_class.identifier: CommitQuery
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: CommitQuery.CommitQuery(List<CommitCriteria> criterias)
focal_class.full_signature: public  CommitQuery(List<CommitCriteria> criterias)
focal_class.identifier: CommitQuery
focal_class.modifiers: public
focal_class.parameters: (List<CommitCriteria> criterias)
focal_class.signature:  CommitQuery(List<CommitCriteria> criterias)
focal_class.class_method_signature: CommitQuery.parse(Project project, @Nullable String queryString)
focal_class.full_signature: public static CommitQuery parse(Project project, @Nullable String queryString)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (Project project, @Nullable String queryString)
focal_class.return: CommitQuery
focal_class.signature: CommitQuery parse(Project project, @Nullable String queryString)
focal_class.class_method_signature: CommitQuery.getValue(TerminalNode valueNode)
focal_class.full_signature: private static String getValue(TerminalNode valueNode)
focal_class.identifier: getValue
focal_class.modifiers: private static
focal_class.parameters: (TerminalNode valueNode)
focal_class.return: String
focal_class.signature: String getValue(TerminalNode valueNode)
focal_class.class_method_signature: CommitQuery.matches(RefUpdated event)
focal_class.full_signature: public boolean matches(RefUpdated event)
focal_class.identifier: matches
focal_class.modifiers: public
focal_class.parameters: (RefUpdated event)
focal_class.return: boolean
focal_class.signature: boolean matches(RefUpdated event)
focal_class.class_method_signature: CommitQuery.fill(Project project, RevListCommand command)
focal_class.full_signature: public void fill(Project project, RevListCommand command)
focal_class.identifier: fill
focal_class.modifiers: public
focal_class.parameters: (Project project, RevListCommand command)
focal_class.return: void
focal_class.signature: void fill(Project project, RevListCommand command)
focal_class.class_method_signature: CommitQuery.getCriterias()
focal_class.full_signature: public List<CommitCriteria> getCriterias()
focal_class.identifier: getCriterias
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<CommitCriteria>
focal_class.signature: List<CommitCriteria> getCriterias()
focal_class.class_method_signature: CommitQuery.merge(CommitQuery query1, CommitQuery query2)
focal_class.full_signature: public static CommitQuery merge(CommitQuery query1, CommitQuery query2)
focal_class.identifier: merge
focal_class.modifiers: public static
focal_class.parameters: (CommitQuery query1, CommitQuery query2)
focal_class.return: CommitQuery
focal_class.signature: CommitQuery merge(CommitQuery query1, CommitQuery query2)
focal_class.class_method_signature: CommitQuery.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public boolean matches(RefUpdated event) {
  		if (!event.getNewCommitId().equals(ObjectId.zeroId())) 
  			return criterias.stream().allMatch(it->it.matches(event));
  		else 
  			return false;
  	}
focal_method.class_method_signature: CommitQuery.matches(RefUpdated event)
focal_method.full_signature: public boolean matches(RefUpdated event)
focal_method.identifier: matches
focal_method.invocations: equals getNewCommitId zeroId allMatch stream matches
focal_method.modifiers: public
focal_method.parameters: (RefUpdated event)
focal_method.return: boolean
focal_method.signature: boolean matches(RefUpdated event)