Package org.openbel.framework.common.model

Examples of org.openbel.framework.common.model.Term


    @Test(expected = SemanticWarning.class)
    public void testMissingFunctionArgumentFailure() throws SemanticWarning {
        err.println("testMissingFunctionArgumentFailure");
        FunctionEnum funcEnum = FunctionEnum.REACTION;
        Term t = new Term(funcEnum);

        subject.checkTerm(t);
        fail("expected semantic failure");
    }
View Full Code Here


    @Test
    public void testFunctionOnlyArguments() {
        err.println("testFunctionOnlyArguments");
        FunctionEnum funcEnum = FunctionEnum.REACTION;
        List<BELObject> args = new ArrayList<BELObject>();
        args.add(new Term(FunctionEnum.REACTANTS));
        args.add(new Term(FunctionEnum.PRODUCTS));
        Term t = new Term(funcEnum, args);

        try {
            subject.checkTerm(t);
        } catch (SemanticWarning se) {
            fail("unexpected semantic failure: " + se.getUserFacingMessage());
View Full Code Here

        err.println("testEncodingArgument");
        FunctionEnum funcEnum = FunctionEnum.ABUNDANCE;
        List<BELObject> args = new ArrayList<BELObject>();
        Parameter abundance = getInstance().createParameter(null, "value");
        args.add(abundance);
        Term t = new Term(funcEnum, args);

        try {
            subject.checkParameterizedTerm(t);
        } catch (SemanticWarning se) {
            fail("unexpected semantic failure: " + se.getUserFacingMessage());
View Full Code Here

    @Test
    public void testFunctionArgument() {
        err.println("testFunctionArgument");
        FunctionEnum funcEnum = FunctionEnum.CATALYTIC_ACTIVITY;
        List<BELObject> args = new ArrayList<BELObject>();
        Term complexAbundance = new Term(FunctionEnum.COMPLEX_ABUNDANCE);
        args.add(complexAbundance);
        Term t = new Term(funcEnum, args);

        try {
            subject.checkTerm(t);
        } catch (SemanticWarning se) {
            fail("unexpected semantic failure: " + se.getUserFacingMessage());
View Full Code Here

        err.println("testComplexArgument");
        FunctionEnum funcEnum = FunctionEnum.COMPLEX_ABUNDANCE;
        List<BELObject> args = new ArrayList<BELObject>();
        Parameter parameter = getInstance().createParameter(null, "value");
        args.add(parameter);
        Term t = new Term(funcEnum, args);

        try {
            subject.checkParameterizedTerm(t);
        } catch (SemanticWarning se) {
            fail("unexpected semantic failure: " + se.getUserFacingMessage());
        }

        args.clear();

        int abundances = random.nextInt(10) + 1;
        for (int i = 0; i < abundances; i++) {
            FunctionEnum fe = randomFunctionEnum();
            while (fe.getReturnType() != ReturnType.ABUNDANCE) {
                fe = randomFunctionEnum();
            }
            args.add(new Term(fe));
        }
        t = new Term(funcEnum, args);

        try {
            subject.checkParameterizedTerm(t);
        } catch (SemanticWarning se) {
            fail("unexpected semantic failure: " + se.getUserFacingMessage());
View Full Code Here

        Parameter g1 = getInstance().createParameter(null, "value1");
        Parameter g2 = getInstance().createParameter(null, "value2");
        args.add(g1);
        args.add(g2);

        Term t = new Term(funcEnum, args);

        subject.checkParameterizedTerm(t);
        fail("expected semantic failure");
    }
View Full Code Here

        Parameter abundance1 = getInstance().createParameter(null, "value1");
        Parameter abundance2 = getInstance().createParameter(null, "value2");
        args.add(abundance1);
        args.add(abundance2);

        Term t = new Term(funcEnum, args);
        subject.checkParameterizedTerm(t);
        fail("expected semantic failure");
    }
View Full Code Here

    public void testTooFewArgumentsFailure() throws SemanticWarning {
        err.println("testTooFewArgumentsFailure");
        FunctionEnum funcEnum = FunctionEnum.TRANSLOCATION;
        List<BELObject> args = new ArrayList<BELObject>();

        Term abundance = new Term(FunctionEnum.COMPOSITE_ABUNDANCE);
        args.add(abundance);
        args.add(getInstance().createParameter(null, "value1"));

        Term t = new Term(funcEnum, args);
        subject.checkParameterizedTerm(t);
        fail("expected semantic failure");
    }
View Full Code Here

        err.println("testTicket106_1");
        FunctionEnum funcEnum = FunctionEnum.PROTEIN_ABUNDANCE;
        List<BELObject> args = new ArrayList<BELObject>();

        Parameter arg1 = getInstance().createParameter(null, "value1");
        Term arg2 = new Term(FunctionEnum.SUBSTITUTION);
        Term arg3 = new Term(FunctionEnum.SUBSTITUTION);
        Term arg4 = new Term(FunctionEnum.SUBSTITUTION);
        args.addAll(asList(new BELObject[] { arg1, arg2, arg3, arg4 }));

        Term t = new Term(funcEnum, args);
        subject.checkParameterizedTerm(t);
        fail("expected semantic failure");
    }
View Full Code Here

    public void testTicket106_2() throws SemanticWarning {
        err.println("testTicket106_2");
        FunctionEnum funcEnum = FunctionEnum.COMPLEX_ABUNDANCE;
        List<BELObject> args = new ArrayList<BELObject>();

        Term arg1 = new Term(FunctionEnum.ABUNDANCE);
        Term arg2 = new Term(FunctionEnum.BIOLOGICAL_PROCESS);
        args.addAll(asList(new BELObject[] { arg1, arg2 }));

        Term t = new Term(funcEnum, args);
        subject.checkParameterizedTerm(t);
        fail("expected semantic failure");
    }
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.model.Term

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.