@Test @Ignore public void writeSampleFiles() throws IOException { final float[] vod = Utils.getExampleData(); try (FileOutputStream fos = new FileOutputStream(createFile("unconditioned-floats"))) { writeUnconditioned(vod, fos); } try (FileOutputStream fos = new FileOutputStream(createFile("conditioned-floats"))) { Conditioner.writeFloat(vod, fos); } try (FileOutputStream fos = new FileOutputStream(createFile("unconditioned-doubles"))) { writeUnconditioned(Utils.floatsToDoubles(vod), fos); } try (FileOutputStream fos = new FileOutputStream(createFile("conditioned-doubles"))) { Conditioner.writeDouble(Utils.floatsToDoubles(vod), fos); } }
@Ignore @Test public void run() { WebAuthClient webAuthClient = new WebAuthClient("https://yourserver/webauth/user", logger); try { webAuthClient.authenticate("99-YTd1bnUxcTlxZW1hcA==", ""); } catch (Exception e) { e.printStackTrace(); } }
@Test @Ignore public void testAllocateTime() { int pageSize = 1024 * 1024 * 10; int allocTimes = 20480; int size = 4096; DirectByteBufferPool pool = new DirectByteBufferPool(pageSize, (short) 256, (short) 8); ByteBuffer[] byteBuffer = new ByteBuffer[allocTimes]; long start = System.currentTimeMillis(); for (int i = 0; i < allocTimes; i++) { byteBuffer[i] = pool.allocate(size); } long used = (System.currentTimeMillis() - start); System.out.println("total used time " + used + " avg speed " + allocTimes / used); }
@Ignore public void testIsDocumentBelongedToThisUserWhenAuthenticationSucceds() { ClinicalDocumentDto clinicalDocumentDto = mock(ClinicalDocumentDto.class); ClinicalDocumentDto patientsClinicalDocumentDto = mock(ClinicalDocumentDto.class); Patient patient = mock(Patient.class); List<ClinicalDocumentDto> clinicaldocumentDtos = Arrays .asList(patientsClinicalDocumentDto); doReturn("1").when(clinicalDocumentDto).getId(); doReturn("1").when(patientsClinicalDocumentDto).getId(); doReturn(patient).when(patientRepository).findByUsername("Owner"); doReturn(clinicaldocumentDtos).when(sut).findDtoByPatient(patient); assertTrue(sut.isDocumentBelongsToThisUser("Owner", clinicalDocumentDto)); }
@Ignore public void testIsDocumentBelongedToThisUserWhenAuthenticationFailed() { ClinicalDocumentDto clinicalDocumentDto = mock(ClinicalDocumentDto.class); ClinicalDocumentDto patientsClinicalDocumentDto = mock(ClinicalDocumentDto.class); Patient patient = mock(Patient.class); List<ClinicalDocumentDto> clinicaldocumentDtos = Arrays .asList(patientsClinicalDocumentDto); doReturn("1").when(clinicalDocumentDto).getId(); doReturn("2").when(patientsClinicalDocumentDto).getId(); doReturn(patient).when(patientRepository).findByUsername("Owner"); doReturn(clinicaldocumentDtos).when(sut).findDtoByPatient(patient); assertFalse(sut.isDocumentBelongsToThisUser("Owner", clinicalDocumentDto)); }
/** * WRONG * * @param root * @return */ @Ignore public boolean isBalanced(TreeNode root) { if (root == null) return true; if (root.left == null && root.right == null) return true; if (root.left != null && root.right == null) { return root.left.left == null && root.left.right == null; } if (root.left == null && root.right != null) { return root.right.left == null && root.right.right == null; } return isBalanced(root.left) && isBalanced(root.right); }
@Ignore @Test public void very_big_tree_test() throws URISyntaxException, IOException { assertEquals(1074, TreeParser.parseTree(Paths.get(ClassLoader.getSystemResource("VeryBigTree.txt").toURI())).computeMaxSum()); }
@Ignore public void test100Tournaments() { List<Person> persons = getPersons(); for (int i = 0; i < 100; i++) { testFullTournament(persons); System.out.println("round: " + i); } }
@Ignore // @Test public void testMakePersistentReadOnly() { String gewichtungsString = "11,10,09,08,07,06,05,04,03,02,01"; // Unrealistisch, aber gut zu prüfen // Kombinationsberechnung kombinationsberechnung = Kombinationsberechnung.getInstance(); // kombinationsberechnung.setHatAbsteigendeIntervallinformationen(true); AesthetischeGewichtung testGewichtung = new AesthetischeGewichtung(gewichtungsString, new Kombinationsberechnung()); Ton basisTon = new Ton(Oktavlage.GROSZE, Name.C); Ton ton1 = Tonumfang.getTon(Oktavlage.GROSZE, Name.C); // ton1.setAbstandBasisTonDurchAbstandZumEingestrichenenC(basisTon); ton1.setId(10); Ton ton2 = Tonumfang.getTon(Oktavlage.GROSZE, Name.G); // ton2.setAbstandBasisTonDurchAbstandZumEingestrichenenC(basisTon); ton2.setId(20); Ton ton3 = Tonumfang.getTon(Oktavlage.KLEINE, Name.D); // ton3.setAbstandBasisTonDurchAbstandZumEingestrichenenC(basisTon); ton3.setId(30); List<Ton> tonList = new ArrayList<Ton>(); tonList.add(ton1); tonList.add(ton2); tonList.add(ton3); Akkord testAkkord = new Akkord(); testAkkord.setTonList(tonList); assertNotNull(akkordDao); List<Akkord> chords = (List<Akkord>) akkordDao.findAll(); assertTrue("Akkord mit der genannten Id sollte noch nicht vorhanden sein.", null == chords); testAkkord.setId(Integer.valueOf(103)); testAkkord.setAnzahlToene(3); // testAkkord.setKlangschaerfe(AkkordkombinationenBerechnungServiceHelper.getKlangschaerfe(tonList, testGewichtung)); // testAkkord.set akkordDao.makePersistentReadOnly(testAkkord, this.entityManager); entityManager.unwrap(org.hibernate.Session.class).flush(); assertFalse(entityManager.unwrap(org.hibernate.Session.class).isDirty()); testAkkord.setBasisAkkordId(2); akkordDao.save(testAkkord); entityManager.unwrap(org.hibernate.Session.class).flush(); assertFalse("Trotz Aenderung (auszer bei der Id) sollte Hibernate das Entity-Objekt vom Dirty-Checking ausgeschlossen haben.", entityManager.unwrap(org.hibernate.Session.class).isDirty()); }
@Test @Ignore public void copyDir() { String source = "e:\\download\\_testaa"; String target = "\\\\NAS\\emul\\image\\Apple2\\_testaa"; FileUtil.copy( source, target, true ); }
@Test @Ignore public void testDelete() { }
@Test @Ignore public void testCancelBeforeConversion() throws ExecutionException, InterruptedException { // completable futures can not be canceled }
@Ignore @Test public void shouldValidateRailwaysOperatingSinceDateAsPastDate() {}
@Ignore @Test public void shouldValidateRailwaysOperatingUntilDateAsPastDate() {}
@Ignore @Test public void testDeleteNode() throws Exception { /* 6 3 9 1 5 7 10 2 4 8 */ TreeNode rootNode = new TreeNode(6); TreeNode node1 = new TreeNode(3); TreeNode node2 = new TreeNode(9); TreeNode node3 = new TreeNode(1); TreeNode node4 = new TreeNode(5); TreeNode node5 = new TreeNode(7); TreeNode node6 = new TreeNode(10); TreeNode node7 = new TreeNode(2); TreeNode node8 = new TreeNode(4); TreeNode node9 = new TreeNode(8); rootNode.setLeft(node1); rootNode.setRight(node2); node1.setParent(rootNode); node2.setParent(rootNode); node1.setLeft(node3); node1.setRight(node4); node3.setParent(node1); node4.setParent(node1); node2.setLeft(node5); node2.setRight(node6); node5.setParent(node2); node6.setParent(node2); node3.setRight(node7); node7.setParent(node3); node4.setLeft(node8); node8.setParent(node4); node5.setRight(node9); node9.setParent(node5); BSTNodeDeletion nodeDeletion = new BSTNodeDeletion(); TreeNode newRootNode = nodeDeletion.deleteNode(rootNode, node1); //InOrderTraversal.inOrder(newRootNode); }