<commit_before>/**
 * 
 */
package petrinet.snet.test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import exception.PNValidationException;

import petrinet.snet.DeclassificationTransition;
import petrinet.snet.SNet;

/**
 * @author boehr
 *
 */
public class DeclassificationTransitionTest {

	//The variable is filled during start up
	private SNet dSNet = null;
	private DeclassificationTransition td = null;
	
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		
		dSNet = SNetTestUtil.createSimpleSnetWithDeclassification();
		td = dSNet.getDeclassificationTransitions().iterator().next();
	}

//	/**
//	 * @throws java.lang.Exception
//	 */
//	@After
//	public void tearDown() throws Exception {
//	}
//
	/**
	 * Test method for {@link petrinet.snet.DeclassificationTransition#checkValidity()}.
	 * Check whether a valid declassifcation transition is recongnized as such.
	 */
	@Test
	public void testCheckValidity() {
		
		try {
			
			System.out.println(td.getConsumedAttributes());
			System.out.println(td.getProducedAttributes());
			
			
			
			td.checkValidity();
		} catch (PNValidationException e) {
			
			e.printStackTrace();
			fail("A valid declassification transition is reported to be invalid.");
		}
		
	}

	/**
	 * Test method for {@link petrinet.snet.DeclassificationTransition#isDeclassificator()}.
	 */
	@Test
	public void testIsDeclassificator() {
		assertTrue(td.isDeclassificator());
	}

//	/**
//	 * Test method for {@link petrinet.snet.DeclassificationTransition#DeclassificationTransition(petrinet.snet.SNet, java.lang.String, java.lang.String, boolean)}.<commit_msg>Bug in checkVlidity of DeclassificationTransition fixed ...<commit_after>/**
 * 
 */
package petrinet.snet.test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import exception.PNValidationException;

import petrinet.snet.DeclassificationTransition;
import petrinet.snet.SNet;

/**
 * @author boehr
 *
 */
public class DeclassificationTransitionTest {

	//The variable is filled during start up
	private SNet dSNet = null;
	private DeclassificationTransition td = null;
	
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		
		dSNet = SNetTestUtil.createSimpleSnetWithDeclassification();
		td = dSNet.getDeclassificationTransitions().iterator().next();
	}

//	/**
//	 * @throws java.lang.Exception
//	 */
//	@After
//	public void tearDown() throws Exception {
//	}
//
	/**
	 * Test method for {@link petrinet.snet.DeclassificationTransition#checkValidity()}.
	 * Check whether a valid declassifcation transition is recongnized as such.
	 */
	@Test
	public void testCheckValidity() {
		
		try {
			
			System.out.println(td.getConsumedAttributes());
			System.out.println(td.getProducedAttributes());
			
			System.out.println(td.getConsumedTokens("red"));
			System.out.println(td.getProducedTokens("yellow"));
			
			
			td.checkValidity();
		} catch (PNValidationException e) {
			
			e.printStackTrace();
			fail("A valid declassification transition is reported to be invalid.");
		}
		
	}

	/**
	 * Test method for {@link petrinet.snet.DeclassificationTransition#isDeclassificator()}.
	 */
	@Test
	public void testIsDeclassificator() {
		assertTrue(td.isDeclassificator());
	}

//	/**
//	 * Test method for {@link petrinet.snet.DeclassificationTransition#DeclassificationTransition(petrinet.snet.SNet, java.lang.String, java.lang.String, boolean)}.
{'fraction_non_alphanumeric': 0.12847905538375035, 'fraction_numerical': 0.0, 'mean_word_length': 3.96927374301676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3137278', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1086, 'n_words': 231}