Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package me.aatma.languagetologic; import java.util.Arrays; import java.util.List; import java.util.Set; import me.aatma.languagetologic.graph.semantics.CleanAndCombineGraph; import me.aatma.library.sapi.SCollection; import me.aatma.library.sapi.SObject; import org.apache.commons.collections4.iterators.PermutationIterator; import org.junit.After; import org.junit.AfterClass; import static org.junit.Assert.*; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /** * * @author vijay */ public class CleanAndCombineGraphTest { public CleanAndCombineGraphTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } /** * Test of cleanGraph method, of class CleanAndCombineGraph. */ @Test public void testCleanGraph() throws Exception { System.out.println("cleanGraph"); CleanAndCombineGraph instance = null; instance.cleanGraph(); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } /** * Test of getNextMatchingSemanticPossibilityAsObject method, of class CleanAndCombineGraph. */ @Test public void testGetNextMatchingSemanticPossibilityAsObject() { System.out.println("getNextMatchingSemanticPossibilityAsObject"); Object expResult = null; // Object result = CleanAndCombineGraph.getNextMatchingSemanticPossibilityAsObject(null); //assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } @Test public void testIsaGenls() throws Exception { // SCollection c = SomethingExistingImpl.getClassType(); // System.out.println("is it?" + KBCollectionImpl.get("(LiquidFn Water)").isGeneralizationOf(c)); // SIndividual i = SIndividualImpl.get("VijayRaj"); // System.out.println("is it?" + i.isInstanceOf(c)); // SentenceImpl s = new SentenceImpl(SPredicateImpl.get("doneBy"), SIndividualImpl.get("AttackByComputerOperation-WnErDFED8C"), KBIndividualImpl.get("VijayRaj")); // System.out.println("is it wff? " + s.isAssertible(Constants.uvMt())); } /** * Test of getAllIsaMatchingSemanticPossbilities method, of class CleanAndCombineGraph. */ @Test public void testGetAllIsaMatchingSemanticPossbilities_List_KBCollection() { System.out.println("getAllIsaMatchingSemanticPossbilities"); List<? extends Object> semPossibilities = null; SCollection isa = null; List<SObject> expResult = null; List<SObject> result = CleanAndCombineGraph.getAllIsaMatchingSemanticPossbilities(semPossibilities, isa); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } /** * Test of getAllIsaMatchingSemanticPossbilities method, of class CleanAndCombineGraph. */ @Test public void testGetAllIsaMatchingSemanticPossbilities_List_Set() { System.out.println("getAllIsaMatchingSemanticPossbilities"); List<? extends Object> semPossibilities = null; Set<SCollection> isas = null; List<SObject> expResult = null; List<SObject> result = CleanAndCombineGraph.getAllIsaMatchingSemanticPossbilities(semPossibilities, isas); assertEquals(expResult, result); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } @Test public void testListPermutation() { List<Integer> li = Arrays.asList(1, 2, 3); PermutationIterator<Integer> pi = new PermutationIterator<Integer>(li); int i = 0; while (pi.hasNext()) { List<Integer> li2 = pi.next(); System.out.println("Iteration: " + i + " List: " + li2); i++; } } }