Search in sources :

Example 36 with Ignore

use of org.junit.Ignore in project deeplearning4j by deeplearning4j.

the class PerformanceTests method testWord2VecCBOWBig.

@Ignore
@Test
public void testWord2VecCBOWBig() throws Exception {
    SentenceIterator iter = new BasicLineIterator("/home/raver119/Downloads/corpus/namuwiki_raw.txt");
    //iter = new BasicLineIterator("/home/raver119/Downloads/corpus/ru_sentences.txt");
    //SentenceIterator iter = new BasicLineIterator("/ext/DATASETS/ru/Socials/ru_sentences.txt");
    TokenizerFactory t = new KoreanTokenizerFactory();
    //t = new DefaultTokenizerFactory();
    //t.setTokenPreProcessor(new CommonPreprocessor());
    Word2Vec vec = new Word2Vec.Builder().minWordFrequency(1).iterations(5).learningRate(0.025).layerSize(150).seed(42).sampling(0).negativeSample(0).useHierarchicSoftmax(true).windowSize(5).modelUtils(new BasicModelUtils<VocabWord>()).useAdaGrad(false).iterate(iter).workers(8).allowParallelTokenization(true).tokenizerFactory(t).elementsLearningAlgorithm(new CBOW<VocabWord>()).build();
    long time1 = System.currentTimeMillis();
    vec.fit();
    long time2 = System.currentTimeMillis();
    log.info("Total execution time: {}", (time2 - time1));
}
Also used : BasicLineIterator(org.deeplearning4j.text.sentenceiterator.BasicLineIterator) KoreanTokenizerFactory(org.deeplearning4j.text.tokenization.tokenizerfactory.KoreanTokenizerFactory) TokenizerFactory(org.deeplearning4j.text.tokenization.tokenizerfactory.TokenizerFactory) DefaultTokenizerFactory(org.deeplearning4j.text.tokenization.tokenizerfactory.DefaultTokenizerFactory) BasicModelUtils(org.deeplearning4j.models.embeddings.reader.impl.BasicModelUtils) Word2Vec(org.deeplearning4j.models.word2vec.Word2Vec) CBOW(org.deeplearning4j.models.embeddings.learning.impl.elements.CBOW) KoreanTokenizerFactory(org.deeplearning4j.text.tokenization.tokenizerfactory.KoreanTokenizerFactory) SentenceIterator(org.deeplearning4j.text.sentenceiterator.SentenceIterator) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 37 with Ignore

use of org.junit.Ignore in project che by eclipse.

the class AssistQuickFixTest18 method _testConvertToAnonymousClassCreation7.

@Test
@Ignore
public // Bug 427694: [1.8][compiler] Functional interface not identified correctly
void _testConvertToAnonymousClassCreation7() throws Exception {
    IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
    StringBuffer buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("interface I { Object m(Class c); }\n");
    buf.append("interface J<S> { S m(Class<?> c); }\n");
    buf.append("interface K<T> { T m(Class<?> c); }\n");
    buf.append("interface Functional<S,T> extends I, J<S>, K<T> {}\n");
    buf.append("\n");
    buf.append("class C {\n");
    buf.append("    Functional<?, ?> fun= (c) -> { return null;};\n");
    buf.append("}\n");
    ICompilationUnit cu = pack1.createCompilationUnit("C.java", buf.toString(), false, null);
    int offset = buf.toString().indexOf("->");
    AssistContext context = getCorrectionContext(cu, offset, 0);
    assertNoErrors(context);
    List proposals = collectAssists(context, false);
    assertNumberOfProposals(proposals, 2);
    assertCorrectLabels(proposals);
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("interface I { Object m(Class c); }\n");
    buf.append("interface J<S> { S m(Class<?> c); }\n");
    buf.append("interface K<T> { T m(Class<?> c); }\n");
    buf.append("interface Functional<S,T> extends I, J<S>, K<T> {}\n");
    buf.append("\n");
    buf.append("class C {\n");
    buf.append("    Functional<?, ?> fun= new Functional<Object, Object>() {\n");
    buf.append("        @Override\n");
    buf.append("        public Object m(Class c) {\n");
    buf.append("            return null;\n");
    buf.append("        }\n");
    buf.append("    };\n");
    buf.append("}\n");
    String expected1 = buf.toString();
    assertExpectedExistInProposals(proposals, new String[] { expected1 });
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) AssistContext(org.eclipse.jdt.internal.ui.text.correction.AssistContext) List(java.util.List) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 38 with Ignore

use of org.junit.Ignore in project che by eclipse.

the class ModifierCorrectionsQuickFixTest method testSuppressNLSWarningAnnotation1.

@Test
@Ignore
public void testSuppressNLSWarningAnnotation1() throws Exception {
    Hashtable options = JavaCore.getOptions();
    options.put(JavaCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaCore.WARNING);
    JavaCore.setOptions(options);
    IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
    StringBuffer buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("public class E {\n");
    buf.append("    static {\n");
    buf.append("        @SuppressWarnings(\"unused\") String str= \"foo\";");
    buf.append("    }\n");
    buf.append("}\n");
    ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
    CompilationUnit astRoot = getASTRoot(cu);
    ArrayList proposals = collectCorrections(cu, astRoot);
    assertNumberOfProposals(proposals, 4);
    assertCorrectLabels(proposals);
    String[] expected = new String[2];
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("public class E {\n");
    buf.append("    static {\n");
    buf.append("        @SuppressWarnings({\"unused\", \"nls\"}) String str= \"foo\";");
    buf.append("    }\n");
    buf.append("}\n");
    expected[0] = buf.toString();
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("@SuppressWarnings(\"nls\")\n");
    buf.append("public class E {\n");
    buf.append("    static {\n");
    buf.append("        @SuppressWarnings(\"unused\") String str= \"foo\";");
    buf.append("    }\n");
    buf.append("}\n");
    expected[1] = buf.toString();
    assertExpectedExistInProposals(proposals, expected);
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) Hashtable(java.util.Hashtable) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 39 with Ignore

use of org.junit.Ignore in project che by eclipse.

the class UnresolvedTypesQuickFixTest method testAmbiguousTypeInSuperClass.

@Test
@Ignore
public void testAmbiguousTypeInSuperClass() throws Exception {
    createSomeAmbiguity(false, false);
    IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
    StringBuffer buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("import test2.*;\n");
    buf.append("import test3.*;\n");
    buf.append("public class E extends A {\n");
    buf.append("    B b;\n");
    buf.append("    C c;\n");
    buf.append("}\n");
    ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
    CompilationUnit astRoot = getASTRoot(cu);
    ArrayList proposals = collectCorrections(cu, astRoot);
    assertNumberOfProposals(proposals, 2);
    assertCorrectLabels(proposals);
    CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
    String preview1 = getPreviewContent(proposal);
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("import test2.*;\n");
    buf.append("import test2.A;\n");
    buf.append("import test3.*;\n");
    buf.append("public class E extends A {\n");
    buf.append("    B b;\n");
    buf.append("    C c;\n");
    buf.append("}\n");
    String expected1 = buf.toString();
    proposal = (CUCorrectionProposal) proposals.get(1);
    String preview2 = getPreviewContent(proposal);
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("import test2.*;\n");
    buf.append("import test3.*;\n");
    buf.append("import test3.A;\n");
    buf.append("public class E extends A {\n");
    buf.append("    B b;\n");
    buf.append("    C c;\n");
    buf.append("}\n");
    String expected2 = buf.toString();
    assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) CUCorrectionProposal(org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 40 with Ignore

use of org.junit.Ignore in project che by eclipse.

the class UnresolvedTypesQuickFixTest method testAmbiguousTypeInField.

@Test
@Ignore
public void testAmbiguousTypeInField() throws Exception {
    createSomeAmbiguity(true, false);
    IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
    StringBuffer buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("import test2.*;\n");
    buf.append("import test3.*;\n");
    buf.append("public class E {\n");
    buf.append("    A a;\n");
    buf.append("    B b;\n");
    buf.append("    C c;\n");
    buf.append("}\n");
    ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);
    CompilationUnit astRoot = getASTRoot(cu);
    ArrayList proposals = collectCorrections(cu, astRoot);
    assertNumberOfProposals(proposals, 2);
    assertCorrectLabels(proposals);
    CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
    String preview1 = getPreviewContent(proposal);
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("import test2.*;\n");
    buf.append("import test2.A;\n");
    buf.append("import test3.*;\n");
    buf.append("public class E {\n");
    buf.append("    A a;\n");
    buf.append("    B b;\n");
    buf.append("    C c;\n");
    buf.append("}\n");
    String expected1 = buf.toString();
    proposal = (CUCorrectionProposal) proposals.get(1);
    String preview2 = getPreviewContent(proposal);
    buf = new StringBuffer();
    buf.append("package test1;\n");
    buf.append("import test2.*;\n");
    buf.append("import test3.*;\n");
    buf.append("import test3.A;\n");
    buf.append("public class E {\n");
    buf.append("    A a;\n");
    buf.append("    B b;\n");
    buf.append("    C c;\n");
    buf.append("}\n");
    String expected2 = buf.toString();
    assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IPackageFragment(org.eclipse.jdt.core.IPackageFragment) CUCorrectionProposal(org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Ignore (org.junit.Ignore)5092 Test (org.junit.Test)4807 File (java.io.File)445 ArrayList (java.util.ArrayList)374 IOException (java.io.IOException)217 HashMap (java.util.HashMap)187 List (java.util.List)171 CountDownLatch (java.util.concurrent.CountDownLatch)118 Map (java.util.Map)103 LocalDate (java.time.LocalDate)94 Dataset (org.apache.jena.query.Dataset)93 InputStream (java.io.InputStream)89 Date (java.util.Date)88 Random (java.util.Random)85 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)83 Properties (java.util.Properties)78 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)78 HashSet (java.util.HashSet)71 ByteArrayOutputStream (java.io.ByteArrayOutputStream)70 ExecutorService (java.util.concurrent.ExecutorService)70