repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
rla/while | language/src/com/infdot/analysis/language/expression/visitor/ExpressionNumberingVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Expression;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expres... | package com.infdot.analysis.language.expression.visitor;
/**
* Expression visitor that gives each expression an unique identifier.
* Identifiers start from 0.
*
* @author Raivo Laanemets
*/
public class ExpressionNumberingVisitor extends AbstractExpressionVisitor<Void> {
private int expressionId = 0;
@Overr... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | public Void visitDiv(Div div, Void e1, Void e2) { |
rla/while | language/src/com/infdot/analysis/language/expression/visitor/ExpressionNumberingVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Expression;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expres... | package com.infdot.analysis.language.expression.visitor;
/**
* Expression visitor that gives each expression an unique identifier.
* Identifiers start from 0.
*
* @author Raivo Laanemets
*/
public class ExpressionNumberingVisitor extends AbstractExpressionVisitor<Void> {
private int expressionId = 0;
@Overr... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | public Void visitGt(Gt gt, Void e1, Void e2) { |
rla/while | language/src/com/infdot/analysis/language/expression/visitor/ExpressionNumberingVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Expression;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expres... | package com.infdot.analysis.language.expression.visitor;
/**
* Expression visitor that gives each expression an unique identifier.
* Identifiers start from 0.
*
* @author Raivo Laanemets
*/
public class ExpressionNumberingVisitor extends AbstractExpressionVisitor<Void> {
private int expressionId = 0;
@Overr... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | public Void visitIdentifier(Identifier identifier) { |
rla/while | language/src/com/infdot/analysis/language/expression/visitor/ExpressionNumberingVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Expression;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expres... | @Override
public Void visitDiv(Div div, Void e1, Void e2) {
setId(div);
return null;
}
@Override
public Void visitGt(Gt gt, Void e1, Void e2) {
setId(gt);
return null;
}
@Override
public Void visitIdentifier(Identifier identifier) {
setId(identifier);
return null;
}
@Override
public Void visit... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | private void setId(Expression e) { |
rla/while | src/com/infdot/analysis/solver/lattice/map/AllJoinOperation.java | // Path: src/com/infdot/analysis/solver/DataflowExpression.java
// public interface DataflowExpression<V> {
// /**
// * Evaluates expression using the given variable values.
// */
// V eval(V[] values);
//
// /**
// * Helper to collect all variables,
// */
// void collectVariables(Set<Integer> variables);... | import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.infdot.analysis.solver.DataflowExpression;
import com.infdot.analysis.solver.lattice.ElementJoinOperation;
import com.infdot.analysis.util.StringUtil; | package com.infdot.analysis.solver.lattice.map;
/**
* Join (least upper bound) for map lattices.
*
* @author Raivo Laanemets
*
* @param <K> type of map key
* @param <V> type of map value
*/
public class AllJoinOperation<K, V> implements DataflowExpression<Map<K, V>> {
private List<DataflowExpression<Map<K, ... | // Path: src/com/infdot/analysis/solver/DataflowExpression.java
// public interface DataflowExpression<V> {
// /**
// * Evaluates expression using the given variable values.
// */
// V eval(V[] values);
//
// /**
// * Helper to collect all variables,
// */
// void collectVariables(Set<Integer> variables);... | private ElementJoinOperation<V> elementJoin; |
rla/while | src/com/infdot/analysis/solver/lattice/map/AllJoinOperation.java | // Path: src/com/infdot/analysis/solver/DataflowExpression.java
// public interface DataflowExpression<V> {
// /**
// * Evaluates expression using the given variable values.
// */
// V eval(V[] values);
//
// /**
// * Helper to collect all variables,
// */
// void collectVariables(Set<Integer> variables);... | import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.infdot.analysis.solver.DataflowExpression;
import com.infdot.analysis.solver.lattice.ElementJoinOperation;
import com.infdot.analysis.util.StringUtil; | Map<K, V> result = new HashMap<K, V>(expressions.get(0).eval(values));
for (DataflowExpression<Map<K, V>> e : expressions.subList(1, expressions.size())) {
joinInto(result, e.eval(values));
}
return result;
}
private void joinInto(Map<K, V> result, Map<K, V> joinable) {
for (K k : result.keySet()... | // Path: src/com/infdot/analysis/solver/DataflowExpression.java
// public interface DataflowExpression<V> {
// /**
// * Evaluates expression using the given variable values.
// */
// V eval(V[] values);
//
// /**
// * Helper to collect all variables,
// */
// void collectVariables(Set<Integer> variables);... | return "ALLJOIN(" + StringUtil.join(expressions, ",") + ")"; |
rla/while | src/com/infdot/analysis/solver/lattice/map/ModifyWithEvalOperation.java | // Path: src/com/infdot/analysis/solver/DataflowExpression.java
// public interface DataflowExpression<V> {
// /**
// * Evaluates expression using the given variable values.
// */
// V eval(V[] values);
//
// /**
// * Helper to collect all variables,
// */
// void collectVariables(Set<Integer> variables);... | import java.util.Map;
import java.util.Set;
import com.infdot.analysis.solver.DataflowExpression;
import com.infdot.analysis.util.Transform; | package com.infdot.analysis.solver.lattice.map;
/**
* Implements map modification where value depends
* on dataflow variable values.
*
* @author Raivo Laanemets
*/
public class ModifyWithEvalOperation<K, V> implements DataflowExpression<Map<K, V>> {
private DataflowExpression<Map<K, V>> map;
private K key; | // Path: src/com/infdot/analysis/solver/DataflowExpression.java
// public interface DataflowExpression<V> {
// /**
// * Evaluates expression using the given variable values.
// */
// V eval(V[] values);
//
// /**
// * Helper to collect all variables,
// */
// void collectVariables(Set<Integer> variables);... | private Transform<Map<K, V>, V> exp; |
rla/while | src/com/infdot/analysis/cfg/node/AbstractNode.java | // Path: src/com/infdot/analysis/cfg/node/visitor/AbstractNodeVisitor.java
// public abstract class AbstractNodeVisitor<V> {
//
// private Map<AbstractNode, DataflowExpression<V>> visited =
// new HashMap<AbstractNode, DataflowExpression<V>>();
//
// private int currentVarId = 0;
// private Map<AbstractNode, I... | import java.util.HashSet;
import java.util.Set;
import com.infdot.analysis.cfg.node.visitor.AbstractNodeVisitor; | package com.infdot.analysis.cfg.node;
public abstract class AbstractNode {
private Set<AbstractNode> successors = new HashSet<AbstractNode>();
private Set<AbstractNode> predecessors = new HashSet<AbstractNode>();
/**
* Adds given successor to this node. This node will be
* automatically added to the given n... | // Path: src/com/infdot/analysis/cfg/node/visitor/AbstractNodeVisitor.java
// public abstract class AbstractNodeVisitor<V> {
//
// private Map<AbstractNode, DataflowExpression<V>> visited =
// new HashMap<AbstractNode, DataflowExpression<V>>();
//
// private int currentVarId = 0;
// private Map<AbstractNode, I... | public <V> void visitNodes(AbstractNodeVisitor<V> visitor) { |
rla/while | language/src/com/infdot/analysis/language/expression/Sub.java | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | import com.infdot.analysis.language.expression.visitor.AbstractExpressionVisitor; | package com.infdot.analysis.language.expression;
public class Sub extends AbstractBinaryOperator {
public Sub(String name, int value) {
super("-", name, value);
}
public Sub(String name1, String name2) {
super("-", name1, name2);
}
public Sub(Expression e1, Expression e2) {
super("-", e1, e2);
}
... | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | protected <V> V visitOperator(AbstractExpressionVisitor<V> visitor, V e1, V e2) { |
rla/while | src/com/infdot/analysis/solver/DataflowVariable.java | // Path: src/com/infdot/analysis/cfg/node/AbstractNode.java
// public abstract class AbstractNode {
// private Set<AbstractNode> successors = new HashSet<AbstractNode>();
// private Set<AbstractNode> predecessors = new HashSet<AbstractNode>();
//
// /**
// * Adds given successor to this node. This node will be
/... | import java.util.Set;
import com.infdot.analysis.cfg.node.AbstractNode; | package com.infdot.analysis.solver;
/**
* Dataflow variable. Assumes that each variable can have
* unique integer identificator defined by specific analysis.
*
* @author Raivo Laanemets
*/
public class DataflowVariable<V>
implements DataflowExpression<V> {
private int id; | // Path: src/com/infdot/analysis/cfg/node/AbstractNode.java
// public abstract class AbstractNode {
// private Set<AbstractNode> successors = new HashSet<AbstractNode>();
// private Set<AbstractNode> predecessors = new HashSet<AbstractNode>();
//
// /**
// * Adds given successor to this node. This node will be
/... | private AbstractNode node; |
rla/while | language/src/com/infdot/analysis/language/expression/Identifier.java | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | import java.util.Set;
import com.infdot.analysis.language.expression.visitor.AbstractExpressionVisitor; | package com.infdot.analysis.language.expression;
public class Identifier extends Expression {
private String name;
public Identifier(String name) {
this.name = name;
}
@Override
public String toString() {
return name;
}
@Override
public void collectVariables(Set<Identifier> variables) {
variables.ad... | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | public <V> V visit(AbstractExpressionVisitor<V> visitor) { |
rla/while | language/src/com/infdot/analysis/language/expression/AbstractBinaryOperator.java | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | import java.util.Set;
import com.infdot.analysis.language.expression.visitor.AbstractExpressionVisitor; | this.e1 = e1;
this.e2 = e2;
}
public AbstractBinaryOperator(String op, String name1, String name2) {
this.op = op;
this.e1 = new Identifier(name1);
this.e2 = new Identifier(name2);
}
public final Expression getE1() {
return e1;
}
public final Expression getE2() {
return e2;
}
@Override
publi... | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | public final <V> V visit(AbstractExpressionVisitor<V> visitor) { |
rla/while | src/com/infdot/analysis/solver/DataflowConstraintSet.java | // Path: src/com/infdot/analysis/solver/lattice/Domain.java
// public interface Domain<V> {
// public V bottom();
//
// /**
// * Factory method to create analysis state of given size.
// */
// public V[] createStartState(int size);
// }
| import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import com.infdot.analysis.solver.lattice.Domain; | package com.infdot.analysis.solver;
/**
* Helper class to keep set of all dataflow constraints
* of some specific analysis.
*
* @author Raivo Laanemets
*
* @param <V> type of dataflow values.
* @param <M> type of metainfo associated with dataflow variables.
*/
public class DataflowConstraintSet<V, M> {
pr... | // Path: src/com/infdot/analysis/solver/lattice/Domain.java
// public interface Domain<V> {
// public V bottom();
//
// /**
// * Factory method to create analysis state of given size.
// */
// public V[] createStartState(int size);
// }
// Path: src/com/infdot/analysis/solver/DataflowConstraintSet.java
impor... | public V[] createStartState(Domain<V> domain) { |
rla/while | src/com/infdot/analysis/solver/lattice/powerset/PowersetDomain.java | // Path: src/com/infdot/analysis/solver/DataflowExpression.java
// public interface DataflowExpression<V> {
// /**
// * Evaluates expression using the given variable values.
// */
// V eval(V[] values);
//
// /**
// * Helper to collect all variables,
// */
// void collectVariables(Set<Integer> variables);... | import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.infdot.analysis.solver.DataflowExpression;
import com.infdot.analysis.solver.lattice.Domain; | package com.infdot.analysis.solver.lattice.powerset;
/**
* Standard powerset domain with empty set as bottom
* and set union as join operator.
*
* @author Raivo Laanemets
*
* @param <T> type of set values.
*/
public class PowersetDomain<T> implements Domain<Set<T>> {
@Override
public Set<T> bottom() {
r... | // Path: src/com/infdot/analysis/solver/DataflowExpression.java
// public interface DataflowExpression<V> {
// /**
// * Evaluates expression using the given variable values.
// */
// V eval(V[] values);
//
// /**
// * Helper to collect all variables,
// */
// void collectVariables(Set<Integer> variables);... | public static <V> DataflowExpression<Set<V>> set(Collection<V> set) { |
rla/while | language/src/com/infdot/analysis/language/expression/Constant.java | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | import java.util.Set;
import com.infdot.analysis.language.expression.visitor.AbstractExpressionVisitor; | package com.infdot.analysis.language.expression;
public class Constant extends Expression {
private int value;
public Constant(int value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@Override
public void collectVariables(Set<Identifier> variables) {}
... | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | public <V> V visit(AbstractExpressionVisitor<V> visitor) { |
rla/while | language/src/com/infdot/analysis/language/statement/Compound.java | // Path: language/src/com/infdot/analysis/language/statement/visitor/AbstractStatementVisitor.java
// public abstract class AbstractStatementVisitor<T> {
//
// public abstract T visitAssignment(Assignment assignment);
//
// public abstract T visitCompound(Compound compound, T s1, T s2);
//
// public abstract T ... | import com.infdot.analysis.language.statement.visitor.AbstractStatementVisitor; | public static Statement makeCompound(Statement... statements) {
Statement ret = statements[0];
for (int i = 1; i < statements.length; i++) {
ret = new Compound(ret, statements[i]);
}
return ret;
}
@Override
public boolean equals(Object obj) {
return obj instanceof Compound
&& ((Compound) obj).st... | // Path: language/src/com/infdot/analysis/language/statement/visitor/AbstractStatementVisitor.java
// public abstract class AbstractStatementVisitor<T> {
//
// public abstract T visitAssignment(Assignment assignment);
//
// public abstract T visitCompound(Compound compound, T s1, T s2);
//
// public abstract T ... | public <T> T visit(AbstractStatementVisitor<T> visitor) { |
rla/while | language/src/com/infdot/analysis/language/statement/If.java | // Path: language/src/com/infdot/analysis/language/expression/Expression.java
// public abstract class Expression {
// /**
// * Unique identifier for each expression.
// * @see {@link ExpressionNumberingVisitor}
// */
// private int id = -1;
//
// public int getId() {
// return id;
// }
//
// public voi... | import com.infdot.analysis.language.expression.Expression;
import com.infdot.analysis.language.statement.visitor.AbstractStatementVisitor; | }
@Override
public void toCodeString(StringBuilder builder, String ident) {
builder.append(ident).append("if (").append(condition).append(") {\n");
statement.toCodeString(builder, ident + " ");
builder.append('\n').append(ident).append("}");
}
@Override
public boolean equals(Object obj) {
return obj in... | // Path: language/src/com/infdot/analysis/language/expression/Expression.java
// public abstract class Expression {
// /**
// * Unique identifier for each expression.
// * @see {@link ExpressionNumberingVisitor}
// */
// private int id = -1;
//
// public int getId() {
// return id;
// }
//
// public voi... | public <T> T visit(AbstractStatementVisitor<T> visitor) { |
rla/while | language/src/com/infdot/analysis/language/statement/Statement.java | // Path: language/src/com/infdot/analysis/language/statement/visitor/AbstractStatementVisitor.java
// public abstract class AbstractStatementVisitor<T> {
//
// public abstract T visitAssignment(Assignment assignment);
//
// public abstract T visitCompound(Compound compound, T s1, T s2);
//
// public abstract T ... | import com.infdot.analysis.language.statement.visitor.AbstractStatementVisitor; | package com.infdot.analysis.language.statement;
public interface Statement {
/**
* Method to build string representation of code.
*/
void toCodeString(StringBuilder builder, String ident);
/**
* Method for accepting statement visitor.
*/ | // Path: language/src/com/infdot/analysis/language/statement/visitor/AbstractStatementVisitor.java
// public abstract class AbstractStatementVisitor<T> {
//
// public abstract T visitAssignment(Assignment assignment);
//
// public abstract T visitCompound(Compound compound, T s1, T s2);
//
// public abstract T ... | <T> T visit(AbstractStatementVisitor<T> visitor); |
rla/while | language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expression.Input;
import com.infdot.analysis.language.expression.... | package com.infdot.analysis.language.expression.visitor;
/**
* Base class for expression visitors. Assumes that there are no loops
* in expression (trees). Has no cycle detection.
*
* @author Raivo Laanemets
*/
public abstract class AbstractExpressionVisitor<V> {
public abstract V visitConstant(Constant cons... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | public abstract V visitDiv(Div div, V e1, V e2); |
rla/while | language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expression.Input;
import com.infdot.analysis.language.expression.... | package com.infdot.analysis.language.expression.visitor;
/**
* Base class for expression visitors. Assumes that there are no loops
* in expression (trees). Has no cycle detection.
*
* @author Raivo Laanemets
*/
public abstract class AbstractExpressionVisitor<V> {
public abstract V visitConstant(Constant cons... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | public abstract V visitGt(Gt gt, V e1, V e2); |
rla/while | language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expression.Input;
import com.infdot.analysis.language.expression.... | package com.infdot.analysis.language.expression.visitor;
/**
* Base class for expression visitors. Assumes that there are no loops
* in expression (trees). Has no cycle detection.
*
* @author Raivo Laanemets
*/
public abstract class AbstractExpressionVisitor<V> {
public abstract V visitConstant(Constant cons... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | public abstract V visitIdentifier(Identifier identifier); |
rla/while | language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expression.Input;
import com.infdot.analysis.language.expression.... | package com.infdot.analysis.language.expression.visitor;
/**
* Base class for expression visitors. Assumes that there are no loops
* in expression (trees). Has no cycle detection.
*
* @author Raivo Laanemets
*/
public abstract class AbstractExpressionVisitor<V> {
public abstract V visitConstant(Constant cons... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | public abstract V visitInput(Input input); |
rla/while | language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | import com.infdot.analysis.language.expression.Constant;
import com.infdot.analysis.language.expression.Div;
import com.infdot.analysis.language.expression.Gt;
import com.infdot.analysis.language.expression.Identifier;
import com.infdot.analysis.language.expression.Input;
import com.infdot.analysis.language.expression.... | package com.infdot.analysis.language.expression.visitor;
/**
* Base class for expression visitors. Assumes that there are no loops
* in expression (trees). Has no cycle detection.
*
* @author Raivo Laanemets
*/
public abstract class AbstractExpressionVisitor<V> {
public abstract V visitConstant(Constant cons... | // Path: language/src/com/infdot/analysis/language/expression/Constant.java
// public class Constant extends Expression {
// private int value;
//
// public Constant(int value) {
// this.value = value;
// }
//
// @Override
// public String toString() {
// return String.valueOf(value);
// }
//
// @Override... | public abstract V visitSub(Sub sub, V e1, V e2); |
rla/while | language/src/com/infdot/analysis/language/expression/Gt.java | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | import com.infdot.analysis.language.expression.visitor.AbstractExpressionVisitor; | package com.infdot.analysis.language.expression;
public class Gt extends AbstractBinaryOperator {
public Gt(String name, int value) {
super(">", name, value);
}
public Gt(Expression e1, Expression e2) {
super(">", e1, e2);
}
@Override | // Path: language/src/com/infdot/analysis/language/expression/visitor/AbstractExpressionVisitor.java
// public abstract class AbstractExpressionVisitor<V> {
//
// public abstract V visitConstant(Constant constant);
//
// public abstract V visitDiv(Div div, V e1, V e2);
//
// public abstract V visitGt(Gt gt, V ... | protected <V> V visitOperator(AbstractExpressionVisitor<V> visitor, V e1, V e2) { |
CagataySonmez/EdgeCloudSim | src/edu/boun/edgecloudsim/network/NetworkModel.java | // Path: src/edu/boun/edgecloudsim/edge_client/Task.java
// public class Task extends Cloudlet {
// private Location submittedLocation;
// private double creationTime;
// private int type;
// private int mobileDeviceId;
// private int hostIndex;
// private int vmIndex;
// private int datacenterId;
//
/... | import edu.boun.edgecloudsim.utils.Location;
import edu.boun.edgecloudsim.edge_client.Task;
| /*
* Title: EdgeCloudSim - Network Model
*
* Description:
* NetworkModel is an abstract class which is used for calculating the
* network delay from device to device. For those who wants to add a
* custom Network Model to EdgeCloudSim should extend this class and
* provide a concrete instance via... | // Path: src/edu/boun/edgecloudsim/edge_client/Task.java
// public class Task extends Cloudlet {
// private Location submittedLocation;
// private double creationTime;
// private int type;
// private int mobileDeviceId;
// private int hostIndex;
// private int vmIndex;
// private int datacenterId;
//
/... | public abstract double getUploadDelay(int sourceDeviceId, int destDeviceId, Task task);
|
CagataySonmez/EdgeCloudSim | src/edu/boun/edgecloudsim/network/NetworkModel.java | // Path: src/edu/boun/edgecloudsim/edge_client/Task.java
// public class Task extends Cloudlet {
// private Location submittedLocation;
// private double creationTime;
// private int type;
// private int mobileDeviceId;
// private int hostIndex;
// private int vmIndex;
// private int datacenterId;
//
/... | import edu.boun.edgecloudsim.utils.Location;
import edu.boun.edgecloudsim.edge_client.Task;
| /*
* Title: EdgeCloudSim - Network Model
*
* Description:
* NetworkModel is an abstract class which is used for calculating the
* network delay from device to device. For those who wants to add a
* custom Network Model to EdgeCloudSim should extend this class and
* provide a concrete instance via... | // Path: src/edu/boun/edgecloudsim/edge_client/Task.java
// public class Task extends Cloudlet {
// private Location submittedLocation;
// private double creationTime;
// private int type;
// private int mobileDeviceId;
// private int hostIndex;
// private int vmIndex;
// private int datacenterId;
//
/... | public abstract void uploadStarted(Location accessPointLocation, int destDeviceId);
|
CagataySonmez/EdgeCloudSim | src/edu/boun/edgecloudsim/edge_orchestrator/EdgeOrchestrator.java | // Path: src/edu/boun/edgecloudsim/edge_client/Task.java
// public class Task extends Cloudlet {
// private Location submittedLocation;
// private double creationTime;
// private int type;
// private int mobileDeviceId;
// private int hostIndex;
// private int vmIndex;
// private int datacenterId;
//
/... | import org.cloudbus.cloudsim.core.SimEntity;
import edu.boun.edgecloudsim.edge_client.Task;
import org.cloudbus.cloudsim.Vm;
| /*
* Title: EdgeCloudSim - Edge Orchestrator
*
* Description:
* EdgeOrchestrator is an abstract class which is used for selecting VM
* for each client requests. For those who wants to add a custom
* Edge Orchestrator to EdgeCloudSim should extend this class and provide
* a concrete instance via ... | // Path: src/edu/boun/edgecloudsim/edge_client/Task.java
// public class Task extends Cloudlet {
// private Location submittedLocation;
// private double creationTime;
// private int type;
// private int mobileDeviceId;
// private int hostIndex;
// private int vmIndex;
// private int datacenterId;
//
/... | public abstract int getDeviceToOffload(Task task);
|
CagataySonmez/EdgeCloudSim | src/edu/boun/edgecloudsim/mobility/MobilityModel.java | // Path: src/edu/boun/edgecloudsim/utils/Location.java
// public class Location {
// private int xPos;
// private int yPos;
// private int servingWlanId;
// private int placeTypeIndex;
// public Location(int _placeTypeIndex, int _servingWlanId, int _xPos, int _yPos){
// servingWlanId = _servingWlanId;
// ... | import edu.boun.edgecloudsim.utils.Location;
| /*
* Title: EdgeCloudSim - Mobility Model
*
* Description:
* MobilityModel is an abstract class which is used for calculating the
* location of each mobile devices with respect to the time. For those who
* wants to add a custom Mobility Model to EdgeCloudSim should extend
* this class and provide... | // Path: src/edu/boun/edgecloudsim/utils/Location.java
// public class Location {
// private int xPos;
// private int yPos;
// private int servingWlanId;
// private int placeTypeIndex;
// public Location(int _placeTypeIndex, int _servingWlanId, int _xPos, int _yPos){
// servingWlanId = _servingWlanId;
// ... | public abstract Location getLocation(int deviceId, double time);
|
CagataySonmez/EdgeCloudSim | src/edu/boun/edgecloudsim/edge_client/MobileDeviceManager.java | // Path: src/edu/boun/edgecloudsim/utils/TaskProperty.java
// public class TaskProperty {
// private double startTime;
// private long length, inputFileSize, outputFileSize;
// private int taskType;
// private int pesNumber;
// private int mobileDeviceId;
//
// public TaskProperty(double _startTime, int _... | import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.UtilizationModel;
import edu.boun.edgecloudsim.utils.TaskProperty;
| package edu.boun.edgecloudsim.edge_client;
public abstract class MobileDeviceManager extends DatacenterBroker {
public MobileDeviceManager() throws Exception {
super("Global_Broker");
}
/*
* initialize mobile device manager if needed
*/
public abstract void initialize();
/*
* provi... | // Path: src/edu/boun/edgecloudsim/utils/TaskProperty.java
// public class TaskProperty {
// private double startTime;
// private long length, inputFileSize, outputFileSize;
// private int taskType;
// private int pesNumber;
// private int mobileDeviceId;
//
// public TaskProperty(double _startTime, int _... | public abstract void submitTask(TaskProperty edgeTask);
|
apache/incubator-taverna-mobile | app/src/main/java/org/apache/taverna/mobile/ui/imagezoom/ImageZoomFragment.java | // Path: app/src/main/java/org/apache/taverna/mobile/ui/base/BaseActivity.java
// public class BaseActivity extends AppCompatActivity {
//
// private ActivityComponent activityComponent;
//
//
// public ActivityComponent getActivityComponent() {
// if (activityComponent == null) {
// acti... | import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;... | ImageView close;
PhotoViewAttacher mAttacher;
private String svgURI;
private String jpgURI;
public static ImageZoomFragment newInstance(String jpgURI, String svgURI) {
Bundle args = new Bundle();
args.putString(JPG_URI, jpgURI);
args.putString(SVG_URI, svgURI);
Im... | // Path: app/src/main/java/org/apache/taverna/mobile/ui/base/BaseActivity.java
// public class BaseActivity extends AppCompatActivity {
//
// private ActivityComponent activityComponent;
//
//
// public ActivityComponent getActivityComponent() {
// if (activityComponent == null) {
// acti... | ((BaseActivity) getActivity()).getActivityComponent().inject(this); |
apache/incubator-taverna-mobile | app/src/main/java/org/apache/taverna/mobile/ui/imagezoom/ImageZoomPresenter.java | // Path: app/src/main/java/org/apache/taverna/mobile/utils/SvgDrawableTranscoder.java
// public class SvgDrawableTranscoder implements ResourceTranscoder<SVG, PictureDrawable> {
// @Override
// public Resource<PictureDrawable> transcode(Resource<SVG> toTranscode) {
// SVG svg = toTranscode.get();
// ... | import android.graphics.drawable.Drawable;
import android.graphics.drawable.PictureDrawable;
import android.net.Uri;
import android.os.Build;
import android.widget.ImageView;
import com.bumptech.glide.GenericRequestBuilder;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | // Path: app/src/main/java/org/apache/taverna/mobile/utils/SvgDrawableTranscoder.java
// public class SvgDrawableTranscoder implements ResourceTranscoder<SVG, PictureDrawable> {
// @Override
// public Resource<PictureDrawable> transcode(Resource<SVG> toTranscode) {
// SVG svg = toTranscode.get();
// ... | .transcode(new SvgDrawableTranscoder(), PictureDrawable.class) |
apache/incubator-taverna-mobile | app/src/main/java/org/apache/taverna/mobile/TavernaApplication.java | // Path: app/src/main/java/org/apache/taverna/mobile/injection/component/ApplicationComponent.java
// @Singleton
// @Component(modules = ApplicationModule.class)
// public interface ApplicationComponent {
//
// @ApplicationContext
// Context context();
// Application application();
// DataManager dataM... | import com.facebook.stetho.Stetho;
import com.raizlabs.android.dbflow.config.FlowConfig;
import com.raizlabs.android.dbflow.config.FlowManager;
import com.squareup.leakcanary.LeakCanary;
import org.apache.taverna.mobile.injection.component.ApplicationComponent;
import org.apache.taverna.mobile.injection.component.Dagge... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | // Path: app/src/main/java/org/apache/taverna/mobile/injection/component/ApplicationComponent.java
// @Singleton
// @Component(modules = ApplicationModule.class)
// public interface ApplicationComponent {
//
// @ApplicationContext
// Context context();
// Application application();
// DataManager dataM... | .applicationModule(new ApplicationModule(this)) |
apache/incubator-taverna-mobile | app/src/main/java/org/apache/taverna/mobile/ui/adapter/TutorialSliderAdapter.java | // Path: app/src/main/java/org/apache/taverna/mobile/data/model/TutorialSliderEnum.java
// public enum TutorialSliderEnum {
//
// SLIDE1(R.layout.tutorial_slide1),
// SLIDE2(R.layout.tutorial_slide2),
// SLIDE3(R.layout.tutorial_slide3),
// SLIDE4(R.layout.tutorial_slide4);
//
// private int layou... | import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import org.apache.taverna.mobile.data.model.TutorialSliderEnum;
import org.apache.taverna.mobile.injection.ApplicationContext;
import javax.inject.Inj... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | // Path: app/src/main/java/org/apache/taverna/mobile/data/model/TutorialSliderEnum.java
// public enum TutorialSliderEnum {
//
// SLIDE1(R.layout.tutorial_slide1),
// SLIDE2(R.layout.tutorial_slide2),
// SLIDE3(R.layout.tutorial_slide3),
// SLIDE4(R.layout.tutorial_slide4);
//
// private int layou... | TutorialSliderEnum tutorialSliderEnum = TutorialSliderEnum.values()[position]; |
apache/incubator-taverna-mobile | app/src/androidTest/java/org/apache/taverna/mobile/runner/RxAndroidJUnitRunner.java | // Path: app/src/androidTest/java/org/apache/taverna/mobile/utils/RxEspressoScheduleHandler.java
// public class RxEspressoScheduleHandler implements Function<Runnable, Runnable> {
//
// private final CountingIdlingResource mCountingIdlingResource =
// new CountingIdlingResource("rxJava");
//
// @... | import io.reactivex.plugins.RxJavaPlugins;
import org.apache.taverna.mobile.utils.RxEspressoScheduleHandler;
import android.os.Bundle;
import android.support.test.espresso.Espresso; | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | // Path: app/src/androidTest/java/org/apache/taverna/mobile/utils/RxEspressoScheduleHandler.java
// public class RxEspressoScheduleHandler implements Function<Runnable, Runnable> {
//
// private final CountingIdlingResource mCountingIdlingResource =
// new CountingIdlingResource("rxJava");
//
// @... | RxEspressoScheduleHandler rxEspressoScheduleHandler = new RxEspressoScheduleHandler(); |
apache/incubator-taverna-mobile | app/src/main/java/org/apache/taverna/mobile/ui/base/BaseActivity.java | // Path: app/src/main/java/org/apache/taverna/mobile/TavernaApplication.java
// public class TavernaApplication extends Application {
//
// ApplicationComponent mApplicationComponent;
//
// public static TavernaApplication get(Context context) {
// return (TavernaApplication) context.getApplicationCon... | import org.apache.taverna.mobile.TavernaApplication;
import org.apache.taverna.mobile.injection.component.ActivityComponent;
import org.apache.taverna.mobile.injection.component.DaggerActivityComponent;
import org.apache.taverna.mobile.injection.module.ActivityModule;
import android.support.v7.app.AppCompatActivity; | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | // Path: app/src/main/java/org/apache/taverna/mobile/TavernaApplication.java
// public class TavernaApplication extends Application {
//
// ApplicationComponent mApplicationComponent;
//
// public static TavernaApplication get(Context context) {
// return (TavernaApplication) context.getApplicationCon... | .activityModule(new ActivityModule(this)) |
apache/incubator-taverna-mobile | app/src/main/java/org/apache/taverna/mobile/ui/base/BaseActivity.java | // Path: app/src/main/java/org/apache/taverna/mobile/TavernaApplication.java
// public class TavernaApplication extends Application {
//
// ApplicationComponent mApplicationComponent;
//
// public static TavernaApplication get(Context context) {
// return (TavernaApplication) context.getApplicationCon... | import org.apache.taverna.mobile.TavernaApplication;
import org.apache.taverna.mobile.injection.component.ActivityComponent;
import org.apache.taverna.mobile.injection.component.DaggerActivityComponent;
import org.apache.taverna.mobile.injection.module.ActivityModule;
import android.support.v7.app.AppCompatActivity; | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | // Path: app/src/main/java/org/apache/taverna/mobile/TavernaApplication.java
// public class TavernaApplication extends Application {
//
// ApplicationComponent mApplicationComponent;
//
// public static TavernaApplication get(Context context) {
// return (TavernaApplication) context.getApplicationCon... | .applicationComponent(TavernaApplication.get(this).getComponent()) |
havarunner/havarunner | src/test/java/com/github/havarunner/beforeafter/BeforeCallOrderTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.RunSequentially;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.junit.Before;
import org.junit.Test;
import static com.github.havarunner.TestHelper.run;
import static org.junit.Assert.assertEquals... | package com.github.havarunner.beforeafter;
public class BeforeCallOrderTest {
static long grandParentBeforeCalled;
static long parentBeforeCalled;
static long childBeforeCalled;
@Test
public void HavaRunner_calls_the_ancestor_befores_first() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/beforeafter/BeforeCallOrderTest.java
import com.github.havarunner.HavaRunner;
import com.github... | run(new HavaRunner(Child.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/scenarios/covariant/CovariantScenarioConstructorTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.Scenarios;
import com.google.common.collect.Lists;
import org.junit.Test;
import java.util.Collection;
import static com.github.havarunner.TestHelper.run;
import static java.util.Arrays.asList;
import static java.util.Collections.synchroni... | package com.github.havarunner.scenarios.covariant;
public class CovariantScenarioConstructorTest {
static final Collection<Planet> seenPlanets = synchronizedList(Lists.<Planet>newArrayList());
@Test
public void havarunner_should_support_covariance_in_scenario_objects() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/scenarios/covariant/CovariantScenarioConstructorTest.java
import com.github.havarunner.HavaRunn... | run(new HavaRunner(CovarianceInScenarioObject.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/example/suite/browser/BrowserTest.java | // Path: src/test/java/com/github/havarunner/example/suite/WebApplicationSuiteTest.java
// @RunWith(HavaRunner.class)
// public class WebApplicationSuiteTest implements HavaRunnerSuite<WebServer> {
//
// final WebServer webServer;
//
// public WebApplicationSuiteTest() {
// this.webServer = new WebSer... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.PartOf;
import com.github.havarunner.example.suite.WebApplicationSuiteTest;
import com.github.havarunner.example.suite.WebServer;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
import s... | package com.github.havarunner.example.suite.browser;
@RunWith(HavaRunner.class)
@PartOf(WebApplicationSuiteTest.class)
public class BrowserTest {
| // Path: src/test/java/com/github/havarunner/example/suite/WebApplicationSuiteTest.java
// @RunWith(HavaRunner.class)
// public class WebApplicationSuiteTest implements HavaRunnerSuite<WebServer> {
//
// final WebServer webServer;
//
// public WebApplicationSuiteTest() {
// this.webServer = new WebSer... | private final WebServer webServer; |
havarunner/havarunner | src/test/java/com/github/havarunner/suite/suitedefinedinparent/SuiteDefinedInParentTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertTestClasses(List<Class> expected, Class testClass) {
// Set<String> parsedClassNames = parsedTestClassNames(testClass);
// assertEquals(toName(expected), parsedClassNames);
// }
//
// Path: src/test/java/com/github/havarun... | import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.notification.Failure;
import static com.github.havarunner.TestHelper.assertTestClasses;
import static com.github.havarunner.TestHelper.run;
import static com.github.hav... | package com.github.havarunner.suite.suitedefinedinparent;
public class SuiteDefinedInParentTest {
static boolean suiteMethodCalled;
static boolean innerSuiteMethodCalled;
@After
public void reset() {
suiteMethodCalled = false;
innerSuiteMethodCalled = false;
}
@Test
pub... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertTestClasses(List<Class> expected, Class testClass) {
// Set<String> parsedClassNames = parsedTestClassNames(testClass);
// assertEquals(toName(expected), parsedClassNames);
// }
//
// Path: src/test/java/com/github/havarun... | run(new HavaRunner(SuiteMember.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/suite/suitedefinedinparent/SuiteDefinedInParentTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertTestClasses(List<Class> expected, Class testClass) {
// Set<String> parsedClassNames = parsedTestClassNames(testClass);
// assertEquals(toName(expected), parsedClassNames);
// }
//
// Path: src/test/java/com/github/havarun... | import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.notification.Failure;
import static com.github.havarunner.TestHelper.assertTestClasses;
import static com.github.havarunner.TestHelper.run;
import static com.github.hav... | suiteMethodCalled = false;
innerSuiteMethodCalled = false;
}
@Test
public void abstract_classes_may_declare_suite_membership() {
run(new HavaRunner(SuiteMember.class));
assertTrue(suiteMethodCalled);
}
@Test
public void abstract_classes_may_declare_suite_members... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertTestClasses(List<Class> expected, Class testClass) {
// Set<String> parsedClassNames = parsedTestClassNames(testClass);
// assertEquals(toName(expected), parsedClassNames);
// }
//
// Path: src/test/java/com/github/havarun... | assertTestClasses(Lists.<Class>newArrayList(SuiteMember.class, SuiteMember.InnerSuiteMember.class), Suite.class); |
havarunner/havarunner | src/test/java/com/github/havarunner/enclosed/EnclosedStaticClassesTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import org.junit.Test;
import static com.github.havarunner.TestHelper.run;
import static org.junit.Assert.assertTrue; | package com.github.havarunner.enclosed;
public class EnclosedStaticClassesTest {
static boolean parentCalled;
static boolean childCalled;
static boolean grandchildCalled;
static boolean grandGrandchildCalled;
@Test
public void HavaRunner_supports_recursive_static_inner_classes() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/enclosed/EnclosedStaticClassesTest.java
import com.github.havarunner.HavaRunner;
import org.jun... | run(new HavaRunner(Parent.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/afterall/SuiteMember2.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
| import com.github.havarunner.annotation.AfterAll;
import com.github.havarunner.annotation.PartOf;
import org.junit.Test;
import static com.github.havarunner.TestHelper.addHundredTimes; | package com.github.havarunner.sequentiality.afterall;
@PartOf(SequentialSuite.class)
class SuiteMember2 {
SuiteMember2(String suiteObject) {}
@Test
void test() {}
@AfterAll
void shutdown() throws InterruptedException { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
// ... | addHundredTimes(2, SequentialityWithAfterAllsTest.ints); |
havarunner/havarunner | src/test/java/com/github/havarunner/scenarios/MultipleScenariosTest.java | // Path: src/test/java/com/github/havarunner/example/scenario/Person.java
// public enum Person {
// KID,
// ADULT
// }
//
// Path: src/test/java/com/github/havarunner/example/scenario/RestaurantMenuTest.java
// @RunWith(HavaRunner.class)
// public class RestaurantMenuTest {
//
// private final Person pe... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.TestAndParameters;
import com.github.havarunner.annotation.Scenarios;
import com.github.havarunner.example.scenario.Person;
import com.github.havarunner.example.scenario.RestaurantMenuTest;
import com.github.havarunner.exception.ConstructorNotFound;
... | package com.github.havarunner.scenarios;
public class MultipleScenariosTest {
@Test
public void it_constructs_an_example_for_each_scenario() throws InitializationError { | // Path: src/test/java/com/github/havarunner/example/scenario/Person.java
// public enum Person {
// KID,
// ADULT
// }
//
// Path: src/test/java/com/github/havarunner/example/scenario/RestaurantMenuTest.java
// @RunWith(HavaRunner.class)
// public class RestaurantMenuTest {
//
// private final Person pe... | int numberOfScenarios = Person.values().length; |
havarunner/havarunner | src/test/java/com/github/havarunner/scenarios/MultipleScenariosTest.java | // Path: src/test/java/com/github/havarunner/example/scenario/Person.java
// public enum Person {
// KID,
// ADULT
// }
//
// Path: src/test/java/com/github/havarunner/example/scenario/RestaurantMenuTest.java
// @RunWith(HavaRunner.class)
// public class RestaurantMenuTest {
//
// private final Person pe... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.TestAndParameters;
import com.github.havarunner.annotation.Scenarios;
import com.github.havarunner.example.scenario.Person;
import com.github.havarunner.example.scenario.RestaurantMenuTest;
import com.github.havarunner.exception.ConstructorNotFound;
... | package com.github.havarunner.scenarios;
public class MultipleScenariosTest {
@Test
public void it_constructs_an_example_for_each_scenario() throws InitializationError {
int numberOfScenarios = Person.values().length; | // Path: src/test/java/com/github/havarunner/example/scenario/Person.java
// public enum Person {
// KID,
// ADULT
// }
//
// Path: src/test/java/com/github/havarunner/example/scenario/RestaurantMenuTest.java
// @RunWith(HavaRunner.class)
// public class RestaurantMenuTest {
//
// private final Person pe... | Iterable<TestAndParameters> children = new HavaRunner(RestaurantMenuTest.class).tests(); |
havarunner/havarunner | src/test/java/com/github/havarunner/scenarios/MultipleScenariosTest.java | // Path: src/test/java/com/github/havarunner/example/scenario/Person.java
// public enum Person {
// KID,
// ADULT
// }
//
// Path: src/test/java/com/github/havarunner/example/scenario/RestaurantMenuTest.java
// @RunWith(HavaRunner.class)
// public class RestaurantMenuTest {
//
// private final Person pe... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.TestAndParameters;
import com.github.havarunner.annotation.Scenarios;
import com.github.havarunner.example.scenario.Person;
import com.github.havarunner.example.scenario.RestaurantMenuTest;
import com.github.havarunner.exception.ConstructorNotFound;
... | package com.github.havarunner.scenarios;
public class MultipleScenariosTest {
@Test
public void it_constructs_an_example_for_each_scenario() throws InitializationError {
int numberOfScenarios = Person.values().length;
Iterable<TestAndParameters> children = new HavaRunner(RestaurantMenuTest.... | // Path: src/test/java/com/github/havarunner/example/scenario/Person.java
// public enum Person {
// KID,
// ADULT
// }
//
// Path: src/test/java/com/github/havarunner/example/scenario/RestaurantMenuTest.java
// @RunWith(HavaRunner.class)
// public class RestaurantMenuTest {
//
// private final Person pe... | run(new HavaRunner(ValidScenarioTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/scenarios/MultipleScenariosTest.java | // Path: src/test/java/com/github/havarunner/example/scenario/Person.java
// public enum Person {
// KID,
// ADULT
// }
//
// Path: src/test/java/com/github/havarunner/example/scenario/RestaurantMenuTest.java
// @RunWith(HavaRunner.class)
// public class RestaurantMenuTest {
//
// private final Person pe... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.TestAndParameters;
import com.github.havarunner.annotation.Scenarios;
import com.github.havarunner.example.scenario.Person;
import com.github.havarunner.example.scenario.RestaurantMenuTest;
import com.github.havarunner.exception.ConstructorNotFound;
... | }
@Test
public void HavaRunner_raises_an_exception_if_the_scenario_method_does_not_have_the_scenario_object_as_only_arg() throws Exception {
final AtomicReference<Failure> expectedFailure = runInvalidScenarioTestMethod();
assertEquals(ConstructorNotFound.class, expectedFailure.get().getExce... | // Path: src/test/java/com/github/havarunner/example/scenario/Person.java
// public enum Person {
// KID,
// ADULT
// }
//
// Path: src/test/java/com/github/havarunner/example/scenario/RestaurantMenuTest.java
// @RunWith(HavaRunner.class)
// public class RestaurantMenuTest {
//
// private final Person pe... | List<Failure> failures = runAndRecordFailures(new HavaRunner(TwoScenarioMethodsTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/timeout/TimeoutTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// final AtomicReference<Failure> expectedFailure = new AtomicReference<>();
// RunNotifier runNotifier = new RunNotifier() {
// @Override
// public void fireTestFai... | import com.github.havarunner.HavaRunner;
import org.junit.Test;
import org.junit.runner.notification.Failure;
import static com.github.havarunner.TestHelper.runAndRecordFailure;
import static org.junit.Assert.assertTrue; | package com.github.havarunner.timeout;
public class TimeoutTest {
@Test
public void HavaRunner_throws_an_exception_if_the_test_times_out() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// final AtomicReference<Failure> expectedFailure = new AtomicReference<>();
// RunNotifier runNotifier = new RunNotifier() {
// @Override
// public void fireTestFai... | Failure failure = runAndRecordFailure(new HavaRunner(TimedOut.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/afterall/SequentialityWithAfterAllsTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertAllEqual(int expected, List<Integer> integers) {
// assertTrue(allEqual(expected, integers));
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier ru... | import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import org.junit.Test;
import java.util.List;
import static com.github.havarunner.TestHelper.assertAllEqual;
import static com.github.havarunner.TestHelper.run; | package com.github.havarunner.sequentiality.afterall;
public class SequentialityWithAfterAllsTest {
static List<Integer> ints = Lists.newArrayList();
@Test
public void HavaRunner_synchronises_the_AfterAll_methods() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertAllEqual(int expected, List<Integer> integers) {
// assertTrue(allEqual(expected, integers));
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier ru... | run(new HavaRunner(SequentialSuite.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/afterall/SequentialityWithAfterAllsTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertAllEqual(int expected, List<Integer> integers) {
// assertTrue(allEqual(expected, integers));
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier ru... | import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import org.junit.Test;
import java.util.List;
import static com.github.havarunner.TestHelper.assertAllEqual;
import static com.github.havarunner.TestHelper.run; | package com.github.havarunner.sequentiality.afterall;
public class SequentialityWithAfterAllsTest {
static List<Integer> ints = Lists.newArrayList();
@Test
public void HavaRunner_synchronises_the_AfterAll_methods() {
run(new HavaRunner(SequentialSuite.class));
if (ints.get(0) == 1) { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertAllEqual(int expected, List<Integer> integers) {
// assertTrue(allEqual(expected, integers));
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier ru... | assertAllEqual(1, ints.subList(0, 100)); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/RunSequentiallyTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.github.havarunner.TestAndParameters;
import com.github.havarunner.annotation.RunSequentially;
import com.github.havarunner.annotation.Scenarios;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists... | static class SequentialTest {
@Test
void examples_in_this_class_are_run_sequentially() {
}
}
static class test_that_extends_a_sequential_test extends SequentialTest {
@Test
void examples_in_this_class_are_run_sequentially() {
... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/sequentiality/RunSequentiallyTest.java
import com.github.havarunner.HavaRunner;
import com.gith... | run(new HavaRunner(SequentialityAndScenariosTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/rules/WhenRuleFailsTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// final AtomicReference<Failure> expectedFailure = new AtomicReference<>();
// RunNotifier runNotifier = new RunNotifier() {
// @Override
// public void fireTestFai... | import com.github.havarunner.HavaRunner;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runner.notification.Failure;
import org.junit.runners.model.Statement;
import static com.github.havarunner.TestHelper.runAndRecordFailure;
import ... | package com.github.havarunner.rules;
public class WhenRuleFailsTest {
@Test
public void HavaRunner_will_give_a_helpful_error_message_if_a_rule_throws_an_exception() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// final AtomicReference<Failure> expectedFailure = new AtomicReference<>();
// RunNotifier runNotifier = new RunNotifier() {
// @Override
// public void fireTestFai... | Failure failure = runAndRecordFailure(new HavaRunner(TestWithRule.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/FilterTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.github.havarunner.annotation.Scenarios;
import org.junit.Test;
import org.junit.runner.Description;
import org.junit.runner.manipulation.Filter;
import java.util.Collection;
import java.uti... | package com.github.havarunner;
public class FilterTest {
@Test
public void HavaRunner_supports_the_JUnit_filter_API() {
HavaRunner havaRunner = new HavaRunner(TestClass.class);
havaRunner.filter(new Filter() {
public boolean shouldRun(Description description) {
t... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/FilterTest.java
import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists... | run(havaRunner); |
havarunner/havarunner | src/test/java/com/github/havarunner/suite/RunningSuiteTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.PartOf;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import static com.github.havarunner.TestHelper.run;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert... | package com.github.havarunner.suite;
@RunWith(Enclosed.class)
public class RunningSuiteTest {
public static class when_running_the_whole_suite {
static boolean suiteTestCalled;
static boolean suiteMember1Called;
static boolean suiteMember2Called;
@Test
public void HavaRu... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/suite/RunningSuiteTest.java
import com.github.havarunner.HavaRunner;
import com.github.havarunn... | run(new HavaRunner(ExampleSuite.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/IgnoredTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static List<Description> runAndRecordIgnores(HavaRunner havaRunner) {
// final List<Description> ignores = Collections.synchronizedList(Lists.<Description>newArrayList());
// RunNotifier runNotifier = new RunNotifier() {
// @Override... | import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.Description;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.InitializationError;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import static com.github.havarunner.TestHelper.runAndRecor... | package com.github.havarunner;
public class IgnoredTest {
static boolean ignoredTestIsRun;
static boolean testInIgnoredCLassIsRun;
@Test
public void it_records_ignored_tests_properly() throws InitializationError {
HavaRunner havaRunner = new HavaRunner(ContainingIgnoredTest.class); | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static List<Description> runAndRecordIgnores(HavaRunner havaRunner) {
// final List<Description> ignores = Collections.synchronizedList(Lists.<Description>newArrayList());
// RunNotifier runNotifier = new RunNotifier() {
// @Override... | final List<Description> expectedIgnoration = runAndRecordIgnores(havaRunner); |
havarunner/havarunner | src/test/java/com/github/havarunner/scenarios/AfterAllsWithScenariosTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.AfterAll;
import com.github.havarunner.annotation.Scenarios;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.junit.Test;
import java.util.Collections;
import java.util.List;
import java.util.Set;
i... | package com.github.havarunner.scenarios;
public class AfterAllsWithScenariosTest {
private static List<String> afterAllMethodsCalled = Collections.synchronizedList(Lists.<String>newArrayList());
@Test
public void HavaRunner_will_call_the_AfterAll_methods_for_all_the_scenario_instances() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/scenarios/AfterAllsWithScenariosTest.java
import com.github.havarunner.HavaRunner;
import com.g... | run(new HavaRunner(ValidScenarioTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/suite/covariant/SuiteConstructorSubclassTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import org.junit.After;
import org.junit.Test;
import static com.github.havarunner.TestHelper.run;
import static org.junit.Assert.assertTrue; | package com.github.havarunner.suite.covariant;
public class SuiteConstructorSubclassTest {
static boolean suiteMemberTestInvoked = false;
@After
public void reset() {
suiteMemberTestInvoked = false;
}
@Test
public void havarunner_should_support_covariant_suite_objects(){ | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/suite/covariant/SuiteConstructorSubclassTest.java
import com.github.havarunner.HavaRunner;
impo... | run(new HavaRunner(Suite.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/TestMethodInSuperclassTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import org.junit.Test;
import static com.github.havarunner.TestHelper.run;
import static org.junit.Assert.assertTrue; | package com.github.havarunner;
public class TestMethodInSuperclassTest {
static boolean parentCalled;
static boolean grandParentCalled;
@Test
public void HavaRunner_scans_for_test_methods_in_the_class_hierarchy() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/TestMethodInSuperclassTest.java
import org.junit.Test;
import static com.github.havarunner.Test... | run(new HavaRunner(Child.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/AssumeThatTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailedAssumption(HavaRunner havaRunner) ... | import com.github.havarunner.annotation.AfterAll;
import com.github.havarunner.annotation.RunSequentially;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runner.notification.Failure;
import org.junit.runner.no... | package com.github.havarunner;
public class AssumeThatTest {
@Test
public void HavaRunner_ignores_tests_that_use_the_assume_API_of_JUnit() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailedAssumption(HavaRunner havaRunner) ... | Failure failure = runAndRecordFailedAssumption(new HavaRunner(AssumptionDoesNotHold.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/beforeafter/AfterWhenExceptionTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.RunSequentially;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static com.github.havarunner.TestHelper.run;
import static com.github.havarunner.TestHelper.runAndIgnoreErrors;
import static org.junit.Assert.... | package com.github.havarunner.beforeafter;
public class AfterWhenExceptionTest {
static boolean afterCalled;
@Test
public void HavaRunner_the_after_method_even_if_the_test_fails() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(... | runAndIgnoreErrors(new HavaRunner(SequentialTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/suite/ImplicitSuiteMembersTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertTestClasses(List<Class> expected, Class testClass) {
// Set<String> parsedClassNames = parsedTestClassNames(testClass);
// assertEquals(toName(expected), parsedClassNames);
// }
//
// Path: src/test/java/com/github/havarun... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.HavaRunnerSuite;
import com.github.havarunner.annotation.PartOf;
import com.google.common.collect.Lists;
import org.junit.Test;
import static com.github.havarunner.TestHelper.assertTestClasses;
import static com.github.havarunner.TestHelper.run;
impo... | package com.github.havarunner.suite;
public class ImplicitSuiteMembersTest {
static boolean implicitTestInvoked;
@Test
public void suites_implicitly_include_enclosed_classes_of_suite_members() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertTestClasses(List<Class> expected, Class testClass) {
// Set<String> parsedClassNames = parsedTestClassNames(testClass);
// assertEquals(toName(expected), parsedClassNames);
// }
//
// Path: src/test/java/com/github/havarun... | run(new HavaRunner(Suite.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/suite/ImplicitSuiteMembersTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertTestClasses(List<Class> expected, Class testClass) {
// Set<String> parsedClassNames = parsedTestClassNames(testClass);
// assertEquals(toName(expected), parsedClassNames);
// }
//
// Path: src/test/java/com/github/havarun... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.HavaRunnerSuite;
import com.github.havarunner.annotation.PartOf;
import com.google.common.collect.Lists;
import org.junit.Test;
import static com.github.havarunner.TestHelper.assertTestClasses;
import static com.github.havarunner.TestHelper.run;
impo... | package com.github.havarunner.suite;
public class ImplicitSuiteMembersTest {
static boolean implicitTestInvoked;
@Test
public void suites_implicitly_include_enclosed_classes_of_suite_members() {
run(new HavaRunner(Suite.class));
assertTrue(implicitTestInvoked);
}
@Test
publ... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void assertTestClasses(List<Class> expected, Class testClass) {
// Set<String> parsedClassNames = parsedTestClassNames(testClass);
// assertEquals(toName(expected), parsedClassNames);
// }
//
// Path: src/test/java/com/github/havarun... | assertTestClasses(Lists.<Class>newArrayList(SuiteMember.class, SuiteMember.InnerSuiteClass.class), Suite.class); |
havarunner/havarunner | src/test/java/com/github/havarunner/beforeafter/AfterBeforeTimingTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.RunSequentially;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static com.github.havarunner.TestHelper.run;
import static org.junit.Assert.assertTrue; | package com.github.havarunner.beforeafter;
public class AfterBeforeTimingTest {
static long beforeCalled;
static long testCalled;
static long afterCalled;
@Test
public void HavaRunner_calls_first_before_then_test_and_finally_after() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/beforeafter/AfterBeforeTimingTest.java
import com.github.havarunner.HavaRunner;
import com.gith... | run(new HavaRunner(SequentialTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/example/suite/scenario/RestForDifferentUsersTest.java | // Path: src/test/java/com/github/havarunner/example/suite/WebApplicationSuiteTest.java
// @RunWith(HavaRunner.class)
// public class WebApplicationSuiteTest implements HavaRunnerSuite<WebServer> {
//
// final WebServer webServer;
//
// public WebApplicationSuiteTest() {
// this.webServer = new WebSer... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.PartOf;
import com.github.havarunner.annotation.Scenarios;
import com.github.havarunner.example.suite.WebApplicationSuiteTest;
import com.github.havarunner.example.suite.WebServer;
import org.junit.Test;
import org.junit.runner.RunWith;
im... | package com.github.havarunner.example.suite.scenario;
@RunWith(HavaRunner.class)
@PartOf(WebApplicationSuiteTest.class)
public class RestForDifferentUsersTest {
| // Path: src/test/java/com/github/havarunner/example/suite/WebApplicationSuiteTest.java
// @RunWith(HavaRunner.class)
// public class WebApplicationSuiteTest implements HavaRunnerSuite<WebServer> {
//
// final WebServer webServer;
//
// public WebApplicationSuiteTest() {
// this.webServer = new WebSer... | private final WebServer webServer; |
havarunner/havarunner | src/test/java/com/github/havarunner/example/suite/rest/RestTest.java | // Path: src/test/java/com/github/havarunner/example/suite/WebApplicationSuiteTest.java
// @RunWith(HavaRunner.class)
// public class WebApplicationSuiteTest implements HavaRunnerSuite<WebServer> {
//
// final WebServer webServer;
//
// public WebApplicationSuiteTest() {
// this.webServer = new WebSer... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.PartOf;
import com.github.havarunner.example.suite.WebApplicationSuiteTest;
import com.github.havarunner.example.suite.WebServer;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals; | package com.github.havarunner.example.suite.rest;
@RunWith(HavaRunner.class)
@PartOf(WebApplicationSuiteTest.class)
public class RestTest {
| // Path: src/test/java/com/github/havarunner/example/suite/WebApplicationSuiteTest.java
// @RunWith(HavaRunner.class)
// public class WebApplicationSuiteTest implements HavaRunnerSuite<WebServer> {
//
// final WebServer webServer;
//
// public WebApplicationSuiteTest() {
// this.webServer = new WebSer... | private final WebServer webServer; |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/RunSequentiallyTestsOfSameInstance.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
//
/... | import com.github.havarunner.ConcurrencyControl;
import com.github.havarunner.HavaRunner;
import com.github.havarunner.TestAndParameters;
import com.github.havarunner.annotation.RunSequentially;
import com.github.havarunner.annotation.Scenarios;
import com.google.common.base.Predicate;
import com.google.common.collect.... | public void HavaRunner_marks_the_test_to_be_RunSequentially() {
TestAndParameters test = findByClass(new HavaRunner(SequentialSuite.class).tests(), SuiteMember.class);
assertTrue(test.runSequentially().isDefined());
assertEquals("tests in this suite do not thrive in the concu... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
//
/... | run(new HavaRunner(SeqTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/RunSequentiallyTestsOfSameInstance.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
//
/... | import com.github.havarunner.ConcurrencyControl;
import com.github.havarunner.HavaRunner;
import com.github.havarunner.TestAndParameters;
import com.github.havarunner.annotation.RunSequentially;
import com.github.havarunner.annotation.Scenarios;
import com.google.common.base.Predicate;
import com.google.common.collect.... | @Test
public void HavaRunner_lets_the_test_override_the_RunSequentially_spec_of_the_suite() {
TestAndParameters test = findByClass(
new HavaRunner(SequentialSuite.class).tests(),
SuiteMemberOverridingRunSequentially.class
);
assertTrue(... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
//
/... | assertAllEqual(1, items.subList(0, 100)); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/RunSequentiallyTestsOfSameInstance.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
//
/... | import com.github.havarunner.ConcurrencyControl;
import com.github.havarunner.HavaRunner;
import com.github.havarunner.TestAndParameters;
import com.github.havarunner.annotation.RunSequentially;
import com.github.havarunner.annotation.Scenarios;
import com.google.common.base.Predicate;
import com.google.common.collect.... | });
}
}
public static class when_there_is_only_one_test {
static List<Integer> items = Lists.newArrayList();
@BeforeClass
public static void runTest() {
run(new HavaRunner(SeqTest.class));
}
@Test
public void HavaRunner_can_run_s... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
//
/... | addHundredTimes(1, items); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/afterall/SuiteMember1.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
| import com.github.havarunner.annotation.AfterAll;
import com.github.havarunner.annotation.PartOf;
import org.junit.Test;
import static com.github.havarunner.TestHelper.addHundredTimes; | package com.github.havarunner.sequentiality.afterall;
@PartOf(SequentialSuite.class)
class SuiteMember1 {
SuiteMember1(String suiteObject) {}
@Test
void test() {}
@AfterAll
void shutdown() throws InterruptedException { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> void addHundredTimes(T item, List<T> items) throws InterruptedException {
// for (int i = 0; i < 100; i++) {
// Thread.sleep(1); // Sleep to increase chances of context switching
// items.add(item);
// }
// }
// ... | addHundredTimes(1, SequentialityWithAfterAllsTest.ints); |
havarunner/havarunner | src/test/java/com/github/havarunner/rules/RuleTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import java.util.Collection;
import java.util.Collections;
import java.util.List;... | package com.github.havarunner.rules;
public class RuleTest {
static Collection<Description> firstRuleApplications= Collections.synchronizedList(Lists.<Description>newArrayList());
static Collection<Description> secondRuleApplications = Collections.synchronizedList(Lists.<Description>newArrayList());
sta... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/rules/RuleTest.java
import com.github.havarunner.HavaRunner;
import com.google.common.collect.L... | run(new HavaRunner(TestWithTwoRules.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/suite/RunningSuiteMembersIndividuallyTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// ... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.HavaRunnerSuite;
import com.github.havarunner.annotation.PartOf;
import com.github.havarunner.annotation.Scenarios;
import com.github.havarunner.exception.ConstructorNotFound;
import com.google.common.collect.Lists;
import com.google.common.collect.S... | package com.github.havarunner.suite;
@RunWith(Enclosed.class)
public class RunningSuiteMembersIndividuallyTest {
public static class when_one_suite_and_scenarios {
static String suiteObject;
static List<String> scenarios = Lists.newArrayList();
@Test
public void HavaRunner_pass... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// ... | run(new HavaRunner(test_with_scenarios_that_belongs_to_a_suite.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/suite/RunningSuiteMembersIndividuallyTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// ... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.HavaRunnerSuite;
import com.github.havarunner.annotation.PartOf;
import com.github.havarunner.annotation.Scenarios;
import com.github.havarunner.exception.ConstructorNotFound;
import com.google.common.collect.Lists;
import com.google.common.collect.S... |
@PartOf(Suite.class)
static class TestInASuite {
TestInASuite(String suiteObj) {
receivedSuiteObjects.add(suiteObj);
}
@Test
void test() {
}
}
@PartOf(Suite.class)
static class AnotherTestInTheSuite {... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// ... | Failure failure = runAndRecordFailure(new HavaRunner(TestWithoutTheRequiredSuiteConstructor.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/beforeafter/AfterWhenExceptionInBeforeTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(havaRunner, new RunNotifier());
// }
| import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.RunSequentially;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static com.github.havarunner.TestHelper.runAndIgnoreErrors;
import static org.junit.Assert.assertTrue; | package com.github.havarunner.beforeafter;
public class AfterWhenExceptionInBeforeTest {
static boolean afterCalled;
@Test
public void HavaRunner_the_after_method_even_if_the_before_call_fails() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(havaRunner, new RunNotifier());
// }
// Path: src/test/java/com/github/havarunner/beforeafter/AfterWhenExceptionInBeforeTest.java
import com.github.havarunner.HavaRunner;
import co... | runAndIgnoreErrors(new HavaRunner(SequentialTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/enclosed/EnclosedNonStaticTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// final AtomicReference<Failure> expectedFailure = new AtomicReference<>();
// RunNotifier runNotifier = new RunNotifier() {
// @Override
// public void fireTestFai... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.HavaRunnerSuite;
import com.github.havarunner.annotation.PartOf;
import com.github.havarunner.exception.NonStaticInnerClassException;
import org.junit.Test;
import org.junit.runner.notification.Failure;
import static com.github.havarunner.TestHelper.... | package com.github.havarunner.enclosed;
public class EnclosedNonStaticTest {
@Test
public void HavaRunner_gives_a_helpful_error_if_the_class_contains_nonstatic_inner_classes() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// final AtomicReference<Failure> expectedFailure = new AtomicReference<>();
// RunNotifier runNotifier = new RunNotifier() {
// @Override
// public void fireTestFai... | Failure failure = runAndRecordFailure(new HavaRunner(TestClass.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/ExpectedExceptionTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// final AtomicReference<Failure> expectedFailure = new AtomicReference<>();
// RunNotifier runNotifier = new RunNotifier() {
// @Override
// public void fireTestFai... | import com.github.havarunner.exception.TestDidNotRiseExpectedException;
import org.junit.Test;
import org.junit.runner.notification.Failure;
import static com.github.havarunner.TestHelper.runAndRecordFailure;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.juni... | package com.github.havarunner;
public class ExpectedExceptionTest {
@Test
public void HavaRunner_supports_the_expected_exception_in_the_Test_annotation() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// final AtomicReference<Failure> expectedFailure = new AtomicReference<>();
// RunNotifier runNotifier = new RunNotifier() {
// @Override
// public void fireTestFai... | Failure failure = runAndRecordFailure(new HavaRunner(TestWithExpectedException.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/OneFailsOneSucceedsTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(havaRunner, new RunNotifier());
// }
| import com.github.havarunner.annotation.AfterAll;
import com.github.havarunner.annotation.Scenarios;
import com.google.common.collect.Lists;
import org.junit.Test;
import java.util.Collections;
import java.util.List;
import static com.github.havarunner.TestHelper.runAndIgnoreErrors;
import static com.google.common.coll... | package com.github.havarunner;
public class OneFailsOneSucceedsTest {
static List<String> messages = Collections.synchronizedList(Lists.<String>newArrayList());
@Test
public void HavaRunner_calls_the_AfterAll_even_though_one_constructor_in_the_test_set_fails() { // This is a regression test | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(havaRunner, new RunNotifier());
// }
// Path: src/test/java/com/github/havarunner/OneFailsOneSucceedsTest.java
import com.github.havarunner.annotation.AfterAll;
import com.github.h... | runAndIgnoreErrors(new HavaRunner(OtherFails.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/ParallelismTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> boolean allEqual(final T expected, List<T> items) {
// return Iterables.all(items, new Predicate<T>() {
// public boolean apply(T input) {
// return input.equals(expected);
// }
// });
// }
//
// Path:... | import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.Collections;
import java.util.List;
import static com.github.havarunner.TestHelper.allEqual;
import static com.github.havarunner.TestHelper.run;
import static org.junit.... | package com.github.havarunner.sequentiality;
public class ParallelismTest {
static List<Integer> items = Collections.synchronizedList(Lists.<Integer>newArrayList());
@BeforeClass
public static void runTest() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> boolean allEqual(final T expected, List<T> items) {
// return Iterables.all(items, new Predicate<T>() {
// public boolean apply(T input) {
// return input.equals(expected);
// }
// });
// }
//
// Path:... | run(new HavaRunner(ParallelTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/sequentiality/ParallelismTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> boolean allEqual(final T expected, List<T> items) {
// return Iterables.all(items, new Predicate<T>() {
// public boolean apply(T input) {
// return input.equals(expected);
// }
// });
// }
//
// Path:... | import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.Collections;
import java.util.List;
import static com.github.havarunner.TestHelper.allEqual;
import static com.github.havarunner.TestHelper.run;
import static org.junit.... | package com.github.havarunner.sequentiality;
public class ParallelismTest {
static List<Integer> items = Collections.synchronizedList(Lists.<Integer>newArrayList());
@BeforeClass
public static void runTest() {
run(new HavaRunner(ParallelTest.class));
}
@Test
public void HavaRunner... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static <T> boolean allEqual(final T expected, List<T> items) {
// return Iterables.all(items, new Predicate<T>() {
// public boolean apply(T input) {
// return input.equals(expected);
// }
// });
// }
//
// Path:... | assertFalse(allEqual(1, items.subList(0, 100))); |
havarunner/havarunner | src/test/java/com/github/havarunner/beforeafter/AfterCallOrderTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.RunSequentially;
import org.junit.After;
import org.junit.Test;
import static com.github.havarunner.TestHelper.run;
import static org.junit.Assert.assertTrue; | package com.github.havarunner.beforeafter;
public class AfterCallOrderTest {
static long grandParentAfterCalled;
static long parentAfterCalled;
static long childAfterCalled;
@Test
public void HavaRunner_calls_the_descendant_afters_first() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/beforeafter/AfterCallOrderTest.java
import com.github.havarunner.HavaRunner;
import com.github.... | run(new HavaRunner(Child.class)); |
havarunner/havarunner | src/test/java/org/testapp/InvalidSuiteConfigTest.java | // Path: src/test/java/org/testapp/suite/TestAppSuite.java
// public class TestAppSuite implements HavaRunnerSuite<String> {
// @Override
// public String suiteObject() {
// return "hello";
// }
//
// @Override
// public void afterSuite() {
// }
// }
//
// Path: src/test/java/com/githu... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.PartOf;
import com.github.havarunner.exception.SuiteMemberDoesNotBelongToSuitePackage;
import org.junit.Test;
import org.junit.runner.notification.Failure;
import org.testapp.suite.TestAppSuite;
import static com.github.havarunner.TestHelp... | package org.testapp;
public class InvalidSuiteConfigTest {
@Test
public void suite_members_must_be_within_the_same_package_as_the_suite() { | // Path: src/test/java/org/testapp/suite/TestAppSuite.java
// public class TestAppSuite implements HavaRunnerSuite<String> {
// @Override
// public String suiteObject() {
// return "hello";
// }
//
// @Override
// public void afterSuite() {
// }
// }
//
// Path: src/test/java/com/githu... | Failure failure = runAndRecordFailure(new HavaRunner(InvalidSuiteMember.class)); |
havarunner/havarunner | src/test/java/org/testapp/InvalidSuiteConfigTest.java | // Path: src/test/java/org/testapp/suite/TestAppSuite.java
// public class TestAppSuite implements HavaRunnerSuite<String> {
// @Override
// public String suiteObject() {
// return "hello";
// }
//
// @Override
// public void afterSuite() {
// }
// }
//
// Path: src/test/java/com/githu... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.PartOf;
import com.github.havarunner.exception.SuiteMemberDoesNotBelongToSuitePackage;
import org.junit.Test;
import org.junit.runner.notification.Failure;
import org.testapp.suite.TestAppSuite;
import static com.github.havarunner.TestHelp... | package org.testapp;
public class InvalidSuiteConfigTest {
@Test
public void suite_members_must_be_within_the_same_package_as_the_suite() {
Failure failure = runAndRecordFailure(new HavaRunner(InvalidSuiteMember.class));
assertEquals(SuiteMemberDoesNotBelongToSuitePackage.class, failure.getE... | // Path: src/test/java/org/testapp/suite/TestAppSuite.java
// public class TestAppSuite implements HavaRunnerSuite<String> {
// @Override
// public String suiteObject() {
// return "hello";
// }
//
// @Override
// public void afterSuite() {
// }
// }
//
// Path: src/test/java/com/githu... | @PartOf(TestAppSuite.class) |
havarunner/havarunner | src/test/java/com/github/havarunner/validations/UnsupportedJUnitAnnotationsTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// ... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.RunSequentially;
import com.github.havarunner.exception.UnsupportedAnnotationException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import static com.github.havarunner.TestHelper.run... | package com.github.havarunner.validations;
public class UnsupportedJUnitAnnotationsTest {
@Test
public void HavaRunner_gives_a_helpful_error_message_a_parallel_test_uses_an_annotation_that_may_only_be_used_with_sequential_tests() {
HavaRunner havaRunner = new HavaRunner(ParallelTestWithBefore.class)... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// ... | UnsupportedAnnotationException report = (UnsupportedAnnotationException) runAndRecordFailure(havaRunner).getException(); |
havarunner/havarunner | src/test/java/com/github/havarunner/validations/UnsupportedJUnitAnnotationsTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// ... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.RunSequentially;
import com.github.havarunner.exception.UnsupportedAnnotationException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import static com.github.havarunner.TestHelper.run... | package com.github.havarunner.validations;
public class UnsupportedJUnitAnnotationsTest {
@Test
public void HavaRunner_gives_a_helpful_error_message_a_parallel_test_uses_an_annotation_that_may_only_be_used_with_sequential_tests() {
HavaRunner havaRunner = new HavaRunner(ParallelTestWithBefore.class)... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static Failure runAndRecordFailure(HavaRunner havaRunner) {
// ... | run(new HavaRunner(SequentialTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/TestInAbstractSuperclass.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import org.junit.Test;
import static com.github.havarunner.TestHelper.run;
import static org.junit.Assert.assertTrue; | package com.github.havarunner;
public class TestInAbstractSuperclass {
static boolean parentTestRun;
@Test
public void HavaRunner_should_discover_tests_in_abstract_super_class() { | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/TestInAbstractSuperclass.java
import org.junit.Test;
import static com.github.havarunner.TestHe... | run(new HavaRunner(Child.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/beforeafter/AfterAllTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.AfterAll;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import java.util.Collection;
import java.util.... | package com.github.havarunner.beforeafter;
@RunWith(Enclosed.class)
public class AfterAllTest {
public static class when_the_test_class_contains_multiple_tests {
static Long test1MethodCall;
static Long test2MethodCall;
static List<Long> afterMethodCalls = new CopyOnWriteArrayList<>();
... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(... | run(new HavaRunner(MultipleTests.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/beforeafter/AfterAllTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(... | import com.github.havarunner.HavaRunner;
import com.github.havarunner.annotation.AfterAll;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import java.util.Collection;
import java.util.... | assertEquals(1, afterMethodCalls.size());
}
static class MultipleTests {
@Test
void test_1() {
assertNull(test1MethodCall);
test1MethodCall = System.currentTimeMillis();
}
@Test
void test_2() {
... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
//
// Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void runAndIgnoreErrors(HavaRunner havaRunner) {
// run(... | runAndIgnoreErrors(new HavaRunner(AfterFailingTest.class)); |
havarunner/havarunner | src/test/java/com/github/havarunner/SameInstanceTest.java | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
| import com.github.havarunner.HavaRunner;
import com.google.common.collect.Lists;
import com.github.havarunner.annotation.Scenarios;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
im... | package com.github.havarunner;
@RunWith(Enclosed.class)
public class SameInstanceTest {
public static class when_the_test_has_multiple_scenarios {
static List<Object> instanceWhenMars = Collections.synchronizedList(Lists.newArrayList());
static List<Object> instanceWhenVenus = Collections.sync... | // Path: src/test/java/com/github/havarunner/TestHelper.java
// public static void run(HavaRunner havaRunner, RunNotifier runNotifier) {
// havaRunner.run(runNotifier);
// }
// Path: src/test/java/com/github/havarunner/SameInstanceTest.java
import com.github.havarunner.HavaRunner;
import com.google.common.collect... | run(new HavaRunner(TestWithScenarios.class)); |
dmitriid/cali | src/main/java/com/dmitriid/cali/db/Neo4JConnector.java | // Path: src/main/java/com/dmitriid/cali/CommandLine.java
// public class CommandLine {
// private HashMap<String, String> _options = new HashMap<String, String>();
//
// private Pattern _optionMatch = Pattern.compile("^[-]{1,2}(\\w+)"); // handle -o and --opt and -opt
//
// public CommandLine(String[] a... | import com.dmitriid.cali.CommandLine;
import com.tinkerpop.blueprints.pgm.Vertex;
import com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph;
import com.tinkerpop.gremlin.compiler.context.GremlinScriptContext; | //------------------------------------------------------------------------------
// Copyright (c) 2010. Dmitrii Dimandt <dmitrii@dmitriid.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of th... | // Path: src/main/java/com/dmitriid/cali/CommandLine.java
// public class CommandLine {
// private HashMap<String, String> _options = new HashMap<String, String>();
//
// private Pattern _optionMatch = Pattern.compile("^[-]{1,2}(\\w+)"); // handle -o and --opt and -opt
//
// public CommandLine(String[] a... | CommandLine line = new CommandLine(args); |
dmitriid/cali | src/main/java/com/dmitriid/cali/db/OrientDBConnector.java | // Path: src/main/java/com/dmitriid/cali/CommandLine.java
// public class CommandLine {
// private HashMap<String, String> _options = new HashMap<String, String>();
//
// private Pattern _optionMatch = Pattern.compile("^[-]{1,2}(\\w+)"); // handle -o and --opt and -opt
//
// public CommandLine(String[] a... | import com.dmitriid.cali.CommandLine;
import com.dmitriid.cali.converters.ORecordIdConverter;
import com.tinkerpop.blueprints.pgm.impls.orientdb.OrientGraph;
import com.tinkerpop.gremlin.compiler.context.GremlinScriptContext; | //------------------------------------------------------------------------------
// Copyright (c) 2010. Dmitrii Dimandt <dmitrii@dmitriid.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of th... | // Path: src/main/java/com/dmitriid/cali/CommandLine.java
// public class CommandLine {
// private HashMap<String, String> _options = new HashMap<String, String>();
//
// private Pattern _optionMatch = Pattern.compile("^[-]{1,2}(\\w+)"); // handle -o and --opt and -opt
//
// public CommandLine(String[] a... | CommandLine line = new CommandLine(args); |
dmitriid/cali | src/main/java/com/dmitriid/cali/db/OrientDBConnector.java | // Path: src/main/java/com/dmitriid/cali/CommandLine.java
// public class CommandLine {
// private HashMap<String, String> _options = new HashMap<String, String>();
//
// private Pattern _optionMatch = Pattern.compile("^[-]{1,2}(\\w+)"); // handle -o and --opt and -opt
//
// public CommandLine(String[] a... | import com.dmitriid.cali.CommandLine;
import com.dmitriid.cali.converters.ORecordIdConverter;
import com.tinkerpop.blueprints.pgm.impls.orientdb.OrientGraph;
import com.tinkerpop.gremlin.compiler.context.GremlinScriptContext; | //------------------------------------------------------------------------------
// Copyright (c) 2010. Dmitrii Dimandt <dmitrii@dmitriid.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of th... | // Path: src/main/java/com/dmitriid/cali/CommandLine.java
// public class CommandLine {
// private HashMap<String, String> _options = new HashMap<String, String>();
//
// private Pattern _optionMatch = Pattern.compile("^[-]{1,2}(\\w+)"); // handle -o and --opt and -opt
//
// public CommandLine(String[] a... | _cm.register(new ORecordIdConverter()); |
dmitriid/cali | src/main/java/com/dmitriid/cali/db/DBConnector.java | // Path: src/main/java/com/dmitriid/ji/ConversionManager.java
// public class ConversionManager {
//
// private final Map<Class<?>, AbstractErlangJavaConverter> converters = new HashMap<Class<?>, AbstractErlangJavaConverter>();
//
// @SuppressWarnings("unchecked")
// public <I, O> O convert(I in) throws I... | import com.dmitriid.cali.converters.*;
import com.dmitriid.ji.ConversionManager;
import com.ericsson.otp.erlang.*;
import com.tinkerpop.blueprints.pgm.Element;
import com.tinkerpop.blueprints.pgm.Graph;
import com.tinkerpop.blueprints.pgm.Vertex;
import com.tinkerpop.gremlin.GremlinScriptEngine;
import com.tinkerpop.gr... | //------------------------------------------------------------------------------
// Copyright (c) 2010. Dmitrii Dimandt <dmitrii@dmitriid.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of th... | // Path: src/main/java/com/dmitriid/ji/ConversionManager.java
// public class ConversionManager {
//
// private final Map<Class<?>, AbstractErlangJavaConverter> converters = new HashMap<Class<?>, AbstractErlangJavaConverter>();
//
// @SuppressWarnings("unchecked")
// public <I, O> O convert(I in) throws I... | protected ConversionManager _cm = null; |
dmitriid/cali | src/main/java/com/dmitriid/cali/converters/ElementObject.java | // Path: src/main/java/com/dmitriid/cali/db/Tokens.java
// public class Tokens {
//
// public static final String JSON_APPLICATION = "json/application";
//
// public static final String _ID = "_id";
// public static final String ID = "id";
// public static final String DIRECTION = "direction";
// ... | import com.dmitriid.cali.db.Tokens;
import com.tinkerpop.blueprints.pgm.Edge;
import com.tinkerpop.blueprints.pgm.Element;
import com.tinkerpop.blueprints.pgm.Vertex;
import org.neo4j.helpers.Pair;
import java.util.ArrayList;
import java.util.Set; |
public Object get(){
if(_o instanceof Element){
return get_properties();
}
return _o;
}
Object get_properties(){
ArrayList properties = new ArrayList();
if(null == _properties) {
if(_o instanceof Edge){
Edge edge = (Edge) _o;... | // Path: src/main/java/com/dmitriid/cali/db/Tokens.java
// public class Tokens {
//
// public static final String JSON_APPLICATION = "json/application";
//
// public static final String _ID = "_id";
// public static final String ID = "id";
// public static final String DIRECTION = "direction";
// ... | if(key.equals(Tokens._ID)) { |
philliphsu/BottomSheetPickers | bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DayPickerViewAnimator.java | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/PagingDayPickerView.java
// static final int DAY_PICKER_INDEX = 0;
//
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/PagingDayPickerView.java
// static final int MONTH_PICKER_INDEX = 1;
| import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ViewAnimator;
import com.philliphsu.bottomsheetpickers.R;
import static com.philliphsu.bottomsheetpickers.date.PagingDayPickerView.DAY_PICKER_IND... | package com.philliphsu.bottomsheetpickers.date;
/**
* Parent of {@link PagingDayPickerView} and {@link MonthPickerView}.
*/
public final class DayPickerViewAnimator extends ViewAnimator {
private final Animation mDayPickerInAnimation;
private final Animation mDayPickerOutAnimation;
private final Anim... | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/PagingDayPickerView.java
// static final int DAY_PICKER_INDEX = 0;
//
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/PagingDayPickerView.java
// static final int MONTH_PICKER_INDEX = 1;
// Path: bottoms... | case DAY_PICKER_INDEX: |
philliphsu/BottomSheetPickers | bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DayPickerViewAnimator.java | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/PagingDayPickerView.java
// static final int DAY_PICKER_INDEX = 0;
//
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/PagingDayPickerView.java
// static final int MONTH_PICKER_INDEX = 1;
| import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ViewAnimator;
import com.philliphsu.bottomsheetpickers.R;
import static com.philliphsu.bottomsheetpickers.date.PagingDayPickerView.DAY_PICKER_IND... | package com.philliphsu.bottomsheetpickers.date;
/**
* Parent of {@link PagingDayPickerView} and {@link MonthPickerView}.
*/
public final class DayPickerViewAnimator extends ViewAnimator {
private final Animation mDayPickerInAnimation;
private final Animation mDayPickerOutAnimation;
private final Anim... | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/PagingDayPickerView.java
// static final int DAY_PICKER_INDEX = 0;
//
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/PagingDayPickerView.java
// static final int MONTH_PICKER_INDEX = 1;
// Path: bottoms... | case MONTH_PICKER_INDEX: |
philliphsu/BottomSheetPickers | bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/NumberPadTimePickerDialogViewDelegate.java | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
// if (t == null) {
// throw new NullPointerException();
// }
// return t;
// }
| import android.app.TimePickerDialog.OnTimeSetListener;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TimePicker;
import static com.ph... | package com.philliphsu.bottomsheetpickers.time.numberpad;
/**
* Handles the {@link INumberPadTimePicker.DialogView DialogView} responsibilities of a number pad time picker dialog.
*/
final class NumberPadTimePickerDialogViewDelegate implements INumberPadTimePicker.DialogView {
private static final String KEY_D... | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
// if (t == null) {
// throw new NullPointerException();
// }
// return t;
// }
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpick... | mDelegator = checkNotNull(delegator); |
philliphsu/BottomSheetPickers | bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DatePickerController.java | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DatePickerDialog.java
// public interface OnDateChangedListener {
//
// public void onDateChanged();
// }
| import com.philliphsu.bottomsheetpickers.date.DatePickerDialog.OnDateChangedListener;
import java.util.Calendar; | /*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DatePickerDialog.java
// public interface OnDateChangedListener {
//
// public void onDateChanged();
// }
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/date/DatePickerController.java
import com.philliph... | void registerOnDateChangedListener(OnDateChangedListener listener); |
philliphsu/BottomSheetPickers | bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/NumberPadTimePickerPresenter.java | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
// if (t == null) {
// throw new NullPointerException();
// }
// return t;
// }
//
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpi... | import android.support.annotation.NonNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.Preconditions.checkNotNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.AM;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.HRS_24;
import static com.philliphsu... | package com.philliphsu.bottomsheetpickers.time.numberpad;
class NumberPadTimePickerPresenter implements
INumberPadTimePicker.Presenter,
DigitwiseTimeModel.OnInputChangeListener {
private static final int MAX_CHARS = 5; // 4 digits + time separator
private final StringBuilder mFormattedInput... | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
// if (t == null) {
// throw new NullPointerException();
// }
// return t;
// }
//
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpi... | mView = checkNotNull(view); |
philliphsu/BottomSheetPickers | bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/NumberPadTimePickerPresenter.java | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
// if (t == null) {
// throw new NullPointerException();
// }
// return t;
// }
//
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpi... | import android.support.annotation.NonNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.Preconditions.checkNotNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.AM;
import static com.philliphsu.bottomsheetpickers.time.numberpad.AmPmState.HRS_24;
import static com.philliphsu... | updateAltKeysStates();
updateBackspaceState();
// TOneverDO: Call before both updateAltKeysStates() and updateNumberKeysStates().
updateHeaderDisplayFocus();
}
private void updateHeaderDisplayFocus() {
final boolean showHeaderDisplayFocused = !(mAllNumberKeysDisabled && ... | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
// if (t == null) {
// throw new NullPointerException();
// }
// return t;
// }
//
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpi... | } else if (count() == 3 || count() == MAX_DIGITS) { |
philliphsu/BottomSheetPickers | bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/NumberPadTimePickerDialogThemer.java | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
// if (t == null) {
// throw new NullPointerException();
// }
// return t;
// }
| import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import static com.philliphsu.bottomsheetpickers.time.numberpad.Preconditions.checkNotNull; | package com.philliphsu.bottomsheetpickers.time.numberpad;
/**
* Interface through which a {@link NumberPadTimePicker} contained in
* a {@link BottomSheetNumberPadTimePickerDialog} can have its colors customized.
*/
class NumberPadTimePickerDialogThemer implements NumberPadTimePickerThemer {
private final Numb... | // Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpickers/time/numberpad/Preconditions.java
// static <T> T checkNotNull(T t) {
// if (t == null) {
// throw new NullPointerException();
// }
// return t;
// }
// Path: bottomsheetpickers/src/main/java/com/philliphsu/bottomsheetpick... | mTimePickerComponent = checkNotNull(timePickerComponent); |
fsmk/MCA-VTU-Lab-Manual | Sem3/Java_Prog_Lab/7/org/fsmk/mca/example7/client/Client.java | // Path: Sem3/Java_Prog_Lab/7/org/fsmk/mca/example7/shape/IShape.java
// public interface IShape
// {
//
// public double calcArea();
//
// public double calcPerimeter();
// public String getName();
//
// }
//
// Path: Sem3/Java_Prog_Lab/7/org/fsmk/mca/example7/shape/Circle.java
// public class Circl... | import java.util.Scanner;
import org.fsmk.mca.example7.shape.IShape;
import org.fsmk.mca.example7.shape.Circle;
import org.fsmk.mca.example7.shape.Rectangle;
import org.fsmk.mca.example7.shape.Square;
import org.fsmk.mca.example7.shape.Triangle;
| package org.fsmk.mca.example7.client;
public class Client
{
private static Scanner scanner;
public static void main(String[] args)
{
while(true)
{
// Initialize Scanner to get inputs from the console/STDIN
scanner = new Scanner(System.in);
System.out.println("Welcome to the... | // Path: Sem3/Java_Prog_Lab/7/org/fsmk/mca/example7/shape/IShape.java
// public interface IShape
// {
//
// public double calcArea();
//
// public double calcPerimeter();
// public String getName();
//
// }
//
// Path: Sem3/Java_Prog_Lab/7/org/fsmk/mca/example7/shape/Circle.java
// public class Circl... | Square square = new Square(side);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.