package com.opennms.cassandra.mapper;


import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.junit.Test;


public class SchemaTest {

    @Entity
    @Table(name = "points")
    private class Point {
        @Id
        private UUID m_id;
        @Column(name = "x")
        private double m_x;
        @Column(name = "y")
        private double m_y;

        private Point(double x, double y) {
            m_x = x;
            m_y = y;
        }
    }

    @Entity
    private class InvalidConstructor {
        InvalidConstructor(String argument) {

        }
    }

    @Test
    public void test() {
        System.err.println(Schema.fromClass(Point.class));
    }

    @Test
    public void testOneToMany() {
        System.err.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        System.err.println(Schema.fromClass(Address.class).toDDL());
        System.err.println(Schema.fromClass(User.class).toDDL());
        System.err.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");    
    }

    @Test(expected = IllegalArgumentException.class)
    public void testNoArgConstructor() {
        Schema.fromClass(InvalidConstructor.class);
    }
}

@@ -48,520 +48,81 @@
 java
-.util.UUID;%0A%0Aimport javax.persistence.Column;%0Aimport javax.persistence.Entity;%0Aimport javax.persistence.Id;%0Aimport javax.persistence.Table;%0A%0Aimport org.junit.Test;%0A%0A%0Apublic class SchemaTest %7B%0A%0A    @Entity%0A    @Table(name = %22points%22)%0A    private class Point %7B%0A        @Id%0A        private UUID m_id;%0A        @Column(name = %22x%22)%0A        private double m_x;%0A        @Column(name = %22y%22)%0A        private double m_y;%0A%0A        private Point(double x, double y) %7B%0A            m_x = x;%0A            m_y = y;%0A        %7D%0A    %7D
+x.persistence.Entity;%0A%0Aimport org.junit.Test;%0A%0A%0Apublic class SchemaTest %7B
 %0A%0A  
@@ -170,16 +170,52 @@
 uctor %7B%0A
+        @SuppressWarnings(%22unused%22)%0A
         
@@ -274,437 +274,8 @@
  %7D%0A%0A
-    @Test%0A    public void test() %7B%0A        System.err.println(Schema.fromClass(Point.class));%0A    %7D%0A%0A    @Test%0A    public void testOneToMany() %7B%0A        System.err.println(%22~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%22);%0A        System.err.println(Schema.fromClass(Address.class).toDDL());%0A        System.err.println(Schema.fromClass(User.class).toDDL());%0A        System.err.println(%22~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%22);    %0A    %7D%0A%0A
     
@@ -422,10 +422,11 @@
 ;%0A    %7D%0A
+%0A
 %7D%0A

remove useless test code