commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1646788 - in /commons/proper/bcel/trunk/src/test: java/org/apache/bcel/util/Class2HTMLTestCase.java resources/ resources/Java8Example.class resources/Java8Example.java
Date Fri, 19 Dec 2014 16:16:01 GMT
Author: ebourg
Date: Fri Dec 19 16:16:00 2014
New Revision: 1646788

URL: http://svn.apache.org/r1646788
Log:
Added a test for Class2HTML

Added:
    commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java 
 (with props)
    commons/proper/bcel/trunk/src/test/resources/
    commons/proper/bcel/trunk/src/test/resources/Java8Example.class   (with props)
    commons/proper/bcel/trunk/src/test/resources/Java8Example.java   (with props)

Added: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java?rev=1646788&view=auto
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java (added)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java Fri
Dec 19 16:16:00 2014
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.bcel.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import junit.framework.TestCase;
+import org.apache.bcel.classfile.ClassParser;
+
+public class Class2HTMLTestCase extends TestCase {
+
+    public void testConvertJavaUtil() throws Exception {
+        File outputDir = new File("target/test-output/html");
+        outputDir.mkdirs();
+
+        FileInputStream file = new FileInputStream("target/test-classes/Java8Example.class");
+
+        ClassParser parser = new ClassParser(file, "Java8Example.class");
+
+        new Class2HTML(parser.parse(), outputDir.getAbsolutePath() + "/");
+    }
+}

Propchange: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/bcel/trunk/src/test/java/org/apache/bcel/util/Class2HTMLTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: commons/proper/bcel/trunk/src/test/resources/Java8Example.class
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/resources/Java8Example.class?rev=1646788&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/bcel/trunk/src/test/resources/Java8Example.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/bcel/trunk/src/test/resources/Java8Example.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/resources/Java8Example.java?rev=1646788&view=auto
==============================================================================
--- commons/proper/bcel/trunk/src/test/resources/Java8Example.java (added)
+++ commons/proper/bcel/trunk/src/test/resources/Java8Example.java Fri Dec 19 16:16:00 2014
@@ -0,0 +1,13 @@
+import java.util.*;
+import java.util.stream.*;
+
+public interface Java8Example {
+
+    default void hello() {
+        List<String> words = Arrays.asList("Hello", "World", "hi");
+        System.out.println(words);
+        
+        List<String> words2 = words.stream().filter((String s) -> s.length() >
2).collect(Collectors.<String> toList());
+        System.out.println(words2);
+    }
+}

Propchange: commons/proper/bcel/trunk/src/test/resources/Java8Example.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/bcel/trunk/src/test/resources/Java8Example.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



Mime
View raw message