Explorar o código

场景中心 test

by su %!s(int64=3) %!d(string=hai) anos
pai
achega
747132bfee

+ 5 - 15
4dkankan-center-scene/pom.xml

@@ -57,21 +57,11 @@
 <!--            <version>2.12.3</version>-->
 <!--        </dependency>-->
 
-<!--        <dependency>-->
-<!--            <groupId>org.springframework.boot</groupId>-->
-<!--            <artifactId>spring-boot-starter-test</artifactId>-->
-<!--            <scope>test</scope>-->
-<!--            <exclusions>-->
-<!--                <exclusion>-->
-<!--                    <groupId>org.junit.vintage</groupId>-->
-<!--                    <artifactId>junit-vintage-engine</artifactId>-->
-<!--                </exclusion>-->
-<!--                <exclusion>-->
-<!--                    <groupId>junit</groupId>-->
-<!--                    <artifactId>junit</artifactId>-->
-<!--                </exclusion>-->
-<!--            </exclusions>-->
-<!--        </dependency>-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
 
         <dependency>
             <groupId>org.projectlombok</groupId>

+ 40 - 26
4dkankan-center-scene/src/test/java/com/fdkankan/scene/SceneApplicationTests.java

@@ -1,26 +1,40 @@
-//package com.fdkankan.scene;
-//
-//import com.fdkankan.scene.entity.Folder;
-//import com.fdkankan.scene.service.IFolderService;
-//import org.junit.jupiter.api.Test;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.boot.test.context.SpringBootTest;
-//
-//import java.util.List;
-//
-//@SpringBootTest
-//class ApplicationTests {
-//
-//    @Test
-//    void contextLoads() {
-//    }
-//
-//    @Autowired
-//    private IFolderService folderService;
-//
-//    @Test
-//    public List<Folder> test(){
-//        return folderService.list();
-//    }
-//
-//}
+package com.fdkankan.scene;
+
+import com.fdkankan.common.util.LogoConfig;
+import com.fdkankan.scene.entity.Folder;
+import com.fdkankan.scene.service.IFolderService;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.List;
+
+@SpringBootTest
+class ApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+    @Autowired
+    private IFolderService folderService;
+
+    @Test
+    public List<Folder> test(){
+        return folderService.list();
+    }
+
+    @Test
+    public String test2() throws IOException {
+
+        LogoConfig logoConfig = new LogoConfig();
+
+        logoConfig.LogoMatrix(new BufferedImage(1,1,1), null);
+
+        return "123";
+
+    }
+
+}

+ 7 - 2
4dkankan-common/src/main/java/com/fdkankan/common/util/LogoConfig.java

@@ -27,7 +27,7 @@ public class LogoConfig {
           * 读取Logo图片
           */
          if(logoPath == null){
-             logoPath = this.getClass().getResource("/static/img/logo.png").getPath();
+             logoPath = this.getClass().getResource("classpath:static/img/logo.png").getPath();
          }
          BufferedImage logo = ImageIO.read(new File(logoPath));
 
@@ -50,5 +50,10 @@ public class LogoConfig {
          g2.dispose();  
          matrixImage.flush() ;  
          return matrixImage ;  
-     }  
+     }
+
+//    public static void main(String[] args) {
+//        LogoConfig config = new LogoConfig()
+//        this.getClass().getResource("/static/img/logo.png").getPath();
+//    }
 }