Package com.hp.jena.rules.ast.tests

Source Code of com.hp.jena.rules.ast.tests.TestUnless

/*
  (c) Copyright 2008, 2009 Hewlett-Packard Development Company, LP
   All rights reserved.
   $Id$
*/

package com.hp.jena.rules.ast.tests;

import static org.junit.Assert.*;

import org.junit.Test;

import com.hp.jena.rules.ast.*;
import com.hp.jena.rules.ast.tests.TestElement.VisitElement;

public class TestUnless
    {
    @Test public void ensureUnlessExposesArguments()
        {
        Element e = new Elements();
        Unless u = new Unless( "myName", e );
        assertSame( e, u.getElement() );
        assertEquals( "myName", u.getName() );
        }

    static class VisitUnless extends TestElement.VisitElement
        {
        @Override public void visitUnless( Unless u )
            { seen.set( u ); }
        }
   
    @Test public void ensureUnlessVisitInvokesVisitUnless()
        {
        Unless u = new Unless( "theName", new Elements() );
        VisitElement v  = new VisitUnless();
        u.visit( v );
        assertSame( u, v.seen.get() );
        }
    }
TOP

Related Classes of com.hp.jena.rules.ast.tests.TestUnless

TOP
Copyright © 2018 www.massapi.com. 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.